summaryrefslogtreecommitdiffstats
path: root/chrome/browser/instant/instant_controller.cc
diff options
context:
space:
mode:
authorben@chromium.org <ben@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-11-18 16:17:49 +0000
committerben@chromium.org <ben@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-11-18 16:17:49 +0000
commit3c9e187bd8ec34ebf2a91a37c868584c465647e8 (patch)
tree84c9540d220fa155cf2af8c944638c0719dee670 /chrome/browser/instant/instant_controller.cc
parent3e35b224fd0c36f17f432f23e2eb3729667210b1 (diff)
downloadchromium_src-3c9e187bd8ec34ebf2a91a37c868584c465647e8.zip
chromium_src-3c9e187bd8ec34ebf2a91a37c868584c465647e8.tar.gz
chromium_src-3c9e187bd8ec34ebf2a91a37c868584c465647e8.tar.bz2
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
Diffstat (limited to 'chrome/browser/instant/instant_controller.cc')
-rw-r--r--chrome/browser/instant/instant_controller.cc20
1 files changed, 11 insertions, 9 deletions
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<InstantLoader> 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;
}