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 "chrome/browser/content_settings/tab_specific_content_settings.h" | 7 #include "chrome/browser/content_settings/tab_specific_content_settings.h" |
8 #include "chrome/browser/instant/instant_controller.h" | 8 #include "chrome/browser/instant/instant_controller.h" |
9 #include "chrome/browser/profiles/profile.h" | 9 #include "chrome/browser/profiles/profile.h" |
10 #include "chrome/browser/thumbnails/thumbnail_tab_helper.h" | 10 #include "chrome/browser/thumbnails/thumbnail_tab_helper.h" |
(...skipping 334 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
345 } | 345 } |
346 | 346 |
347 void InstantLoader::SendAutocompleteResults( | 347 void InstantLoader::SendAutocompleteResults( |
348 const std::vector<InstantAutocompleteResult>& results) { | 348 const std::vector<InstantAutocompleteResult>& results) { |
349 content::RenderViewHost* rvh = | 349 content::RenderViewHost* rvh = |
350 preview_contents_->web_contents()->GetRenderViewHost(); | 350 preview_contents_->web_contents()->GetRenderViewHost(); |
351 rvh->Send(new ChromeViewMsg_SearchBoxAutocompleteResults(rvh->GetRoutingID(), | 351 rvh->Send(new ChromeViewMsg_SearchBoxAutocompleteResults(rvh->GetRoutingID(), |
352 results)); | 352 results)); |
353 } | 353 } |
354 | 354 |
| 355 void InstantLoader::SendThemeBackgroundInfo( |
| 356 const ThemeBackgroundInfo& theme_info) { |
| 357 content::RenderViewHost* rvh = |
| 358 preview_contents_->web_contents()->GetRenderViewHost(); |
| 359 rvh->Send(new ChromeViewMsg_SearchBoxThemeChanged(rvh->GetRoutingID(), |
| 360 theme_info)); |
| 361 } |
| 362 |
| 363 void InstantLoader::SendThemeAreaHeight(int height) { |
| 364 content::RenderViewHost* rvh = |
| 365 preview_contents_->web_contents()->GetRenderViewHost(); |
| 366 rvh->Send(new ChromeViewMsg_SearchBoxThemeAreaHeightChanged( |
| 367 rvh->GetRoutingID(), height)); |
| 368 } |
| 369 |
355 void InstantLoader::OnUpOrDownKeyPressed(int count) { | 370 void InstantLoader::OnUpOrDownKeyPressed(int count) { |
356 content::RenderViewHost* rvh = | 371 content::RenderViewHost* rvh = |
357 preview_contents_->web_contents()->GetRenderViewHost(); | 372 preview_contents_->web_contents()->GetRenderViewHost(); |
358 rvh->Send(new ChromeViewMsg_SearchBoxUpOrDownKeyPressed(rvh->GetRoutingID(), | 373 rvh->Send(new ChromeViewMsg_SearchBoxUpOrDownKeyPressed(rvh->GetRoutingID(), |
359 count)); | 374 count)); |
360 } | 375 } |
361 | 376 |
362 void InstantLoader::OnAutocompleteGotFocus() { | 377 void InstantLoader::OnAutocompleteGotFocus() { |
363 content::RenderViewHost* rvh = | 378 content::RenderViewHost* rvh = |
364 preview_contents_->web_contents()->GetRenderViewHost(); | 379 preview_contents_->web_contents()->GetRenderViewHost(); |
(...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
482 content::WebContents* new_contents) { | 497 content::WebContents* new_contents) { |
483 DCHECK_EQ(old_contents, preview_contents_->web_contents()); | 498 DCHECK_EQ(old_contents, preview_contents_->web_contents()); |
484 CleanupPreviewContents(); | 499 CleanupPreviewContents(); |
485 // We release here without deleting so that the caller still has the | 500 // We release here without deleting so that the caller still has the |
486 // responsibility for deleting the TabContents. | 501 // responsibility for deleting the TabContents. |
487 ignore_result(preview_contents_.release()); | 502 ignore_result(preview_contents_.release()); |
488 preview_contents_.reset(TabContents::FromWebContents(new_contents)); | 503 preview_contents_.reset(TabContents::FromWebContents(new_contents)); |
489 SetupPreviewContents(); | 504 SetupPreviewContents(); |
490 controller_->SwappedTabContents(this); | 505 controller_->SwappedTabContents(this); |
491 } | 506 } |
OLD | NEW |