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

Side by Side Diff: chrome/browser/favicon/favicon_tab_helper.cc

Issue 8603015: Get rid of a bunch of view_messages.h includes from chrome by making the TabContentsObserver inte... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: fix linux and try to fix mac again Created 9 years, 1 month 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chrome/browser/favicon/favicon_tab_helper.h" 5 #include "chrome/browser/favicon/favicon_tab_helper.h"
6 6
7 #include "chrome/browser/favicon/favicon_handler.h" 7 #include "chrome/browser/favicon/favicon_handler.h"
8 #include "chrome/browser/history/history.h" 8 #include "chrome/browser/history/history.h"
9 #include "chrome/browser/profiles/profile.h" 9 #include "chrome/browser/profiles/profile.h"
10 #include "chrome/common/chrome_constants.h" 10 #include "chrome/common/chrome_constants.h"
(...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after
152 !profile_->IsOffTheRecord()) { 152 !profile_->IsOffTheRecord()) {
153 FaviconService* favicon_service = 153 FaviconService* favicon_service =
154 profile_->GetFaviconService(Profile::IMPLICIT_ACCESS); 154 profile_->GetFaviconService(Profile::IMPLICIT_ACCESS);
155 if (favicon_service) 155 if (favicon_service)
156 favicon_service->SetFaviconOutOfDateForPage(url); 156 favicon_service->SetFaviconOutOfDateForPage(url);
157 } 157 }
158 } 158 }
159 159
160 void FaviconTabHelper::DidNavigateMainFrame( 160 void FaviconTabHelper::DidNavigateMainFrame(
161 const content::LoadCommittedDetails& details, 161 const content::LoadCommittedDetails& details,
162 const ViewHostMsg_FrameNavigate_Params& params) { 162 const content::FrameNavigateParams& params) {
163 // Get the favicon, either from history or request it from the net. 163 // Get the favicon, either from history or request it from the net.
164 FetchFavicon(details.entry->url()); 164 FetchFavicon(details.entry->url());
165 } 165 }
166 166
167 bool FaviconTabHelper::OnMessageReceived(const IPC::Message& message) { 167 bool FaviconTabHelper::OnMessageReceived(const IPC::Message& message) {
168 bool message_handled = true; 168 bool message_handled = true;
169 IPC_BEGIN_MESSAGE_MAP(FaviconTabHelper, message) 169 IPC_BEGIN_MESSAGE_MAP(FaviconTabHelper, message)
170 IPC_MESSAGE_HANDLER(IconHostMsg_DidDownloadFavicon, OnDidDownloadFavicon) 170 IPC_MESSAGE_HANDLER(IconHostMsg_DidDownloadFavicon, OnDidDownloadFavicon)
171 IPC_MESSAGE_HANDLER(IconHostMsg_UpdateFaviconURL, OnUpdateFaviconURL) 171 IPC_MESSAGE_HANDLER(IconHostMsg_UpdateFaviconURL, OnUpdateFaviconURL)
172 IPC_MESSAGE_UNHANDLED(message_handled = false) 172 IPC_MESSAGE_UNHANDLED(message_handled = false)
173 IPC_END_MESSAGE_MAP() 173 IPC_END_MESSAGE_MAP()
174 return message_handled; 174 return message_handled;
175 } 175 }
176 176
177 void FaviconTabHelper::OnDidDownloadFavicon(int id, 177 void FaviconTabHelper::OnDidDownloadFavicon(int id,
178 const GURL& image_url, 178 const GURL& image_url,
179 bool errored, 179 bool errored,
180 const SkBitmap& image) { 180 const SkBitmap& image) {
181 gfx::Image favicon(new SkBitmap(image)); 181 gfx::Image favicon(new SkBitmap(image));
182 favicon_handler_->OnDidDownloadFavicon(id, image_url, errored, favicon); 182 favicon_handler_->OnDidDownloadFavicon(id, image_url, errored, favicon);
183 if (touch_icon_handler_.get()) 183 if (touch_icon_handler_.get())
184 touch_icon_handler_->OnDidDownloadFavicon(id, image_url, errored, favicon); 184 touch_icon_handler_->OnDidDownloadFavicon(id, image_url, errored, favicon);
185 } 185 }
OLDNEW
« no previous file with comments | « chrome/browser/favicon/favicon_tab_helper.h ('k') | chrome/browser/history/history_tab_helper.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698