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 324 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
335 } | 335 } |
336 | 336 |
337 void InstantLoader::SendAutocompleteResults( | 337 void InstantLoader::SendAutocompleteResults( |
338 const std::vector<InstantAutocompleteResult>& results) { | 338 const std::vector<InstantAutocompleteResult>& results) { |
339 content::RenderViewHost* rvh = | 339 content::RenderViewHost* rvh = |
340 preview_contents_->web_contents()->GetRenderViewHost(); | 340 preview_contents_->web_contents()->GetRenderViewHost(); |
341 rvh->Send(new ChromeViewMsg_SearchBoxAutocompleteResults(rvh->GetRoutingID(), | 341 rvh->Send(new ChromeViewMsg_SearchBoxAutocompleteResults(rvh->GetRoutingID(), |
342 results)); | 342 results)); |
343 } | 343 } |
344 | 344 |
| 345 void InstantLoader::SendThemeBackgroundInfo( |
| 346 const ThemeBackgroundInfo& theme_info) { |
| 347 content::RenderViewHost* rvh = |
| 348 preview_contents_->web_contents()->GetRenderViewHost(); |
| 349 rvh->Send(new ChromeViewMsg_SearchBoxThemeChanged(rvh->GetRoutingID(), |
| 350 theme_info)); |
| 351 } |
| 352 |
| 353 void InstantLoader::SendThemeAreaHeight(int height) { |
| 354 content::RenderViewHost* rvh = |
| 355 preview_contents_->web_contents()->GetRenderViewHost(); |
| 356 rvh->Send(new ChromeViewMsg_SearchBoxThemeAreaHeightChanged( |
| 357 rvh->GetRoutingID(), height)); |
| 358 } |
| 359 |
345 void InstantLoader::OnUpOrDownKeyPressed(int count) { | 360 void InstantLoader::OnUpOrDownKeyPressed(int count) { |
346 content::RenderViewHost* rvh = | 361 content::RenderViewHost* rvh = |
347 preview_contents_->web_contents()->GetRenderViewHost(); | 362 preview_contents_->web_contents()->GetRenderViewHost(); |
348 rvh->Send(new ChromeViewMsg_SearchBoxUpOrDownKeyPressed(rvh->GetRoutingID(), | 363 rvh->Send(new ChromeViewMsg_SearchBoxUpOrDownKeyPressed(rvh->GetRoutingID(), |
349 count)); | 364 count)); |
350 } | 365 } |
351 | 366 |
352 void InstantLoader::OnAutocompleteGotFocus() { | 367 void InstantLoader::OnAutocompleteGotFocus() { |
353 content::RenderViewHost* rvh = | 368 content::RenderViewHost* rvh = |
354 preview_contents_->web_contents()->GetRenderViewHost(); | 369 preview_contents_->web_contents()->GetRenderViewHost(); |
(...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
468 content::WebContents* new_contents) { | 483 content::WebContents* new_contents) { |
469 DCHECK_EQ(old_contents, preview_contents_->web_contents()); | 484 DCHECK_EQ(old_contents, preview_contents_->web_contents()); |
470 CleanupPreviewContents(); | 485 CleanupPreviewContents(); |
471 // We release here without deleting so that the caller still has the | 486 // We release here without deleting so that the caller still has the |
472 // responsibility for deleting the TabContents. | 487 // responsibility for deleting the TabContents. |
473 ignore_result(preview_contents_.release()); | 488 ignore_result(preview_contents_.release()); |
474 preview_contents_.reset(TabContents::FromWebContents(new_contents)); | 489 preview_contents_.reset(TabContents::FromWebContents(new_contents)); |
475 SetupPreviewContents(); | 490 SetupPreviewContents(); |
476 controller_->SwappedTabContents(this); | 491 controller_->SwappedTabContents(this); |
477 } | 492 } |
OLD | NEW |