Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(514)

Side by Side Diff: chrome/browser/dom_ui/options/stop_syncing_handler.cc

Issue 6260002: Fix chromium-os:10777 and other sync related crashes. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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
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 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698