OLD | NEW |
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 302 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
313 FaviconService* favicon_service = | 313 FaviconService* favicon_service = |
314 tab->profile()->GetFaviconService(Profile::EXPLICIT_ACCESS); | 314 tab->profile()->GetFaviconService(Profile::EXPLICIT_ACCESS); |
315 | 315 |
316 if (favicon_service && active_entry->favicon().is_valid() && | 316 if (favicon_service && active_entry->favicon().is_valid() && |
317 !active_entry->favicon().bitmap().empty()) { | 317 !active_entry->favicon().bitmap().empty()) { |
318 std::vector<unsigned char> image_data; | 318 std::vector<unsigned char> image_data; |
319 gfx::PNGCodec::EncodeBGRASkBitmap(active_entry->favicon().bitmap(), false, | 319 gfx::PNGCodec::EncodeBGRASkBitmap(active_entry->favicon().bitmap(), false, |
320 &image_data); | 320 &image_data); |
321 favicon_service->SetFavicon(active_entry->url(), | 321 favicon_service->SetFavicon(active_entry->url(), |
322 active_entry->favicon().url(), | 322 active_entry->favicon().url(), |
323 image_data); | 323 image_data, |
| 324 history::FAVICON); |
324 if (supports_instant && !add_page_vector_.empty()) { | 325 if (supports_instant && !add_page_vector_.empty()) { |
325 // If we're using the instant API, then we've tweaked the url that is | 326 // If we're using the instant API, then we've tweaked the url that is |
326 // going to be added to history. We need to also set the favicon for the | 327 // going to be added to history. We need to also set the favicon for the |
327 // url we're adding to history (see comment in ReleasePreviewContents | 328 // url we're adding to history (see comment in ReleasePreviewContents |
328 // for details). | 329 // for details). |
329 favicon_service->SetFavicon(add_page_vector_.back()->url, | 330 favicon_service->SetFavicon(add_page_vector_.back()->url, |
330 active_entry->favicon().url(), | 331 active_entry->favicon().url(), |
331 image_data); | 332 image_data, |
| 333 history::FAVICON); |
332 } | 334 } |
333 } | 335 } |
334 } | 336 } |
335 | 337 |
336 void InstantLoader::TabContentsDelegateImpl::RegisterForPaintNotifications( | 338 void InstantLoader::TabContentsDelegateImpl::RegisterForPaintNotifications( |
337 RenderWidgetHost* render_widget_host) { | 339 RenderWidgetHost* render_widget_host) { |
338 DCHECK(registered_render_widget_host_ == NULL); | 340 DCHECK(registered_render_widget_host_ == NULL); |
339 registered_render_widget_host_ = render_widget_host; | 341 registered_render_widget_host_ = render_widget_host; |
340 Source<RenderWidgetHost> source = | 342 Source<RenderWidgetHost> source = |
341 Source<RenderWidgetHost>(registered_render_widget_host_); | 343 Source<RenderWidgetHost>(registered_render_widget_host_); |
(...skipping 616 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
958 Source<NavigationController>(&preview_contents_->controller())); | 960 Source<NavigationController>(&preview_contents_->controller())); |
959 #endif | 961 #endif |
960 | 962 |
961 registrar_.Add( | 963 registrar_.Add( |
962 this, | 964 this, |
963 NotificationType::NAV_ENTRY_COMMITTED, | 965 NotificationType::NAV_ENTRY_COMMITTED, |
964 Source<NavigationController>(&preview_contents_->controller())); | 966 Source<NavigationController>(&preview_contents_->controller())); |
965 | 967 |
966 preview_contents_->tab_contents()->ShowContents(); | 968 preview_contents_->tab_contents()->ShowContents(); |
967 } | 969 } |
OLD | NEW |