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 216ec6a22897a673dd689cbf59b56b96959d2ada..ccb0902c64f66d29c4fe9c9c477ed52d02c6bb5b 100644 |
--- a/chrome/browser/ui/browser_instant_controller.h |
+++ b/chrome/browser/ui/browser_instant_controller.h |
@@ -16,6 +16,8 @@ |
#include "chrome/browser/ui/tabs/tab_strip_model_observer.h" |
#include "chrome/common/instant_types.h" |
#include "webkit/glue/window_open_disposition.h" |
+#include "content/public/browser/notification_observer.h" |
+#include "content/public/browser/notification_registrar.h" |
class Browser; |
class InstantController; |
@@ -26,11 +28,16 @@ namespace gfx { |
class Rect; |
} |
+namespace ui { |
+class ThemeProvider; |
+}; |
+ |
namespace chrome { |
class BrowserInstantController : public TabStripModelObserver, |
public search::SearchModelObserver, |
- public PrefObserver { |
+ public PrefObserver, |
+ public content::NotificationObserver { |
public: |
explicit BrowserInstantController(Browser* browser); |
virtual ~BrowserInstantController(); |
@@ -62,6 +69,14 @@ class BrowserInstantController : public TabStripModelObserver, |
// preview would be shown. |
TabContents* GetActiveTabContents() const; |
+ // 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-related information in preview. |
+ void UpdateThemeRelatedInfoForPreview(); |
+ |
// Overridden from PrefObserver: |
virtual void OnPreferenceChanged(PrefServiceBase* service, |
const std::string& pref_name) OVERRIDE; |
@@ -76,17 +91,36 @@ class BrowserInstantController : public TabStripModelObserver, |
virtual void ModeChanged(const search::Mode& old_mode, |
const search::Mode& new_mode) OVERRIDE; |
+ private: |
+ // content::NotificationObserver implementation. |
+ virtual void Observe(int type, |
+ const content::NotificationSource& source, |
+ const content::NotificationDetails& details) OVERRIDE; |
+ |
// If this browser should have Instant, a new InstantController created; |
// otherwise any existing InstantController is destroyed. |
void ResetInstant(); |
+ // Helper for handling theme change. |
+ void OnThemeChanged(ui::ThemeProvider* theme_provider); |
+ |
+ // Helper for handling theme area height change. |
+ void OnThemeAreaHeightChanged(int height); |
+ |
Browser* browser_; |
scoped_ptr<InstantController> instant_; |
InstantUnloadHandler instant_unload_handler_; |
+ // Theme-related data for NTP preview to adopt themes. |
+ ThemeBackgroundInfo theme_info_; |
+ int theme_image_alignment_; |
+ int theme_area_height_; |
+ |
PrefChangeRegistrar profile_pref_registrar_; |
+ content::NotificationRegistrar registrar_; |
+ |
DISALLOW_COPY_AND_ASSIGN(BrowserInstantController); |
}; |