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

Unified Diff: chrome/browser/ui/browser_instant_controller.h

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 sreeram's comments, fixed to not set theme fields if no theme 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
« no previous file with comments | « chrome/browser/instant/instant_loader.cc ('k') | chrome/browser/ui/browser_instant_controller.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/browser_instant_controller.h
diff --git a/chrome/browser/ui/browser_instant_controller.h b/chrome/browser/ui/browser_instant_controller.h
index f00d8e319838e7a257f696bfb0d6d79cca20da33..a769f07f1260aa6396a683948ef4c849099720cb 100644
--- a/chrome/browser/ui/browser_instant_controller.h
+++ b/chrome/browser/ui/browser_instant_controller.h
@@ -12,6 +12,8 @@
#include "chrome/browser/instant/instant_controller.h"
#include "chrome/browser/instant/instant_unload_handler.h"
#include "chrome/browser/ui/search/search_model_observer.h"
+#include "content/public/browser/notification_observer.h"
+#include "content/public/browser/notification_registrar.h"
#include "webkit/glue/window_open_disposition.h"
class Browser;
@@ -19,6 +21,7 @@ struct InstantSuggestion;
class PrefService;
class Profile;
class TabContents;
+class ThemeService;
namespace gfx {
class Rect;
@@ -27,6 +30,7 @@ class Rect;
namespace chrome {
class BrowserInstantController : public PrefObserver,
+ public content::NotificationObserver,
public search::SearchModelObserver {
public:
explicit BrowserInstantController(Browser* browser);
@@ -68,6 +72,14 @@ class BrowserInstantController : public PrefObserver,
// Invoked by |browser_| when the active tab changes.
void ActiveTabChanged();
+ // Invoked by |BrowserWindow| during layout to set content height which is
+ // used as theme area height, i.e. the height of the area that the entire
+ // theme background image should fill up.
+ void SetContentHeight(int height);
+
+ // Invoked by |instant_| to update theme information for preview.
+ void UpdateThemeInfoForPreview();
+
private:
// Overridden from PrefObserver:
virtual void OnPreferenceChanged(PrefServiceBase* service,
@@ -77,13 +89,31 @@ class BrowserInstantController : public PrefObserver,
virtual void ModeChanged(const search::Mode& old_mode,
const search::Mode& new_mode) OVERRIDE;
+ // content::NotificationObserver implementation.
+ virtual void Observe(int type,
+ const content::NotificationSource& source,
+ const content::NotificationDetails& details) OVERRIDE;
+
+ // Helper for handling theme change.
+ void OnThemeChanged(ThemeService* theme_service);
+
+ // Helper for handling theme area height change.
+ void OnThemeAreaHeightChanged(int height);
+
Browser* const browser_;
InstantController instant_;
InstantUnloadHandler instant_unload_handler_;
+ // Theme-related data for NTP preview to adopt themes.
+ bool initialized_theme_info_; // True if theme_info_ has been initialized.
+ ThemeBackgroundInfo theme_info_;
+ int theme_area_height_;
+
PrefChangeRegistrar profile_pref_registrar_;
+ content::NotificationRegistrar registrar_;
+
DISALLOW_COPY_AND_ASSIGN(BrowserInstantController);
};
« no previous file with comments | « chrome/browser/instant/instant_loader.cc ('k') | chrome/browser/ui/browser_instant_controller.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698