Index: chrome/browser/ui/webui/ntp/new_tab_page_sync_handler.cc |
diff --git a/chrome/browser/ui/webui/ntp/new_tab_page_sync_handler.cc b/chrome/browser/ui/webui/ntp/new_tab_page_sync_handler.cc |
index 0cf46ff67e6d571947bd72f0d7ba97033df431e7..33eea81681d2612ec6c54eafd33d21575bacaff4 100644 |
--- a/chrome/browser/ui/webui/ntp/new_tab_page_sync_handler.cc |
+++ b/chrome/browser/ui/webui/ntp/new_tab_page_sync_handler.cc |
@@ -98,7 +98,7 @@ NewTabPageSyncHandler::MessageType |
} |
WebUIMessageHandler* NewTabPageSyncHandler::Attach(WebUI* web_ui) { |
- sync_service_ = web_ui->GetProfile()->GetProfileSyncService(); |
+ sync_service_ = Profile::FromWebUI(web_ui)->GetProfileSyncService(); |
DCHECK(sync_service_); // This shouldn't get called by an incognito NTP. |
DCHECK(!sync_service_->IsManaged()); // And neither if sync is managed. |
sync_service_->AddObserver(this); |