Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(54)

Side by Side Diff: chrome/browser/instant/instant_loader.cc

Issue 11413018: alternate ntp: implement searchbox api for instant overlay to adopt themes (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebased to resolve conflicts Created 8 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 318 matching lines...) Expand 10 before | Expand all | Expand 10 after
329 } 329 }
330 330
331 void InstantLoader::SendAutocompleteResults( 331 void InstantLoader::SendAutocompleteResults(
332 const std::vector<InstantAutocompleteResult>& results) { 332 const std::vector<InstantAutocompleteResult>& results) {
333 content::RenderViewHost* rvh = 333 content::RenderViewHost* rvh =
334 preview_contents_->web_contents()->GetRenderViewHost(); 334 preview_contents_->web_contents()->GetRenderViewHost();
335 rvh->Send(new ChromeViewMsg_SearchBoxAutocompleteResults(rvh->GetRoutingID(), 335 rvh->Send(new ChromeViewMsg_SearchBoxAutocompleteResults(rvh->GetRoutingID(),
336 results)); 336 results));
337 } 337 }
338 338
339 void InstantLoader::SendThemeBackgroundInfo(
340 const ThemeBackgroundInfo& theme_info) {
341 content::RenderViewHost* rvh =
342 preview_contents_->web_contents()->GetRenderViewHost();
343 rvh->Send(new ChromeViewMsg_SearchBoxThemeChanged(rvh->GetRoutingID(),
344 theme_info));
345 }
346
347 void InstantLoader::SendThemeAreaHeight(int height) {
348 content::RenderViewHost* rvh =
349 preview_contents_->web_contents()->GetRenderViewHost();
350 rvh->Send(new ChromeViewMsg_SearchBoxThemeAreaHeightChanged(
351 rvh->GetRoutingID(), height));
352 }
353
339 void InstantLoader::OnUpOrDownKeyPressed(int count) { 354 void InstantLoader::OnUpOrDownKeyPressed(int count) {
340 content::RenderViewHost* rvh = 355 content::RenderViewHost* rvh =
341 preview_contents_->web_contents()->GetRenderViewHost(); 356 preview_contents_->web_contents()->GetRenderViewHost();
342 rvh->Send(new ChromeViewMsg_SearchBoxUpOrDownKeyPressed(rvh->GetRoutingID(), 357 rvh->Send(new ChromeViewMsg_SearchBoxUpOrDownKeyPressed(rvh->GetRoutingID(),
343 count)); 358 count));
344 } 359 }
345 360
346 void InstantLoader::OnActiveTabModeChanged(bool active_tab_is_ntp) { 361 void InstantLoader::OnActiveTabModeChanged(bool active_tab_is_ntp) {
347 content::RenderViewHost* rvh = 362 content::RenderViewHost* rvh =
348 preview_contents_->web_contents()->GetRenderViewHost(); 363 preview_contents_->web_contents()->GetRenderViewHost();
(...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after
448 content::WebContents* new_contents) { 463 content::WebContents* new_contents) {
449 DCHECK_EQ(old_contents, preview_contents_->web_contents()); 464 DCHECK_EQ(old_contents, preview_contents_->web_contents());
450 CleanupPreviewContents(); 465 CleanupPreviewContents();
451 // We release here without deleting so that the caller still has the 466 // We release here without deleting so that the caller still has the
452 // responsibility for deleting the TabContents. 467 // responsibility for deleting the TabContents.
453 ignore_result(preview_contents_.release()); 468 ignore_result(preview_contents_.release());
454 preview_contents_.reset(TabContents::FromWebContents(new_contents)); 469 preview_contents_.reset(TabContents::FromWebContents(new_contents));
455 SetupPreviewContents(); 470 SetupPreviewContents();
456 controller_->SwappedTabContents(this); 471 controller_->SwappedTabContents(this);
457 } 472 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698