Index: chrome/browser/ui/webui/sync_setup_handler.cc |
diff --git a/chrome/browser/ui/webui/sync_setup_handler.cc b/chrome/browser/ui/webui/sync_setup_handler.cc |
index f652481598989f490171f67dce6d7e404ef42e88..92013bb910df20267f766be87b5a76811fa1affc 100644 |
--- a/chrome/browser/ui/webui/sync_setup_handler.cc |
+++ b/chrome/browser/ui/webui/sync_setup_handler.cc |
@@ -301,7 +301,9 @@ void SyncSetupHandler::RegisterMessages() { |
// The current implementation is functional, but fails asthetically. |
// TODO(rickcam): Bug 90711: Update UI for OAuth sign-in flow |
void SyncSetupHandler::ShowOAuthLogin() { |
- web_ui_->GetProfile()->GetProfileSyncService()->signin()->StartOAuthSignIn(); |
+ Profile* profile = |
+ Profile::FromBrowserContext(web_ui_->tab_contents()->browser_context()); |
+ profile->GetProfileSyncService()->signin()->StartOAuthSignIn(); |
} |
void SyncSetupHandler::ShowGaiaLogin(const DictionaryValue& args) { |
@@ -432,8 +434,9 @@ void SyncSetupHandler::HandleAttachHandler(const ListValue* args) { |
void SyncSetupHandler::HandleShowErrorUI(const ListValue* args) { |
DCHECK(!flow_); |
- ProfileSyncService* service = |
- web_ui_->GetProfile()->GetProfileSyncService(); |
+ Profile* profile = |
+ Profile::FromBrowserContext(web_ui_->tab_contents()->browser_context()); |
+ ProfileSyncService* service = profile->GetProfileSyncService(); |
DCHECK(service); |
service->get_wizard().Step(SyncSetupWizard::NONFATAL_ERROR); |
@@ -463,7 +466,9 @@ void SyncSetupHandler::OpenSyncSetup() { |
DCHECK(web_ui_); |
DCHECK(!flow_); |
- ProfileSyncService* service = web_ui_->GetProfile()->GetProfileSyncService(); |
+ Profile* profile = |
+ Profile::FromBrowserContext(web_ui_->tab_contents()->browser_context()); |
+ ProfileSyncService* service = profile->GetProfileSyncService(); |
if (!service) { |
// If there's no sync service, the user tried to manually invoke a syncSetup |
// URL, but sync features are disabled. We need to close the overlay for |