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::OnStartedCapturingKeyStrokes() { |
| 398 content::RenderViewHost* rvh = |
| 399 preview_contents_->web_contents()->GetRenderViewHost(); |
| 400 rvh->Send(new ChromeViewMsg_SearchBoxStartedCapturingKeyStrokes( |
| 401 rvh->GetRoutingID())); |
| 402 } |
| 403 |
| 404 void InstantLoader::OnStoppedCapturingKeyStrokes() { |
| 405 content::RenderViewHost* rvh = |
| 406 preview_contents_->web_contents()->GetRenderViewHost(); |
| 407 rvh->Send(new ChromeViewMsg_SearchBoxStoppedCapturingKeyStrokes( |
| 408 rvh->GetRoutingID())); |
| 409 } |
| 410 |
397 void InstantLoader::SearchModeChanged(const chrome::search::Mode& mode) { | 411 void InstantLoader::SearchModeChanged(const chrome::search::Mode& mode) { |
398 content::RenderViewHost* rvh = | 412 content::RenderViewHost* rvh = |
399 preview_contents_->web_contents()->GetRenderViewHost(); | 413 preview_contents_->web_contents()->GetRenderViewHost(); |
400 rvh->Send(new ChromeViewMsg_SearchBoxModeChanged(rvh->GetRoutingID(), mode)); | 414 rvh->Send(new ChromeViewMsg_SearchBoxModeChanged(rvh->GetRoutingID(), mode)); |
401 } | 415 } |
402 | 416 |
403 void InstantLoader::DidNavigate( | 417 void InstantLoader::DidNavigate( |
404 const history::HistoryAddPageArgs& add_page_args) { | 418 const history::HistoryAddPageArgs& add_page_args) { |
405 last_navigation_ = add_page_args; | 419 last_navigation_ = add_page_args; |
406 } | 420 } |
(...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
498 content::WebContents* new_contents) { | 512 content::WebContents* new_contents) { |
499 DCHECK_EQ(old_contents, preview_contents_->web_contents()); | 513 DCHECK_EQ(old_contents, preview_contents_->web_contents()); |
500 CleanupPreviewContents(); | 514 CleanupPreviewContents(); |
501 // We release here without deleting so that the caller still has the | 515 // We release here without deleting so that the caller still has the |
502 // responsibility for deleting the TabContents. | 516 // responsibility for deleting the TabContents. |
503 ignore_result(preview_contents_.release()); | 517 ignore_result(preview_contents_.release()); |
504 preview_contents_.reset(TabContents::FromWebContents(new_contents)); | 518 preview_contents_.reset(TabContents::FromWebContents(new_contents)); |
505 SetupPreviewContents(); | 519 SetupPreviewContents(); |
506 controller_->SwappedTabContents(this); | 520 controller_->SwappedTabContents(this); |
507 } | 521 } |
OLD | NEW |