diff options
author | guohui@chromium.org <guohui@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-05-09 02:25:07 +0000 |
---|---|---|
committer | guohui@chromium.org <guohui@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-05-09 02:25:07 +0000 |
commit | 63f0a87074e1e096e484b4496bf8cc9e79676a2f (patch) | |
tree | 343e5cc3a6ef85b1ecbee92db1d04a7bf1039721 | |
parent | 346e45aa47b6821867b46539c89b64e13445fadf (diff) | |
download | chromium_src-63f0a87074e1e096e484b4496bf8cc9e79676a2f.zip chromium_src-63f0a87074e1e096e484b4496bf8cc9e79676a2f.tar.gz chromium_src-63f0a87074e1e096e484b4496bf8cc9e79676a2f.tar.bz2 |
Mirror: Updates account removal per the new spec
Updates strings and instead of relaunching chrome after removing an account, simply shows the account management view of the avatar menu.
BUG=345075
Review URL: https://codereview.chromium.org/271553005
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@269155 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r-- | chrome/app/chromium_strings.grd | 2 | ||||
-rw-r--r-- | chrome/app/generated_resources.grd | 2 | ||||
-rw-r--r-- | chrome/app/google_chrome_strings.grd | 2 | ||||
-rw-r--r-- | chrome/browser/ui/cocoa/profiles/profile_chooser_controller.h | 6 | ||||
-rw-r--r-- | chrome/browser/ui/cocoa/profiles/profile_chooser_controller.mm | 27 | ||||
-rw-r--r-- | chrome/browser/ui/views/profiles/profile_chooser_view.cc | 12 | ||||
-rw-r--r-- | chrome/browser/ui/views/profiles/profile_chooser_view.h | 2 |
7 files changed, 27 insertions, 26 deletions
diff --git a/chrome/app/chromium_strings.grd b/chrome/app/chromium_strings.grd index 60f4577..0ef2bd4 100644 --- a/chrome/app/chromium_strings.grd +++ b/chrome/app/chromium_strings.grd @@ -843,7 +843,7 @@ For Chromium, processes used to display diagnostics information (such as this "a <!-- Account removal view in the avatar menu bubble --> <message name="IDS_PROFILES_ACCOUNT_REMOVAL_TEXT" desc="Main text of the account removal view when removing a secondary account."> - To remove your account, Chromium needs to restart. Make sure you've saved any open work before continuing. + After removing your account from Chromium, you may need to reload your open tabs to take effect. </message> <message name="IDS_PROFILES_PRIMARY_ACCOUNT_REMOVAL_TEXT" desc="Main text of the account removal view when removing a primary account."> You're using <ph name="PROFILE_EMAIL">$1<ex>jessica@gmail.com</ex></ph> to sync your Chromium stuff. To update your sync preference or to use Chromium without a Google account, visit <ph name="SETTINGS_LINK">$2<ex>settings</ex></ph>. diff --git a/chrome/app/generated_resources.grd b/chrome/app/generated_resources.grd index 821fa4b..a3ef69a 100644 --- a/chrome/app/generated_resources.grd +++ b/chrome/app/generated_resources.grd @@ -11123,7 +11123,7 @@ Would you like to start <ph name="CONTROL_PANEL_APPLET_NAME">$1<ex>Add/Remove Pr settings </message> <message name="IDS_PROFILES_ACCOUNT_REMOVAL_BUTTON" desc="Text of the ok button on the account removal view in the avatar menu bubble."> - Remove account and relaunch + Remove account </message> <message name="IDS_PROFILES_PREVIEW_ENABLED_TUTORIAL_TITLE" desc="Title of the tutorial card in the avatar menu bubble view shown when new profile management preview is enabled."> You're all set diff --git a/chrome/app/google_chrome_strings.grd b/chrome/app/google_chrome_strings.grd index 4a4e563..99e5a76 100644 --- a/chrome/app/google_chrome_strings.grd +++ b/chrome/app/google_chrome_strings.grd @@ -767,7 +767,7 @@ For Google Chrome, processes used to display diagnostics information (such as th <!-- Account removal view in the avatar menu bubble --> <message name="IDS_PROFILES_ACCOUNT_REMOVAL_TEXT" desc="Main text of the account removal view when removing a secondary account."> - To remove your account, Chrome needs to restart. Make sure you've saved any open work before continuing. + After removing your account from Chrome, you may need to reload your open tabs to take effect. </message> <message name="IDS_PROFILES_PRIMARY_ACCOUNT_REMOVAL_TEXT" desc="Main text of the account removal view when removing a primary account."> You're using <ph name="PROFILE_EMAIL">$1<ex>jessica@gmail.com</ex></ph> to sync your Chrome stuff. To update your sync preference or to use Chrome without a Google account, visit <ph name="SETTINGS_LINK">$2<ex>settings</ex></ph>. diff --git a/chrome/browser/ui/cocoa/profiles/profile_chooser_controller.h b/chrome/browser/ui/cocoa/profiles/profile_chooser_controller.h index 2b7b9da..a492b6b 100644 --- a/chrome/browser/ui/cocoa/profiles/profile_chooser_controller.h +++ b/chrome/browser/ui/cocoa/profiles/profile_chooser_controller.h @@ -52,7 +52,7 @@ class WebContents; // The id for the account that the user has requested to remove from the // current profile. It is set in |showAccountRemovalView| and used in - // |removeAccountAndRelaunch|. + // |removeAccount|. std::string accountIdToRemove_; // Active view mode. @@ -114,8 +114,8 @@ class WebContents; // account from the active profile if possible. - (IBAction)showAccountRemovalView:(id)sender; -// Removes the current account |accountIdToRemove_| and relaunches the browser. -- (IBAction)removeAccountAndRelaunch:(id)sender; +// Removes the current account |accountIdToRemove_|. +- (IBAction)removeAccount:(id)sender; // Reset the WebContents used by the Gaia embedded view. - (void)cleanUpEmbeddedViewContents; diff --git a/chrome/browser/ui/cocoa/profiles/profile_chooser_controller.mm b/chrome/browser/ui/cocoa/profiles/profile_chooser_controller.mm index 00e48cc..4fe34a7 100644 --- a/chrome/browser/ui/cocoa/profiles/profile_chooser_controller.mm +++ b/chrome/browser/ui/cocoa/profiles/profile_chooser_controller.mm @@ -794,12 +794,13 @@ class ActiveProfileObserverBridge : public AvatarMenuObserver, [self initMenuContentsWithView:BUBBLE_VIEW_MODE_ACCOUNT_REMOVAL]; } -- (IBAction)removeAccountAndRelaunch:(id)sender { +- (IBAction)removeAccount:(id)sender { DCHECK(!accountIdToRemove_.empty()); ProfileOAuth2TokenServiceFactory::GetPlatformSpecificForProfile( browser_->profile())->RevokeCredentials(accountIdToRemove_); accountIdToRemove_.clear(); - chrome::AttemptRestart(); + + [self initMenuContentsWithView:BUBBLE_VIEW_MODE_ACCOUNT_MANAGEMENT]; } - (IBAction)openTutorialLearnMoreURL:(id)sender { @@ -1410,22 +1411,22 @@ class ActiveProfileObserverBridge : public AvatarMenuObserver, browser_->profile())->GetAuthenticatedUsername(); bool isPrimaryAccount = primaryAccount == accountIdToRemove_; - // Adds "remove and relaunch" button at the bottom if needed. + // Adds "remove account" button at the bottom if needed. if (!isPrimaryAccount) { - base::scoped_nsobject<NSButton> removeAndRelaunchButton( + base::scoped_nsobject<NSButton> removeAccountButton( [[BlueLabelButton alloc] initWithFrame:NSZeroRect]); - [removeAndRelaunchButton setTitle:l10n_util::GetNSString( + [removeAccountButton setTitle:l10n_util::GetNSString( IDS_PROFILES_ACCOUNT_REMOVAL_BUTTON)]; - [removeAndRelaunchButton setTarget:self]; - [removeAndRelaunchButton setAction:@selector(removeAccountAndRelaunch:)]; - [removeAndRelaunchButton sizeToFit]; - [removeAndRelaunchButton setAlignment:NSCenterTextAlignment]; + [removeAccountButton setTarget:self]; + [removeAccountButton setAction:@selector(removeAccount:)]; + [removeAccountButton sizeToFit]; + [removeAccountButton setAlignment:NSCenterTextAlignment]; CGFloat xOffset = (kFixedAccountRemovalViewWidth - - NSWidth([removeAndRelaunchButton frame])) / 2; - [removeAndRelaunchButton setFrameOrigin:NSMakePoint(xOffset, yOffset)]; - [container addSubview:removeAndRelaunchButton]; + NSWidth([removeAccountButton frame])) / 2; + [removeAccountButton setFrameOrigin:NSMakePoint(xOffset, yOffset)]; + [container addSubview:removeAccountButton]; - yOffset = NSMaxY([removeAndRelaunchButton frame]) + kVerticalSpacing; + yOffset = NSMaxY([removeAccountButton frame]) + kVerticalSpacing; } NSView* contentView; diff --git a/chrome/browser/ui/views/profiles/profile_chooser_view.cc b/chrome/browser/ui/views/profiles/profile_chooser_view.cc index bc606d1..ceca42c 100644 --- a/chrome/browser/ui/views/profiles/profile_chooser_view.cc +++ b/chrome/browser/ui/views/profiles/profile_chooser_view.cc @@ -460,7 +460,7 @@ void ProfileChooserView::ResetView() { tutorial_send_feedback_button_ = NULL; end_preview_and_relaunch_button_ = NULL; end_preview_cancel_button_ = NULL; - remove_account_and_relaunch_button_ = NULL; + remove_account_button_ = NULL; account_removal_cancel_button_ = NULL; gaia_signin_cancel_button_ = NULL; open_other_profile_indexes_map_.clear(); @@ -581,7 +581,7 @@ void ProfileChooserView::ButtonPressed(views::Button* sender, ProfileMetrics::LogProfileUpgradeEnrollment( ProfileMetrics::PROFILE_ENROLLMENT_ACCEPT_NEW_PROFILE_MGMT); profiles::EnableNewProfileManagementPreview(); - } else if (sender == remove_account_and_relaunch_button_) { + } else if (sender == remove_account_button_) { RemoveAccount(); } else if (sender == account_removal_cancel_button_) { account_id_to_remove_.clear(); @@ -643,7 +643,7 @@ void ProfileChooserView::RemoveAccount() { oauth2_token_service->RevokeCredentials(account_id_to_remove_); account_id_to_remove_.clear(); - chrome::AttemptRestart(); + ShowView(BUBBLE_VIEW_MODE_ACCOUNT_MANAGEMENT, avatar_menu_.get()); } void ProfileChooserView::LinkClicked(views::Link* sender, int event_flags) { @@ -1239,13 +1239,13 @@ views::View* ProfileChooserView::CreateAccountRemovalView() { // Adds button. if (!is_primary_account) { - remove_account_and_relaunch_button_ = new views::BlueButton( + remove_account_button_ = new views::BlueButton( this, l10n_util::GetStringUTF16(IDS_PROFILES_ACCOUNT_REMOVAL_BUTTON)); - remove_account_and_relaunch_button_->SetHorizontalAlignment( + remove_account_button_->SetHorizontalAlignment( gfx::ALIGN_CENTER); layout->StartRowWithPadding( 1, 0, 0, views::kUnrelatedControlVerticalSpacing); - layout->AddView(remove_account_and_relaunch_button_); + layout->AddView(remove_account_button_); } else { layout->AddPaddingRow(0, views::kUnrelatedControlVerticalSpacing); } diff --git a/chrome/browser/ui/views/profiles/profile_chooser_view.h b/chrome/browser/ui/views/profiles/profile_chooser_view.h index 66f76b6..8b844ae 100644 --- a/chrome/browser/ui/views/profiles/profile_chooser_view.h +++ b/chrome/browser/ui/views/profiles/profile_chooser_view.h @@ -236,7 +236,7 @@ class ProfileChooserView : public views::BubbleDelegateView, views::ImageButton* gaia_signin_cancel_button_; // Links and buttons displayed in the account removal view. - views::LabelButton* remove_account_and_relaunch_button_; + views::LabelButton* remove_account_button_; views::ImageButton* account_removal_cancel_button_; // Links and buttons displayed in the end-preview view. |