diff options
author | tim@chromium.org <tim@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-10-15 21:52:28 +0000 |
---|---|---|
committer | tim@chromium.org <tim@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-10-15 21:52:28 +0000 |
commit | d742d2f41fd7035ef040a1b76bd5bcd93ae9b0ac (patch) | |
tree | 1593105e3c5b59d87bcedbb465eb9d67500f3fdd /chrome/browser/views/options | |
parent | 53556e1b386f14de94d97351e47774b97c0ed753 (diff) | |
download | chromium_src-d742d2f41fd7035ef040a1b76bd5bcd93ae9b0ac.zip chromium_src-d742d2f41fd7035ef040a1b76bd5bcd93ae9b0ac.tar.gz chromium_src-d742d2f41fd7035ef040a1b76bd5bcd93ae9b0ac.tar.bz2 |
Facelifts to sync UI
BUG=23136,24858,21596
TEST=SyncSetupWizardTest
Review URL: http://codereview.chromium.org/270081
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@29197 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/views/options')
-rw-r--r-- | chrome/browser/views/options/content_page_view.cc | 19 | ||||
-rw-r--r-- | chrome/browser/views/options/content_page_view.h | 7 |
2 files changed, 23 insertions, 3 deletions
diff --git a/chrome/browser/views/options/content_page_view.cc b/chrome/browser/views/options/content_page_view.cc index 2f8efb0..a3df28c 100644 --- a/chrome/browser/views/options/content_page_view.cc +++ b/chrome/browser/views/options/content_page_view.cc @@ -128,9 +128,19 @@ void ContentPageView::ButtonPressed( #ifdef CHROME_PERSONALIZATION } else if (sender == sync_start_stop_button_) { DCHECK(sync_service_); + if (sync_service_->HasSyncSetupCompleted()) { - sync_service_->DisableForUser(); - ProfileSyncService::SyncEvent(ProfileSyncService::STOP_FROM_OPTIONS); + ConfirmMessageBoxDialog::RunWithCustomConfiguration( + GetWindow()->GetNativeWindow(), + this, + l10n_util::GetString(IDS_SYNC_STOP_SYNCING_EXPLANATION_LABEL), + l10n_util::GetString(IDS_SYNC_STOP_SYNCING_BUTTON_LABEL), + l10n_util::GetString(IDS_SYNC_STOP_SYNCING_CONFIRM_BUTTON_LABEL), + l10n_util::GetString(IDS_CANCEL), + gfx::Size(views::Window::GetLocalizedContentsSize( + IDS_CONFIRM_STOP_SYNCING_DIALOG_WIDTH_CHARS, + IDS_CONFIRM_STOP_SYNCING_DIALOG_HEIGHT_LINES))); + return; } else { sync_service_->EnableForUser(); ProfileSyncService::SyncEvent(ProfileSyncService::START_FROM_OPTIONS); @@ -422,6 +432,11 @@ void ContentPageView::InitBrowsingDataGroup() { L"", true); } +void ContentPageView::OnConfirmMessageAccept() { + sync_service_->DisableForUser(); + ProfileSyncService::SyncEvent(ProfileSyncService::STOP_FROM_OPTIONS); +} + #ifdef CHROME_PERSONALIZATION void ContentPageView::InitSyncGroup() { sync_status_label_ = new views::Label; diff --git a/chrome/browser/views/options/content_page_view.h b/chrome/browser/views/options/content_page_view.h index 62133c0..e3902c4 100644 --- a/chrome/browser/views/options/content_page_view.h +++ b/chrome/browser/views/options/content_page_view.h @@ -7,6 +7,7 @@ #include "chrome/browser/sync/profile_sync_service.h" #include "chrome/browser/views/options/options_page_view.h" +#include "chrome/browser/views/confirm_message_box_dialog.h" #include "chrome/common/pref_member.h" #include "views/controls/button/button.h" #include "views/controls/link.h" @@ -30,7 +31,8 @@ class ContentPageView : public OptionsPageView, public views::LinkController, public ProfileSyncServiceObserver, #endif - public views::ButtonListener { + public views::ButtonListener, + public ConfirmMessageBoxObserver { public: explicit ContentPageView(Profile* profile); virtual ~ContentPageView(); @@ -41,6 +43,9 @@ class ContentPageView : public OptionsPageView, // views::LinkController method. virtual void LinkActivated(views::Link* source, int event_flags); + // ConfirmMessageBoxObserver implementation. + virtual void OnConfirmMessageAccept(); + #ifdef CHROME_PERSONALIZATION // ProfileSyncServiceObserver method. virtual void OnStateChanged(); |