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

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

Issue 9169096: Remove a bunch of GetProfileSyncService callers to use the new factory. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rm todos Created 8 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/ui/webui/options/personal_options_handler.cc
diff --git a/chrome/browser/ui/webui/options/personal_options_handler.cc b/chrome/browser/ui/webui/options/personal_options_handler.cc
index 34b0ad1c772ef3442bc14e9bf7f334f8ecc23a7d..f2ad5572cb197710ca45f89f980440e364423f5c 100644
--- a/chrome/browser/ui/webui/options/personal_options_handler.cc
+++ b/chrome/browser/ui/webui/options/personal_options_handler.cc
@@ -23,6 +23,7 @@
#include "chrome/browser/profiles/profile_info_util.h"
#include "chrome/browser/profiles/profile_manager.h"
#include "chrome/browser/sync/profile_sync_service.h"
+#include "chrome/browser/sync/profile_sync_service_factory.h"
#include "chrome/browser/sync/sync_setup_flow.h"
#include "chrome/browser/sync/sync_ui_util.h"
#include "chrome/browser/themes/theme_service.h"
@@ -65,8 +66,8 @@ PersonalOptionsHandler::PersonalOptionsHandler() {
}
PersonalOptionsHandler::~PersonalOptionsHandler() {
- ProfileSyncService* sync_service =
- Profile::FromWebUI(web_ui())->GetProfileSyncService();
+ ProfileSyncService* sync_service(ProfileSyncServiceFactory::
+ GetInstance()->GetForProfile(Profile::FromWebUI(web_ui())));
if (sync_service)
sync_service->RemoveObserver(this);
}
@@ -251,8 +252,8 @@ void PersonalOptionsHandler::Observe(
void PersonalOptionsHandler::OnStateChanged() {
string16 status_label;
string16 link_label;
- ProfileSyncService* service =
- Profile::FromWebUI(web_ui())->GetProfileSyncService();
+ ProfileSyncService* service(ProfileSyncServiceFactory::
+ GetInstance()->GetForProfile(Profile::FromWebUI(web_ui())));
DCHECK(service);
bool managed = service->IsManaged();
bool sync_setup_completed = service->HasSyncSetupCompleted();
@@ -369,7 +370,8 @@ void PersonalOptionsHandler::Initialize() {
content::NotificationService::AllSources());
ObserveThemeChanged();
- ProfileSyncService* sync_service = profile->GetProfileSyncService();
+ ProfileSyncService* sync_service(ProfileSyncServiceFactory::
+ GetInstance()->GetForProfile(profile));
if (sync_service) {
sync_service->AddObserver(this);
OnStateChanged();
« no previous file with comments | « chrome/browser/ui/webui/options/options_sync_setup_handler.cc ('k') | chrome/browser/ui/webui/options/stop_syncing_handler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698