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

Unified Diff: chrome/browser/extensions/app_notify_channel_ui.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/extensions/app_notify_channel_ui.cc
diff --git a/chrome/browser/extensions/app_notify_channel_ui.cc b/chrome/browser/extensions/app_notify_channel_ui.cc
index 5d030faf9c5b458159adfbecd7ecf03fb8c19b6a..fb89a0205e396730ea512dd92c49704eec293356 100644
--- a/chrome/browser/extensions/app_notify_channel_ui.cc
+++ b/chrome/browser/extensions/app_notify_channel_ui.cc
@@ -8,6 +8,7 @@
#include "chrome/browser/infobars/infobar_tab_helper.h"
#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/sync/profile_sync_service.h"
+#include "chrome/browser/sync/profile_sync_service_factory.h"
#include "chrome/browser/sync/sync_setup_wizard.h"
#include "chrome/browser/tab_contents/confirm_infobar_delegate.h"
#include "chrome/browser/ui/browser.h"
@@ -115,7 +116,8 @@ void AppNotifyChannelUIImpl::OnInfoBarResult(bool accepted) {
if (accepted) {
StartObservingSync();
ProfileSyncService* service =
- browser_->profile()->GetOriginalProfile()->GetProfileSyncService();
+ ProfileSyncServiceFactory::GetInstance()->GetForProfile(
+ browser_->profile()->GetOriginalProfile());
service->ShowLoginDialog();
} else {
delegate_->OnSyncSetupResult(false);
@@ -124,7 +126,8 @@ void AppNotifyChannelUIImpl::OnInfoBarResult(bool accepted) {
void AppNotifyChannelUIImpl::OnStateChanged() {
ProfileSyncService* sync_service =
- browser_->profile()->GetProfileSyncService();
+ ProfileSyncServiceFactory::GetInstance()->GetForProfile(
+ browser_->profile()->GetOriginalProfile());
bool wizard_visible = sync_service->WizardIsVisible();
// ProfileSyncService raises OnStateChanged many times. Even multiple
// times before the wizard actually becomes visible for the first time.
@@ -143,11 +146,13 @@ void AppNotifyChannelUIImpl::OnStateChanged() {
void AppNotifyChannelUIImpl::StartObservingSync() {
CHECK(!observing_sync_);
observing_sync_ = true;
- browser_->profile()->GetProfileSyncService()->AddObserver(this);
+ ProfileSyncServiceFactory::GetInstance()->GetForProfile(
+ browser_->profile()->GetOriginalProfile())->AddObserver(this);
}
void AppNotifyChannelUIImpl::StopObservingSync() {
CHECK(observing_sync_);
observing_sync_ = false;
- browser_->profile()->GetProfileSyncService()->RemoveObserver(this);
+ ProfileSyncServiceFactory::GetInstance()->GetForProfile(
+ browser_->profile()->GetOriginalProfile())->RemoveObserver(this);
}
« no previous file with comments | « chrome/browser/chromeos/login/screen_locker.cc ('k') | chrome/browser/extensions/extension_webstore_private_api.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698