Chromium Code Reviews| 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..6b7fe857edb417f28ae156be29e495a5cf22dc94 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); |
| @@ -123,8 +125,10 @@ void AppNotifyChannelUIImpl::OnInfoBarResult(bool accepted) { |
| } |
| void AppNotifyChannelUIImpl::OnStateChanged() { |
| + // TODO(REVIEWERS): Why does this not use OriginalProfile but above we do? |
|
asargent_no_longer_on_chrome
2012/01/27 00:49:20
This (and all the others below) can use OriginalPr
|
| ProfileSyncService* sync_service = |
| - browser_->profile()->GetProfileSyncService(); |
| + ProfileSyncServiceFactory::GetInstance()->GetForProfile( |
| + browser_->profile()); |
| 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 +147,15 @@ void AppNotifyChannelUIImpl::OnStateChanged() { |
| void AppNotifyChannelUIImpl::StartObservingSync() { |
| CHECK(!observing_sync_); |
| observing_sync_ = true; |
| - browser_->profile()->GetProfileSyncService()->AddObserver(this); |
| + // TODO(REVIEWERS): Why does this not use OriginalProfile but above we do? |
| + ProfileSyncServiceFactory::GetInstance()->GetForProfile( |
| + browser_->profile())->AddObserver(this); |
| } |
| void AppNotifyChannelUIImpl::StopObservingSync() { |
| CHECK(observing_sync_); |
| observing_sync_ = false; |
| - browser_->profile()->GetProfileSyncService()->RemoveObserver(this); |
| + // TODO(REVIEWERS): Why does this not use OriginalProfile but above we do? |
| + ProfileSyncServiceFactory::GetInstance()->GetForProfile( |
| + browser_->profile())->RemoveObserver(this); |
| } |