summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorakalin@chromium.org <akalin@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-11-11 20:59:23 +0000
committerakalin@chromium.org <akalin@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-11-11 20:59:23 +0000
commit5315d8abb13f55db24b829757ed8b5f6ad2027ac (patch)
tree5267009212ccf0dd6dcd444ed4a4cf9fb290577b
parentb68ea565edfbae4afd574f91ef26e7cfe93b4c2f (diff)
downloadchromium_src-5315d8abb13f55db24b829757ed8b5f6ad2027ac.zip
chromium_src-5315d8abb13f55db24b829757ed8b5f6ad2027ac.tar.gz
chromium_src-5315d8abb13f55db24b829757ed8b5f6ad2027ac.tar.bz2
Implemented sync button action.
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@31702 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r--chrome/browser/cocoa/preferences_window_controller.h1
-rw-r--r--chrome/browser/cocoa/preferences_window_controller.mm25
2 files changed, 26 insertions, 0 deletions
diff --git a/chrome/browser/cocoa/preferences_window_controller.h b/chrome/browser/cocoa/preferences_window_controller.h
index 8f53189..92b640a 100644
--- a/chrome/browser/cocoa/preferences_window_controller.h
+++ b/chrome/browser/cocoa/preferences_window_controller.h
@@ -118,6 +118,7 @@ class ProfileSyncService;
- (IBAction)clearData:(id)sender;
- (IBAction)resetThemeToDefault:(id)sender;
- (IBAction)themesGallery:(id)sender;
+- (IBAction)doSyncAction:(id)sender;
// Under the hood
- (IBAction)browseDownloadLocation:(id)sender;
diff --git a/chrome/browser/cocoa/preferences_window_controller.mm b/chrome/browser/cocoa/preferences_window_controller.mm
index 2a2133e..8abfe46 100644
--- a/chrome/browser/cocoa/preferences_window_controller.mm
+++ b/chrome/browser/cocoa/preferences_window_controller.mm
@@ -1169,6 +1169,31 @@ const int kDisabledIndex = 1;
}
}
+- (IBAction)doSyncAction:(id)sender {
+ 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);
+ }
+}
+
- (void)setPasswordManagerEnabledIndex:(NSInteger)value {
if (value == kEnabledIndex)
[self recordUserAction:L"Options_PasswordManager_Enable"];