| 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 361 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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().image.IsEmpty()) { | 379 !active_entry->GetFavicon().image.IsEmpty()) { |
| 380 std::vector<unsigned char> image_data; | 380 std::vector<unsigned char> image_data; |
| 381 // TODO: Add all variants once the history service supports it. | 381 // TODO: Add all variants once the history service supports it. |
| 382 gfx::PNGCodec::EncodeBGRASkBitmap(active_entry->GetFavicon().AsBitmap(), | 382 gfx::PNGCodec::EncodeBGRASkBitmap( |
| 383 false, &image_data); | 383 active_entry->GetFavicon().image.AsBitmap(), false, &image_data); |
| 384 favicon_service->SetFavicon(active_entry->GetURL(), | 384 favicon_service->SetFavicon(active_entry->GetURL(), |
| 385 active_entry->GetFavicon().url, | 385 active_entry->GetFavicon().url, |
| 386 image_data, | 386 image_data, |
| 387 history::FAVICON); | 387 history::FAVICON); |
| 388 if (supports_instant && !add_page_vector_.empty()) { | 388 if (supports_instant && !add_page_vector_.empty()) { |
| 389 // 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 |
| 390 // 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 |
| 391 // url we're adding to history (see comment in ReleasePreviewContents | 391 // url we're adding to history (see comment in ReleasePreviewContents |
| 392 // for details). | 392 // for details). |
| 393 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... |
| 1194 host->Send(new ChromeViewMsg_SearchBoxResize( | 1194 host->Send(new ChromeViewMsg_SearchBoxResize( |
| 1195 host->GetRoutingID(), GetOmniboxBoundsInTermsOfPreview())); | 1195 host->GetRoutingID(), GetOmniboxBoundsInTermsOfPreview())); |
| 1196 } else { | 1196 } else { |
| 1197 host->Send(new ChromeViewMsg_SearchBoxChange( | 1197 host->Send(new ChromeViewMsg_SearchBoxChange( |
| 1198 host->GetRoutingID(), user_text, verbatim, 0, 0)); | 1198 host->GetRoutingID(), user_text, verbatim, 0, 0)); |
| 1199 } | 1199 } |
| 1200 | 1200 |
| 1201 frame_load_observer_.reset(new FrameLoadObserver( | 1201 frame_load_observer_.reset(new FrameLoadObserver( |
| 1202 this, preview_contents()->web_contents(), user_text, verbatim)); | 1202 this, preview_contents()->web_contents(), user_text, verbatim)); |
| 1203 } | 1203 } |
| OLD | NEW |