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