OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/ui/webui/options2/stop_syncing_handler2.h" | 5 #include "chrome/browser/ui/webui/options2/stop_syncing_handler2.h" |
6 | 6 |
7 #include "base/basictypes.h" | 7 #include "base/basictypes.h" |
8 #include "base/bind.h" | 8 #include "base/bind.h" |
9 #include "base/utf_string_conversions.h" | 9 #include "base/utf_string_conversions.h" |
10 #include "base/values.h" | 10 #include "base/values.h" |
11 #include "chrome/browser/google/google_util.h" | 11 #include "chrome/browser/google/google_util.h" |
12 #include "chrome/browser/profiles/profile.h" | 12 #include "chrome/browser/profiles/profile.h" |
13 #include "chrome/browser/profiles/profile_manager.h" | 13 #include "chrome/browser/profiles/profile_manager.h" |
14 #include "chrome/browser/sync/profile_sync_service.h" | 14 #include "chrome/browser/sync/profile_sync_service.h" |
15 #include "chrome/common/url_constants.h" | 15 #include "chrome/common/url_constants.h" |
| 16 #include "content/browser/webui/web_ui.h" |
16 #include "grit/chromium_strings.h" | 17 #include "grit/chromium_strings.h" |
17 #include "grit/generated_resources.h" | 18 #include "grit/generated_resources.h" |
18 #include "ui/base/l10n/l10n_util.h" | 19 #include "ui/base/l10n/l10n_util.h" |
19 | 20 |
20 namespace options2 { | 21 namespace options2 { |
21 | 22 |
22 StopSyncingHandler::StopSyncingHandler() { | 23 StopSyncingHandler::StopSyncingHandler() { |
23 } | 24 } |
24 | 25 |
25 StopSyncingHandler::~StopSyncingHandler() { | 26 StopSyncingHandler::~StopSyncingHandler() { |
(...skipping 22 matching lines...) Expand all Loading... |
48 void StopSyncingHandler::StopSyncing(const ListValue* args){ | 49 void StopSyncingHandler::StopSyncing(const ListValue* args){ |
49 ProfileSyncService* service = | 50 ProfileSyncService* service = |
50 Profile::FromWebUI(web_ui())->GetProfileSyncService(); | 51 Profile::FromWebUI(web_ui())->GetProfileSyncService(); |
51 if (service != NULL && ProfileSyncService::IsSyncEnabled()) { | 52 if (service != NULL && ProfileSyncService::IsSyncEnabled()) { |
52 service->DisableForUser(); | 53 service->DisableForUser(); |
53 ProfileSyncService::SyncEvent(ProfileSyncService::STOP_FROM_OPTIONS); | 54 ProfileSyncService::SyncEvent(ProfileSyncService::STOP_FROM_OPTIONS); |
54 } | 55 } |
55 } | 56 } |
56 | 57 |
57 } // namespace options2 | 58 } // namespace options2 |
OLD | NEW |