From 3c9e187bd8ec34ebf2a91a37c868584c465647e8 Mon Sep 17 00:00:00 2001 From: "ben@chromium.org" Date: Thu, 18 Nov 2010 16:17:49 +0000 Subject: Make pink's TabContentsWrapper change compile on Windows. Code by pinkerton@, with modifications by evanm and myself to get it to build on windows/linux/chromeos. BUG=none TEST=none Review URL: http://codereview.chromium.org/4694008 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@66626 0039d316-1c4b-4281-b951-d872f2087c98 --- chrome/browser/instant/instant_controller.cc | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) (limited to 'chrome/browser/instant/instant_controller.cc') diff --git a/chrome/browser/instant/instant_controller.cc b/chrome/browser/instant/instant_controller.cc index 54c12dd..c6587fa 100644 --- a/chrome/browser/instant/instant_controller.cc +++ b/chrome/browser/instant/instant_controller.cc @@ -19,6 +19,7 @@ #include "chrome/browser/search_engines/template_url.h" #include "chrome/browser/search_engines/template_url_model.h" #include "chrome/browser/tab_contents/tab_contents.h" +#include "chrome/browser/tab_contents_wrapper.h" #include "chrome/common/chrome_switches.h" #include "chrome/common/notification_service.h" #include "chrome/common/pref_names.h" @@ -155,8 +156,7 @@ void InstantController::Disable(Profile* profile) { UMA_HISTOGRAM_CUSTOM_COUNTS(name, delta.InMinutes(), 1, 60 * 24 * 10, 50); } - -void InstantController::Update(TabContents* tab_contents, +void InstantController::Update(TabContentsWrapper* tab_contents, const AutocompleteMatch& match, const string16& user_text, string16* suggested_text) { @@ -230,9 +230,9 @@ bool InstantController::IsCurrent() { void InstantController::CommitCurrentPreview(InstantCommitType type) { DCHECK(loader_manager_.get()); DCHECK(loader_manager_->current_loader()); - TabContents* tab = ReleasePreviewContents(type); + TabContentsWrapper* tab = ReleasePreviewContents(type); delegate_->CommitInstant(tab); - CompleteRelease(tab); + CompleteRelease(tab->tab_contents()); } void InstantController::SetCommitOnMouseUp() { @@ -251,13 +251,14 @@ void InstantController::OnAutocompleteLostFocus( return; RenderWidgetHostView* rwhv = - GetPreviewContents()->GetRenderWidgetHostView(); + GetPreviewContents()->tab_contents()->GetRenderWidgetHostView(); if (!view_gaining_focus || !rwhv) { DestroyPreviewContents(); return; } - gfx::NativeView tab_view = GetPreviewContents()->GetNativeView(); + gfx::NativeView tab_view = + GetPreviewContents()->tab_contents()->GetNativeView(); // Focus is going to the renderer. if (rwhv->GetNativeView() == view_gaining_focus || tab_view == view_gaining_focus) { @@ -299,12 +300,13 @@ void InstantController::OnAutocompleteLostFocus( DestroyPreviewContents(); } -TabContents* InstantController::ReleasePreviewContents(InstantCommitType type) { +TabContentsWrapper* InstantController::ReleasePreviewContents( + InstantCommitType type) { if (!loader_manager_.get()) return NULL; scoped_ptr loader(loader_manager_->ReleaseCurrentLoader()); - TabContents* tab = loader->ReleasePreviewContents(type); + TabContentsWrapper* tab = loader->ReleasePreviewContents(type); ClearBlacklist(); is_active_ = false; @@ -319,7 +321,7 @@ void InstantController::CompleteRelease(TabContents* tab) { tab->SetAllContentsBlocked(false); } -TabContents* InstantController::GetPreviewContents() { +TabContentsWrapper* InstantController::GetPreviewContents() { return loader_manager_.get() ? loader_manager_->current_loader()->preview_contents() : NULL; } -- cgit v1.1