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

Unified Diff: chrome/browser/ui/webui/options/stop_syncing_handler.cc

Issue 7554008: Removal of Profile from content part 6. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 9 years, 4 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/ui/webui/options/stop_syncing_handler.cc
diff --git a/chrome/browser/ui/webui/options/stop_syncing_handler.cc b/chrome/browser/ui/webui/options/stop_syncing_handler.cc
index 7831ab2234b18401cb2dbfc14951ddf4fe581d1b..08e133c9ceaa5fc96cf0336cf0ad5080a083352f 100644
--- a/chrome/browser/ui/webui/options/stop_syncing_handler.cc
+++ b/chrome/browser/ui/webui/options/stop_syncing_handler.cc
@@ -10,6 +10,7 @@
#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/profiles/profile_manager.h"
#include "chrome/browser/sync/profile_sync_service.h"
+#include "content/browser/tab_contents/tab_contents.h"
#include "grit/chromium_strings.h"
#include "grit/generated_resources.h"
#include "ui/base/l10n/l10n_util.h"
@@ -38,7 +39,9 @@ void StopSyncingHandler::RegisterMessages() {
}
void StopSyncingHandler::StopSyncing(const ListValue* args){
- ProfileSyncService* service = web_ui_->GetProfile()->GetProfileSyncService();
+ Profile* profile =
+ Profile::FromBrowserContext(web_ui_->tab_contents()->browser_context());
+ ProfileSyncService* service = profile->GetProfileSyncService();
if (service != NULL && ProfileSyncService::IsSyncEnabled()) {
service->DisableForUser();
ProfileSyncService::SyncEvent(ProfileSyncService::STOP_FROM_OPTIONS);

Powered by Google App Engine
This is Rietveld 408576698