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

Unified Diff: chrome/browser/instant/instant_controller.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: fixed to only send ht change when there's theme image 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/instant/instant_controller.cc
diff --git a/chrome/browser/instant/instant_controller.cc b/chrome/browser/instant/instant_controller.cc
index f70b38a0e4e43ee36f9010e9b2aec0833664c2d2..8e1e2f80650d594efb14c9d7b4f712a5082ad067 100644
--- a/chrome/browser/instant/instant_controller.cc
+++ b/chrome/browser/instant/instant_controller.cc
@@ -528,6 +528,16 @@ void InstantController::OnActiveTabModeChanged(bool active_tab_is_ntp) {
}
}
+void InstantController::OnThemeChanged(const ThemeBackgroundInfo& theme_info) {
+ if (loader_.get())
+ loader_->SendThemeBackgroundInfo(theme_info);
+}
+
+void InstantController::OnThemeAreaHeightChanged(int height) {
+ if (loader_.get())
+ loader_->SendThemeAreaHeight(height);
+}
+
bool InstantController::commit_on_pointer_release() const {
return GetPreviewContents() && loader_->IsPointerDownFromActivate();
}
@@ -660,12 +670,14 @@ void InstantController::ResetLoader(const std::string& instant_url,
loader_.reset(new InstantLoader(this, instant_url, active_tab));
loader_->Init();
- // Ensure the searchbox API has the correct focus state and context.
+ // Ensure the searchbox API has the correct focus state, context and theme-
+ // related info.
if (is_omnibox_focused_)
loader_->OnAutocompleteGotFocus();
else
loader_->OnAutocompleteLostFocus();
loader_->OnActiveTabModeChanged(active_tab_is_ntp_);
+ browser_->UpdateThemeRelatedInfoForPreview();
// Reset the loader timer.
stale_loader_timer_.Stop();

Powered by Google App Engine
This is Rietveld 408576698