| 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 310 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 321 | 321 |
| 322 void InstantLoader::Update(const string16& user_text, bool verbatim) { | 322 void InstantLoader::Update(const string16& user_text, bool verbatim) { |
| 323 // TODO: Support real cursor position. | 323 // TODO: Support real cursor position. |
| 324 last_navigation_ = history::HistoryAddPageArgs(); | 324 last_navigation_ = history::HistoryAddPageArgs(); |
| 325 content::RenderViewHost* rvh = | 325 content::RenderViewHost* rvh = |
| 326 preview_contents_->web_contents()->GetRenderViewHost(); | 326 preview_contents_->web_contents()->GetRenderViewHost(); |
| 327 rvh->Send(new ChromeViewMsg_SearchBoxChange(rvh->GetRoutingID(), user_text, | 327 rvh->Send(new ChromeViewMsg_SearchBoxChange(rvh->GetRoutingID(), user_text, |
| 328 verbatim, user_text.size(), user_text.size())); | 328 verbatim, user_text.size(), user_text.size())); |
| 329 } | 329 } |
| 330 | 330 |
| 331 void InstantLoader::SetPopupBounds(const gfx::Rect& bounds) { |
| 332 content::RenderViewHost* rvh = |
| 333 preview_contents_->web_contents()->GetRenderViewHost(); |
| 334 rvh->Send(new ChromeViewMsg_SearchBoxPopupResize(rvh->GetRoutingID(), |
| 335 bounds)); |
| 336 } |
| 337 |
| 331 void InstantLoader::SetOmniboxBounds(const gfx::Rect& bounds) { | 338 void InstantLoader::SetOmniboxBounds(const gfx::Rect& bounds) { |
| 332 content::RenderViewHost* rvh = | 339 content::RenderViewHost* rvh = |
| 333 preview_contents_->web_contents()->GetRenderViewHost(); | 340 preview_contents_->web_contents()->GetRenderViewHost(); |
| 334 rvh->Send(new ChromeViewMsg_SearchBoxResize(rvh->GetRoutingID(), bounds)); | 341 rvh->Send(new ChromeViewMsg_SearchBoxOmniboxResize(rvh->GetRoutingID(), |
| 342 bounds)); |
| 335 } | 343 } |
| 336 | 344 |
| 337 void InstantLoader::SendAutocompleteResults( | 345 void InstantLoader::SendAutocompleteResults( |
| 338 const std::vector<InstantAutocompleteResult>& results) { | 346 const std::vector<InstantAutocompleteResult>& results) { |
| 339 content::RenderViewHost* rvh = | 347 content::RenderViewHost* rvh = |
| 340 preview_contents_->web_contents()->GetRenderViewHost(); | 348 preview_contents_->web_contents()->GetRenderViewHost(); |
| 341 rvh->Send(new ChromeViewMsg_SearchBoxAutocompleteResults(rvh->GetRoutingID(), | 349 rvh->Send(new ChromeViewMsg_SearchBoxAutocompleteResults(rvh->GetRoutingID(), |
| 342 results)); | 350 results)); |
| 343 } | 351 } |
| 344 | 352 |
| (...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 468 content::WebContents* new_contents) { | 476 content::WebContents* new_contents) { |
| 469 DCHECK_EQ(old_contents, preview_contents_->web_contents()); | 477 DCHECK_EQ(old_contents, preview_contents_->web_contents()); |
| 470 CleanupPreviewContents(); | 478 CleanupPreviewContents(); |
| 471 // We release here without deleting so that the caller still has the | 479 // We release here without deleting so that the caller still has the |
| 472 // responsibility for deleting the TabContents. | 480 // responsibility for deleting the TabContents. |
| 473 ignore_result(preview_contents_.release()); | 481 ignore_result(preview_contents_.release()); |
| 474 preview_contents_.reset(TabContents::FromWebContents(new_contents)); | 482 preview_contents_.reset(TabContents::FromWebContents(new_contents)); |
| 475 SetupPreviewContents(); | 483 SetupPreviewContents(); |
| 476 controller_->SwappedTabContents(this); | 484 controller_->SwappedTabContents(this); |
| 477 } | 485 } |
| OLD | NEW |