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

Unified Diff: chrome/browser/ui/webui/ntp/new_tab_page_sync_handler.cc

Issue 7554008: Removal of Profile from content part 6. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 9 years, 4 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/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..d95d1bcb2d5620700a57afd834b4bd52ef35f05b 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
@@ -14,6 +14,7 @@
#include "chrome/browser/net/chrome_url_request_context.h"
#include "chrome/browser/profiles/profile.h"
#include "content/browser/renderer_host/render_view_host.h"
+#include "content/browser/tab_contents/tab_contents.h"
#include "grit/generated_resources.h"
#include "net/base/cookie_monster.h"
#include "net/url_request/url_request_context.h"
@@ -98,7 +99,9 @@ NewTabPageSyncHandler::MessageType
}
WebUIMessageHandler* NewTabPageSyncHandler::Attach(WebUI* web_ui) {
- sync_service_ = web_ui->GetProfile()->GetProfileSyncService();
+ Profile* profile =
+ Profile::FromBrowserContext(web_ui->tab_contents()->browser_context());
+ sync_service_ = profile->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);

Powered by Google App Engine
This is Rietveld 408576698