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

Unified Diff: chrome/browser/ui/webui/ntp/favicon_webui_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/favicon_webui_handler.cc
diff --git a/chrome/browser/ui/webui/ntp/favicon_webui_handler.cc b/chrome/browser/ui/webui/ntp/favicon_webui_handler.cc
index 72466c4e3b6da7625aef726d45d2d473dfcc9c26..a912b49e25381c8e58b4319da6bff96d1383045c 100644
--- a/chrome/browser/ui/webui/ntp/favicon_webui_handler.cc
+++ b/chrome/browser/ui/webui/ntp/favicon_webui_handler.cc
@@ -9,6 +9,7 @@
#include "base/values.h"
#include "chrome/browser/profiles/profile.h"
#include "chrome/common/url_constants.h"
+#include "content/browser/tab_contents/tab_contents.h"
#include "grit/ui_resources.h"
#include "third_party/skia/include/core/SkBitmap.h"
#include "ui/gfx/codec/png_codec.h"
@@ -35,8 +36,10 @@ void FaviconWebUIHandler::HandleGetFaviconDominantColor(const ListValue* args) {
double id;
CHECK(args->GetDouble(1, &id));
+ Profile* profile =
+ Profile::FromBrowserContext(web_ui_->tab_contents()->browser_context());
FaviconService* favicon_service =
- web_ui_->GetProfile()->GetFaviconService(Profile::EXPLICIT_ACCESS);
+ profile->GetFaviconService(Profile::EXPLICIT_ACCESS);
if (!favicon_service || path.empty())
return;
@@ -51,8 +54,10 @@ void FaviconWebUIHandler::HandleGetFaviconDominantColor(const ListValue* args) {
void FaviconWebUIHandler::OnFaviconDataAvailable(
FaviconService::Handle request_handle,
history::FaviconData favicon) {
+ Profile* profile =
+ Profile::FromBrowserContext(web_ui_->tab_contents()->browser_context());
FaviconService* favicon_service =
- web_ui_->GetProfile()->GetFaviconService(Profile::EXPLICIT_ACCESS);
+ profile->GetFaviconService(Profile::EXPLICIT_ACCESS);
int id = consumer_.GetClientData(favicon_service, request_handle);
FundamentalValue id_value(id);
scoped_ptr<StringValue> color_value;

Powered by Google App Engine
This is Rietveld 408576698