Skip to content

Commit

Permalink
[Password Generation] Change links in the bubble to point to the loca…
Browse files Browse the repository at this point in the history
…l manager

BUG=413846

Review URL: https://codereview.chromium.org/583883003

Cr-Commit-Position: refs/heads/master@{#296482}
  • Loading branch information
gcasto authored and Commit bot committed Sep 24, 2014
1 parent bb72a52 commit fe87d97
Show file tree
Hide file tree
Showing 9 changed files with 3 additions and 45 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ - (void)onOKClicked:(id)sender {
- (BOOL)textView:(NSTextView*)textView
clickedOnLink:(id)link
atIndex:(NSUInteger)charIndex {
model_->OnRemoteManageLinkClicked();
model_->OnManageLinkClicked();
[delegate_ viewShouldDismiss];
return YES;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ virtual void SetUp() OVERRIDE {
ShouldOpenPasswordsAndDismissWhenLinkClicked) {
[controller().confirmationText clickedOnLink:nil atIndex:0];
EXPECT_TRUE([delegate() dismissed]);
EXPECT_TRUE(ui_controller()->navigated_to_account_central_management_page());
EXPECT_TRUE(ui_controller()->navigated_to_settings_page());
}

} // namespace
10 changes: 0 additions & 10 deletions chrome/browser/ui/passwords/manage_passwords_bubble_model.cc
Original file line number Diff line number Diff line change
Expand Up @@ -167,16 +167,6 @@ void ManagePasswordsBubbleModel::OnManageLinkClicked() {
->NavigateToPasswordManagerSettingsPage();
}

// TODO(gcasto): Is it worth having a new dismissal reason to distinguish
// the two management cases? User intention is pretty similar between the two,
// but the context in which they are shown is pretty different since one is
// from an explict action and the other isn't.
void ManagePasswordsBubbleModel::OnRemoteManageLinkClicked() {
dismissal_reason_ = metrics_util::CLICKED_MANAGE;
ManagePasswordsUIController::FromWebContents(web_contents())
->NavigateToAccountCentralManagementPage();
}

void ManagePasswordsBubbleModel::OnPasswordAction(
const autofill::PasswordForm& password_form,
PasswordAction action) {
Expand Down
4 changes: 0 additions & 4 deletions chrome/browser/ui/passwords/manage_passwords_bubble_model.h
Original file line number Diff line number Diff line change
Expand Up @@ -60,10 +60,6 @@ class ManagePasswordsBubbleModel : public content::WebContentsObserver {
// Called by the view code when the manage link is clicked by the user.
void OnManageLinkClicked();

// Called by the view code when the manage in Google link is clicked by the
// user.
void OnRemoteManageLinkClicked();

// Called by the view code to delete or add a password form to the
// PasswordStore.
void OnPasswordAction(const autofill::PasswordForm& password_form,
Expand Down
12 changes: 0 additions & 12 deletions chrome/browser/ui/passwords/manage_passwords_ui_controller.cc
Original file line number Diff line number Diff line change
Expand Up @@ -167,18 +167,6 @@ void ManagePasswordsUIController::
#endif
}

void ManagePasswordsUIController::NavigateToAccountCentralManagementPage() {
// TODO(gcasto): FindBowserWithWebContents() doesn't exist on Android.
// Need to determine how this should work there.
#if !defined(OS_ANDROID)
Browser* browser = chrome::FindBrowserWithWebContents(web_contents());
content::OpenURLParams params(
GURL(chrome::kAutoPasswordGenerationLearnMoreURL), content::Referrer(),
NEW_FOREGROUND_TAB, ui::PAGE_TRANSITION_LINK, false);
browser->OpenURL(params);
#endif
}

void ManagePasswordsUIController::SavePassword() {
DCHECK(PasswordPendingUserDecision());
SavePasswordInternal();
Expand Down
5 changes: 0 additions & 5 deletions chrome/browser/ui/passwords/manage_passwords_ui_controller.h
Original file line number Diff line number Diff line change
Expand Up @@ -77,11 +77,6 @@ class ManagePasswordsUIController
// Open a new tab, pointing to the password manager settings page.
virtual void NavigateToPasswordManagerSettingsPage();

// Open a new tab, pointing to the Google manage passwords website.
// TODO(gcasto): Change this to navigate to account central once passwords
// are visible there. Currently goes to the Chrome support page.
virtual void NavigateToAccountCentralManagementPage();

virtual const autofill::PasswordForm& PendingCredentials() const;

// Set the state of the Omnibox icon, and possibly show the associated bubble
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ ManagePasswordsUIControllerMock::ManagePasswordsUIControllerMock(
content::WebContents* contents)
: ManagePasswordsUIController(contents),
navigated_to_settings_page_(false),
navigated_to_account_central_management_page_(false),
saved_password_(false),
never_saved_password_(false) {
contents->SetUserData(UserDataKey(), this);
Expand All @@ -24,10 +23,6 @@ void ManagePasswordsUIControllerMock::
navigated_to_settings_page_ = true;
}

void ManagePasswordsUIControllerMock::NavigateToAccountCentralManagementPage() {
navigated_to_account_central_management_page_ = true;
}

const autofill::PasswordForm&
ManagePasswordsUIControllerMock::PendingCredentials() const {
return pending_credentials_;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,6 @@ class ManagePasswordsUIControllerMock
return navigated_to_settings_page_;
}

virtual void NavigateToAccountCentralManagementPage() OVERRIDE;
bool navigated_to_account_central_management_page() const {
return navigated_to_account_central_management_page_;
}

// We don't have a FormManager in tests, so stub these out.
virtual void SavePasswordInternal() OVERRIDE;
bool saved_password() const { return saved_password_; }
Expand All @@ -63,7 +58,6 @@ class ManagePasswordsUIControllerMock

private:
bool navigated_to_settings_page_;
bool navigated_to_account_central_management_page_;
bool saved_password_;
bool never_saved_password_;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -627,7 +627,7 @@ ManagePasswordsBubbleView::SaveConfirmationView::~SaveConfirmationView() {
void ManagePasswordsBubbleView::SaveConfirmationView::StyledLabelLinkClicked(
const gfx::Range& range, int event_flags) {
DCHECK_EQ(range, parent_->model()->save_confirmation_link_range());
parent_->model()->OnRemoteManageLinkClicked();
parent_->model()->OnManageLinkClicked();
parent_->Close();
}

Expand Down

0 comments on commit fe87d97

Please sign in to comment.