OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 358 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
369 // assign it to me (sky). | 369 // assign it to me (sky). |
370 NOTREACHED(); | 370 NOTREACHED(); |
371 return; | 371 return; |
372 } | 372 } |
373 tab->history_tab_helper()->UpdateHistoryPageTitle(*active_entry); | 373 tab->history_tab_helper()->UpdateHistoryPageTitle(*active_entry); |
374 | 374 |
375 FaviconService* favicon_service = | 375 FaviconService* favicon_service = |
376 tab->profile()->GetFaviconService(Profile::EXPLICIT_ACCESS); | 376 tab->profile()->GetFaviconService(Profile::EXPLICIT_ACCESS); |
377 | 377 |
378 if (favicon_service && active_entry->GetFavicon().valid && | 378 if (favicon_service && active_entry->GetFavicon().valid && |
379 !active_entry->GetFavicon().bitmap.empty()) { | 379 !active_entry->GetFavicon().image.IsEmpty()) { |
380 std::vector<unsigned char> image_data; | 380 std::vector<unsigned char> image_data; |
381 gfx::PNGCodec::EncodeBGRASkBitmap(active_entry->GetFavicon().bitmap, false, | 381 // TODO: Add all variants once the history service supports it. |
382 &image_data); | 382 gfx::PNGCodec::EncodeBGRASkBitmap(active_entry->GetFavicon().AsBitmap(), |
| 383 false, &image_data); |
383 favicon_service->SetFavicon(active_entry->GetURL(), | 384 favicon_service->SetFavicon(active_entry->GetURL(), |
384 active_entry->GetFavicon().url, | 385 active_entry->GetFavicon().url, |
385 image_data, | 386 image_data, |
386 history::FAVICON); | 387 history::FAVICON); |
387 if (supports_instant && !add_page_vector_.empty()) { | 388 if (supports_instant && !add_page_vector_.empty()) { |
388 // If we're using the instant API, then we've tweaked the url that is | 389 // If we're using the instant API, then we've tweaked the url that is |
389 // going to be added to history. We need to also set the favicon for the | 390 // going to be added to history. We need to also set the favicon for the |
390 // url we're adding to history (see comment in ReleasePreviewContents | 391 // url we're adding to history (see comment in ReleasePreviewContents |
391 // for details). | 392 // for details). |
392 favicon_service->SetFavicon(add_page_vector_.back()->url, | 393 favicon_service->SetFavicon(add_page_vector_.back()->url, |
(...skipping 800 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1193 host->Send(new ChromeViewMsg_SearchBoxResize( | 1194 host->Send(new ChromeViewMsg_SearchBoxResize( |
1194 host->GetRoutingID(), GetOmniboxBoundsInTermsOfPreview())); | 1195 host->GetRoutingID(), GetOmniboxBoundsInTermsOfPreview())); |
1195 } else { | 1196 } else { |
1196 host->Send(new ChromeViewMsg_SearchBoxChange( | 1197 host->Send(new ChromeViewMsg_SearchBoxChange( |
1197 host->GetRoutingID(), user_text, verbatim, 0, 0)); | 1198 host->GetRoutingID(), user_text, verbatim, 0, 0)); |
1198 } | 1199 } |
1199 | 1200 |
1200 frame_load_observer_.reset(new FrameLoadObserver( | 1201 frame_load_observer_.reset(new FrameLoadObserver( |
1201 this, preview_contents()->web_contents(), user_text, verbatim)); | 1202 this, preview_contents()->web_contents(), user_text, verbatim)); |
1202 } | 1203 } |
OLD | NEW |