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

Unified Diff: chrome/browser/instant/instant_tab.cc

Issue 11824050: InstantExtended: Committed NTP (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Undo to fix blacklisting. Created 7 years, 10 months 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/instant/instant_tab.h ('k') | chrome/browser/instant/instant_test_utils.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/instant/instant_tab.cc
diff --git a/chrome/browser/instant/instant_tab.cc b/chrome/browser/instant/instant_tab.cc
index 733c6f0a0f000188b544d0d7f7aad4854c94ad64..0a4b51a7758dc841970997f9e99efa889d1360f1 100644
--- a/chrome/browser/instant/instant_tab.cc
+++ b/chrome/browser/instant/instant_tab.cc
@@ -4,102 +4,30 @@
#include "chrome/browser/instant/instant_tab.h"
-#include "chrome/browser/instant/instant_controller.h"
-
-InstantTab::InstantTab(InstantController* controller,
- content::WebContents* contents)
- : client_(ALLOW_THIS_IN_INITIALIZER_LIST(this)),
- controller_(controller),
- contents_(contents),
- supports_instant_(false) {
+InstantTab::InstantTab(InstantPage::Delegate* delegate)
+ : InstantPage(delegate) {
}
InstantTab::~InstantTab() {
}
-void InstantTab::Init() {
- client_.SetContents(contents_);
- client_.DetermineIfPageSupportsInstant();
-}
-
-void InstantTab::Update(const string16& text,
- size_t selection_start,
- size_t selection_end,
- bool verbatim) {
- client_.Update(text, selection_start, selection_end, verbatim);
-}
-
-void InstantTab::Submit(const string16& text) {
- client_.Submit(text);
-}
-
-void InstantTab::SendAutocompleteResults(
- const std::vector<InstantAutocompleteResult>& results) {
- client_.SendAutocompleteResults(results);
-}
-
-void InstantTab::SetDisplayInstantResults(bool display_instant_results) {
- client_.SetDisplayInstantResults(display_instant_results);
-}
-
-void InstantTab::UpOrDownKeyPressed(int count) {
- client_.UpOrDownKeyPressed(count);
-}
-
-void InstantTab::SetMarginSize(int start, int end) {
- client_.SetMarginSize(start, end);
-}
-
-void InstantTab::InitializeFonts() {
- client_.InitializeFonts();
-}
-
-void InstantTab::SetSuggestions(
- const std::vector<InstantSuggestion>& suggestions) {
- InstantSupportDetermined(true);
- controller_->SetSuggestions(contents_, suggestions);
-}
-
-void InstantTab::InstantSupportDetermined(bool supports_instant) {
- // If we had already determined that the page supports Instant, nothing to do.
- if (supports_instant_)
- return;
-
- supports_instant_ = supports_instant;
-
- // If the page doesn't support Instant, stop communicating with it.
- if (!supports_instant)
- client_.SetContents(NULL);
-
- controller_->InstantSupportDetermined(contents_, supports_instant);
-}
-
-void InstantTab::ShowInstantPreview(InstantShownReason /* reason */,
- int /* height */,
- InstantSizeUnits /* units */) {
- // The page is a committed tab (i.e., always showing), so nothing to do.
-}
-
-void InstantTab::StartCapturingKeyStrokes() {
- // We don't honor this call from committed tabs.
-}
-
-void InstantTab::StopCapturingKeyStrokes() {
- // We don't honor this call from committed tabs.
+void InstantTab::Init(content::WebContents* contents) {
+ SetContents(contents);
+ DetermineIfPageSupportsInstant();
}
-void InstantTab::RenderViewGone() {
- // For a commit page, a crash should not be handled differently.
+bool InstantTab::ShouldProcessSetSuggestions() {
+ return true;
}
-void InstantTab::AboutToNavigateMainFrame(const GURL& url) {
- // The client is a committed tab, navigations will happen as expected.
+bool InstantTab::ShouldProcessStartCapturingKeyStrokes() {
+ return true;
}
-void InstantTab::NavigateToURL(const GURL& url,
- content::PageTransition transition) {
- controller_->NavigateToURL(url, transition);
+bool InstantTab::ShouldProcessStopCapturingKeyStrokes() {
+ return true;
}
-void InstantTab::RenderViewCreated() {
+bool InstantTab::ShouldProcessNavigateToURL() {
+ return true;
}
« no previous file with comments | « chrome/browser/instant/instant_tab.h ('k') | chrome/browser/instant/instant_test_utils.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698