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

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: addressed scott's comments 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 (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 334 matching lines...) Expand 10 before | Expand all | Expand 10 after
345 } 345 }
346 346
347 void InstantLoader::SendAutocompleteResults( 347 void InstantLoader::SendAutocompleteResults(
348 const std::vector<InstantAutocompleteResult>& results) { 348 const std::vector<InstantAutocompleteResult>& results) {
349 content::RenderViewHost* rvh = 349 content::RenderViewHost* rvh =
350 preview_contents_->web_contents()->GetRenderViewHost(); 350 preview_contents_->web_contents()->GetRenderViewHost();
351 rvh->Send(new ChromeViewMsg_SearchBoxAutocompleteResults(rvh->GetRoutingID(), 351 rvh->Send(new ChromeViewMsg_SearchBoxAutocompleteResults(rvh->GetRoutingID(),
352 results)); 352 results));
353 } 353 }
354 354
355 void InstantLoader::SendThemeBackgroundInfo(
356 const ThemeBackgroundInfo& theme_info) {
357 content::RenderViewHost* rvh =
358 preview_contents_->web_contents()->GetRenderViewHost();
359 rvh->Send(new ChromeViewMsg_SearchBoxThemeChanged(rvh->GetRoutingID(),
360 theme_info));
361 }
362
363 void InstantLoader::SendThemeAreaHeight(int height) {
364 content::RenderViewHost* rvh =
365 preview_contents_->web_contents()->GetRenderViewHost();
366 rvh->Send(new ChromeViewMsg_SearchBoxThemeAreaHeightChanged(
367 rvh->GetRoutingID(), height));
368 }
369
355 void InstantLoader::OnUpOrDownKeyPressed(int count) { 370 void InstantLoader::OnUpOrDownKeyPressed(int count) {
356 content::RenderViewHost* rvh = 371 content::RenderViewHost* rvh =
357 preview_contents_->web_contents()->GetRenderViewHost(); 372 preview_contents_->web_contents()->GetRenderViewHost();
358 rvh->Send(new ChromeViewMsg_SearchBoxUpOrDownKeyPressed(rvh->GetRoutingID(), 373 rvh->Send(new ChromeViewMsg_SearchBoxUpOrDownKeyPressed(rvh->GetRoutingID(),
359 count)); 374 count));
360 } 375 }
361 376
362 void InstantLoader::OnActiveTabModeChanged(bool active_tab_is_ntp) { 377 void InstantLoader::OnActiveTabModeChanged(bool active_tab_is_ntp) {
363 content::RenderViewHost* rvh = 378 content::RenderViewHost* rvh =
364 preview_contents_->web_contents()->GetRenderViewHost(); 379 preview_contents_->web_contents()->GetRenderViewHost();
(...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after
470 content::WebContents* new_contents) { 485 content::WebContents* new_contents) {
471 DCHECK_EQ(old_contents, preview_contents_->web_contents()); 486 DCHECK_EQ(old_contents, preview_contents_->web_contents());
472 CleanupPreviewContents(); 487 CleanupPreviewContents();
473 // We release here without deleting so that the caller still has the 488 // We release here without deleting so that the caller still has the
474 // responsibility for deleting the TabContents. 489 // responsibility for deleting the TabContents.
475 ignore_result(preview_contents_.release()); 490 ignore_result(preview_contents_.release());
476 preview_contents_.reset(TabContents::FromWebContents(new_contents)); 491 preview_contents_.reset(TabContents::FromWebContents(new_contents));
477 SetupPreviewContents(); 492 SetupPreviewContents();
478 controller_->SwappedTabContents(this); 493 controller_->SwappedTabContents(this);
479 } 494 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698