| OLD | NEW |
| 1 // Copyright 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 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 376 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 387 rvh->GetRoutingID(), height)); | 387 rvh->GetRoutingID(), height)); |
| 388 } | 388 } |
| 389 | 389 |
| 390 void InstantLoader::OnUpOrDownKeyPressed(int count) { | 390 void InstantLoader::OnUpOrDownKeyPressed(int count) { |
| 391 content::RenderViewHost* rvh = | 391 content::RenderViewHost* rvh = |
| 392 preview_contents_->web_contents()->GetRenderViewHost(); | 392 preview_contents_->web_contents()->GetRenderViewHost(); |
| 393 rvh->Send(new ChromeViewMsg_SearchBoxUpOrDownKeyPressed(rvh->GetRoutingID(), | 393 rvh->Send(new ChromeViewMsg_SearchBoxUpOrDownKeyPressed(rvh->GetRoutingID(), |
| 394 count)); | 394 count)); |
| 395 } | 395 } |
| 396 | 396 |
| 397 void InstantLoader::OnKeyCaptureChange(bool is_key_capture_enabled) { |
| 398 content::RenderViewHost* rvh = |
| 399 preview_contents_->web_contents()->GetRenderViewHost(); |
| 400 rvh->Send(new ChromeViewMsg_SearchBoxKeyCaptureChanged( |
| 401 rvh->GetRoutingID(), is_key_capture_enabled)); |
| 402 } |
| 403 |
| 397 void InstantLoader::SearchModeChanged(const chrome::search::Mode& mode) { | 404 void InstantLoader::SearchModeChanged(const chrome::search::Mode& mode) { |
| 398 content::RenderViewHost* rvh = | 405 content::RenderViewHost* rvh = |
| 399 preview_contents_->web_contents()->GetRenderViewHost(); | 406 preview_contents_->web_contents()->GetRenderViewHost(); |
| 400 rvh->Send(new ChromeViewMsg_SearchBoxModeChanged(rvh->GetRoutingID(), mode)); | 407 rvh->Send(new ChromeViewMsg_SearchBoxModeChanged(rvh->GetRoutingID(), mode)); |
| 401 } | 408 } |
| 402 | 409 |
| 403 void InstantLoader::DidNavigate( | 410 void InstantLoader::DidNavigate( |
| 404 const history::HistoryAddPageArgs& add_page_args) { | 411 const history::HistoryAddPageArgs& add_page_args) { |
| 405 last_navigation_ = add_page_args; | 412 last_navigation_ = add_page_args; |
| 406 } | 413 } |
| (...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 498 content::WebContents* new_contents) { | 505 content::WebContents* new_contents) { |
| 499 DCHECK_EQ(old_contents, preview_contents_->web_contents()); | 506 DCHECK_EQ(old_contents, preview_contents_->web_contents()); |
| 500 CleanupPreviewContents(); | 507 CleanupPreviewContents(); |
| 501 // We release here without deleting so that the caller still has the | 508 // We release here without deleting so that the caller still has the |
| 502 // responsibility for deleting the TabContents. | 509 // responsibility for deleting the TabContents. |
| 503 ignore_result(preview_contents_.release()); | 510 ignore_result(preview_contents_.release()); |
| 504 preview_contents_.reset(TabContents::FromWebContents(new_contents)); | 511 preview_contents_.reset(TabContents::FromWebContents(new_contents)); |
| 505 SetupPreviewContents(); | 512 SetupPreviewContents(); |
| 506 controller_->SwappedTabContents(this); | 513 controller_->SwappedTabContents(this); |
| 507 } | 514 } |
| OLD | NEW |