Commit fe87d97a authored by gcasto's avatar gcasto Committed by Commit bot

[Password Generation] Change links in the bubble to point to the local manager

BUG=413846

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

Cr-Commit-Position: refs/heads/master@{#296482}
parent bb72a524
...@@ -41,7 +41,7 @@ using namespace password_manager::mac::ui; ...@@ -41,7 +41,7 @@ using namespace password_manager::mac::ui;
- (BOOL)textView:(NSTextView*)textView - (BOOL)textView:(NSTextView*)textView
clickedOnLink:(id)link clickedOnLink:(id)link
atIndex:(NSUInteger)charIndex { atIndex:(NSUInteger)charIndex {
model_->OnRemoteManageLinkClicked(); model_->OnManageLinkClicked();
[delegate_ viewShouldDismiss]; [delegate_ viewShouldDismiss];
return YES; return YES;
} }
......
...@@ -76,7 +76,7 @@ TEST_F(ManagePasswordsBubbleConfirmationViewControllerTest, ...@@ -76,7 +76,7 @@ TEST_F(ManagePasswordsBubbleConfirmationViewControllerTest,
ShouldOpenPasswordsAndDismissWhenLinkClicked) { ShouldOpenPasswordsAndDismissWhenLinkClicked) {
[controller().confirmationText clickedOnLink:nil atIndex:0]; [controller().confirmationText clickedOnLink:nil atIndex:0];
EXPECT_TRUE([delegate() dismissed]); EXPECT_TRUE([delegate() dismissed]);
EXPECT_TRUE(ui_controller()->navigated_to_account_central_management_page()); EXPECT_TRUE(ui_controller()->navigated_to_settings_page());
} }
} // namespace } // namespace
...@@ -167,16 +167,6 @@ void ManagePasswordsBubbleModel::OnManageLinkClicked() { ...@@ -167,16 +167,6 @@ void ManagePasswordsBubbleModel::OnManageLinkClicked() {
->NavigateToPasswordManagerSettingsPage(); ->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( void ManagePasswordsBubbleModel::OnPasswordAction(
const autofill::PasswordForm& password_form, const autofill::PasswordForm& password_form,
PasswordAction action) { PasswordAction action) {
......
...@@ -60,10 +60,6 @@ class ManagePasswordsBubbleModel : public content::WebContentsObserver { ...@@ -60,10 +60,6 @@ class ManagePasswordsBubbleModel : public content::WebContentsObserver {
// Called by the view code when the manage link is clicked by the user. // Called by the view code when the manage link is clicked by the user.
void OnManageLinkClicked(); 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 // Called by the view code to delete or add a password form to the
// PasswordStore. // PasswordStore.
void OnPasswordAction(const autofill::PasswordForm& password_form, void OnPasswordAction(const autofill::PasswordForm& password_form,
......
...@@ -167,18 +167,6 @@ void ManagePasswordsUIController:: ...@@ -167,18 +167,6 @@ void ManagePasswordsUIController::
#endif #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() { void ManagePasswordsUIController::SavePassword() {
DCHECK(PasswordPendingUserDecision()); DCHECK(PasswordPendingUserDecision());
SavePasswordInternal(); SavePasswordInternal();
......
...@@ -77,11 +77,6 @@ class ManagePasswordsUIController ...@@ -77,11 +77,6 @@ class ManagePasswordsUIController
// Open a new tab, pointing to the password manager settings page. // Open a new tab, pointing to the password manager settings page.
virtual void NavigateToPasswordManagerSettingsPage(); 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; virtual const autofill::PasswordForm& PendingCredentials() const;
// Set the state of the Omnibox icon, and possibly show the associated bubble // Set the state of the Omnibox icon, and possibly show the associated bubble
......
...@@ -10,7 +10,6 @@ ManagePasswordsUIControllerMock::ManagePasswordsUIControllerMock( ...@@ -10,7 +10,6 @@ ManagePasswordsUIControllerMock::ManagePasswordsUIControllerMock(
content::WebContents* contents) content::WebContents* contents)
: ManagePasswordsUIController(contents), : ManagePasswordsUIController(contents),
navigated_to_settings_page_(false), navigated_to_settings_page_(false),
navigated_to_account_central_management_page_(false),
saved_password_(false), saved_password_(false),
never_saved_password_(false) { never_saved_password_(false) {
contents->SetUserData(UserDataKey(), this); contents->SetUserData(UserDataKey(), this);
...@@ -24,10 +23,6 @@ void ManagePasswordsUIControllerMock:: ...@@ -24,10 +23,6 @@ void ManagePasswordsUIControllerMock::
navigated_to_settings_page_ = true; navigated_to_settings_page_ = true;
} }
void ManagePasswordsUIControllerMock::NavigateToAccountCentralManagementPage() {
navigated_to_account_central_management_page_ = true;
}
const autofill::PasswordForm& const autofill::PasswordForm&
ManagePasswordsUIControllerMock::PendingCredentials() const { ManagePasswordsUIControllerMock::PendingCredentials() const {
return pending_credentials_; return pending_credentials_;
......
...@@ -33,11 +33,6 @@ class ManagePasswordsUIControllerMock ...@@ -33,11 +33,6 @@ class ManagePasswordsUIControllerMock
return navigated_to_settings_page_; 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. // We don't have a FormManager in tests, so stub these out.
virtual void SavePasswordInternal() OVERRIDE; virtual void SavePasswordInternal() OVERRIDE;
bool saved_password() const { return saved_password_; } bool saved_password() const { return saved_password_; }
...@@ -63,7 +58,6 @@ class ManagePasswordsUIControllerMock ...@@ -63,7 +58,6 @@ class ManagePasswordsUIControllerMock
private: private:
bool navigated_to_settings_page_; bool navigated_to_settings_page_;
bool navigated_to_account_central_management_page_;
bool saved_password_; bool saved_password_;
bool never_saved_password_; bool never_saved_password_;
......
...@@ -627,7 +627,7 @@ ManagePasswordsBubbleView::SaveConfirmationView::~SaveConfirmationView() { ...@@ -627,7 +627,7 @@ ManagePasswordsBubbleView::SaveConfirmationView::~SaveConfirmationView() {
void ManagePasswordsBubbleView::SaveConfirmationView::StyledLabelLinkClicked( void ManagePasswordsBubbleView::SaveConfirmationView::StyledLabelLinkClicked(
const gfx::Range& range, int event_flags) { const gfx::Range& range, int event_flags) {
DCHECK_EQ(range, parent_->model()->save_confirmation_link_range()); DCHECK_EQ(range, parent_->model()->save_confirmation_link_range());
parent_->model()->OnRemoteManageLinkClicked(); parent_->model()->OnManageLinkClicked();
parent_->Close(); parent_->Close();
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment