| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "chrome/browser/dom_ui/options/stop_syncing_handler.h" | 5 #include "chrome/browser/dom_ui/options/stop_syncing_handler.h" |
| 6 | 6 |
| 7 #include "app/l10n_util.h" | 7 #include "app/l10n_util.h" |
| 8 #include "base/basictypes.h" | 8 #include "base/basictypes.h" |
| 9 #include "base/values.h" | 9 #include "base/values.h" |
| 10 #include "base/callback.h" | 10 #include "base/callback.h" |
| (...skipping 21 matching lines...) Expand all Loading... |
| 32 l10n_util::GetStringUTF16(IDS_SYNC_STOP_SYNCING_CONFIRM_BUTTON_LABEL)); | 32 l10n_util::GetStringUTF16(IDS_SYNC_STOP_SYNCING_CONFIRM_BUTTON_LABEL)); |
| 33 } | 33 } |
| 34 | 34 |
| 35 void StopSyncingHandler::RegisterMessages() { | 35 void StopSyncingHandler::RegisterMessages() { |
| 36 DCHECK(dom_ui_); | 36 DCHECK(dom_ui_); |
| 37 dom_ui_->RegisterMessageCallback("stopSyncing", | 37 dom_ui_->RegisterMessageCallback("stopSyncing", |
| 38 NewCallback(this, &StopSyncingHandler::StopSyncing)); | 38 NewCallback(this, &StopSyncingHandler::StopSyncing)); |
| 39 } | 39 } |
| 40 | 40 |
| 41 void StopSyncingHandler::StopSyncing(const ListValue* args){ | 41 void StopSyncingHandler::StopSyncing(const ListValue* args){ |
| 42 ProfileSyncService* service = dom_ui_->GetProfile()->GetProfileSyncService(); | 42 ProfileSyncService* service = |
| 43 dom_ui_->GetOriginalProfile()->GetProfileSyncService(); |
| 43 if (service != NULL && ProfileSyncService::IsSyncEnabled()) { | 44 if (service != NULL && ProfileSyncService::IsSyncEnabled()) { |
| 44 service->DisableForUser(); | 45 service->DisableForUser(); |
| 45 ProfileSyncService::SyncEvent(ProfileSyncService::STOP_FROM_OPTIONS); | 46 ProfileSyncService::SyncEvent(ProfileSyncService::STOP_FROM_OPTIONS); |
| 46 } | 47 } |
| 47 } | 48 } |
| OLD | NEW |