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

Side by Side Diff: chrome/browser/instant/instant_loader.cc

Issue 6651014: Applied the IconType. (Closed) Base URL: http://git.chromium.org/git/chromium.git@trunk
Patch Set: Addressed the comments Created 9 years, 9 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 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/instant/instant_loader.h" 5 #include "chrome/browser/instant/instant_loader.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <string> 8 #include <string>
9 #include <utility> 9 #include <utility>
10 #include <vector> 10 #include <vector>
(...skipping 301 matching lines...) Expand 10 before | Expand all | Expand 10 after
312 FaviconService* favicon_service = 312 FaviconService* favicon_service =
313 tab->profile()->GetFaviconService(Profile::EXPLICIT_ACCESS); 313 tab->profile()->GetFaviconService(Profile::EXPLICIT_ACCESS);
314 314
315 if (favicon_service && active_entry->favicon().is_valid() && 315 if (favicon_service && active_entry->favicon().is_valid() &&
316 !active_entry->favicon().bitmap().empty()) { 316 !active_entry->favicon().bitmap().empty()) {
317 std::vector<unsigned char> image_data; 317 std::vector<unsigned char> image_data;
318 gfx::PNGCodec::EncodeBGRASkBitmap(active_entry->favicon().bitmap(), false, 318 gfx::PNGCodec::EncodeBGRASkBitmap(active_entry->favicon().bitmap(), false,
319 &image_data); 319 &image_data);
320 favicon_service->SetFavicon(active_entry->url(), 320 favicon_service->SetFavicon(active_entry->url(),
321 active_entry->favicon().url(), 321 active_entry->favicon().url(),
322 image_data); 322 image_data,
323 history::FAV_ICON);
323 if (supports_instant && !add_page_vector_.empty()) { 324 if (supports_instant && !add_page_vector_.empty()) {
324 // If we're using the instant API, then we've tweaked the url that is 325 // If we're using the instant API, then we've tweaked the url that is
325 // going to be added to history. We need to also set the favicon for the 326 // going to be added to history. We need to also set the favicon for the
326 // url we're adding to history (see comment in ReleasePreviewContents 327 // url we're adding to history (see comment in ReleasePreviewContents
327 // for details). 328 // for details).
328 favicon_service->SetFavicon(add_page_vector_.back()->url, 329 favicon_service->SetFavicon(add_page_vector_.back()->url,
329 active_entry->favicon().url(), 330 active_entry->favicon().url(),
330 image_data); 331 image_data,
332 history::FAV_ICON);
331 } 333 }
332 } 334 }
333 } 335 }
334 336
335 void InstantLoader::TabContentsDelegateImpl::RegisterForPaintNotifications( 337 void InstantLoader::TabContentsDelegateImpl::RegisterForPaintNotifications(
336 RenderWidgetHost* render_widget_host) { 338 RenderWidgetHost* render_widget_host) {
337 DCHECK(registered_render_widget_host_ == NULL); 339 DCHECK(registered_render_widget_host_ == NULL);
338 registered_render_widget_host_ = render_widget_host; 340 registered_render_widget_host_ = render_widget_host;
339 Source<RenderWidgetHost> source = 341 Source<RenderWidgetHost> source =
340 Source<RenderWidgetHost>(registered_render_widget_host_); 342 Source<RenderWidgetHost>(registered_render_widget_host_);
(...skipping 596 matching lines...) Expand 10 before | Expand all | Expand 10 after
937 Source<NavigationController>(&preview_contents_->controller())); 939 Source<NavigationController>(&preview_contents_->controller()));
938 #endif 940 #endif
939 941
940 registrar_.Add( 942 registrar_.Add(
941 this, 943 this,
942 NotificationType::NAV_ENTRY_COMMITTED, 944 NotificationType::NAV_ENTRY_COMMITTED,
943 Source<NavigationController>(&preview_contents_->controller())); 945 Source<NavigationController>(&preview_contents_->controller()));
944 946
945 preview_contents_->tab_contents()->ShowContents(); 947 preview_contents_->tab_contents()->ShowContents();
946 } 948 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698