Upstream version 7.36.149.0
[platform/framework/web/crosswalk.git] / src / chrome / browser / ui / libgtk2ui / gtk2_ui.h
index 5dbbda9..3297025 100644 (file)
@@ -36,7 +36,7 @@ namespace libgtk2ui {
 class Gtk2Border;
 class Gtk2KeyBindingsHandler;
 class Gtk2SignalRegistrar;
-class GConfTitlebarListener;
+class GConfListener;
 
 // Interface to GTK2 desktop features.
 //
@@ -45,9 +45,14 @@ class Gtk2UI : public views::LinuxUI {
   Gtk2UI();
   virtual ~Gtk2UI();
 
+  typedef base::Callback<ui::NativeTheme*(aura::Window* window)>
+      NativeThemeGetter;
+
+  // Setters used by GConfListener:
   void SetWindowButtonOrdering(
     const std::vector<views::FrameButton>& leading_buttons,
     const std::vector<views::FrameButton>& trailing_buttons);
+  void SetNonClientMiddleClickAction(NonClientMiddleClickAction action);
 
   // Draws the GTK button border for state |gtk_state| onto a bitmap.
   SkBitmap DrawGtkButtonBorder(int gtk_state,
@@ -88,7 +93,9 @@ class Gtk2UI : public views::LinuxUI {
   virtual SkColor GetInactiveSelectionBgColor() const OVERRIDE;
   virtual SkColor GetInactiveSelectionFgColor() const OVERRIDE;
   virtual double GetCursorBlinkInterval() const OVERRIDE;
-  virtual ui::NativeTheme* GetNativeTheme() const OVERRIDE;
+  virtual ui::NativeTheme* GetNativeTheme(aura::Window* window) const OVERRIDE;
+  virtual void SetNativeThemeOverride(const NativeThemeGetter& callback)
+      OVERRIDE;
   virtual bool GetDefaultUsesSystemTheme() const OVERRIDE;
   virtual void SetDownloadCount(int count) const OVERRIDE;
   virtual void SetProgressFraction(float percentage) const OVERRIDE;
@@ -105,11 +112,8 @@ class Gtk2UI : public views::LinuxUI {
       views::WindowButtonOrderObserver* observer) OVERRIDE;
   virtual void RemoveWindowButtonOrderObserver(
       views::WindowButtonOrderObserver* observer) OVERRIDE;
-  virtual void AddNativeThemeChangeObserver(
-      views::NativeThemeChangeObserver* observer) OVERRIDE;
-  virtual void RemoveNativeThemeChangeObserver(
-      views::NativeThemeChangeObserver* observer) OVERRIDE;
   virtual bool UnityIsRunning() OVERRIDE;
+  virtual NonClientMiddleClickAction GetNonClientMiddleClickAction() OVERRIDE;
   virtual void NotifyWindowManagerStartupComplete() OVERRIDE;
 
   // ui::TextEditKeybindingDelegate:
@@ -129,10 +133,6 @@ class Gtk2UI : public views::LinuxUI {
                           GdkColor* thumb_inactive_color,
                           GdkColor* track_color);
 
-  // Gets the name of the current icon theme and passes it to our low level XDG
-  // integration.
-  void SetXDGIconTheme();
-
   // Extracts colors and tints from the GTK theme, both for the
   // ThemeService interface and the colors we send to webkit.
   void LoadGtkValues();
@@ -234,7 +234,7 @@ class Gtk2UI : public views::LinuxUI {
 #if defined(USE_GCONF)
   // Currently, the only source of window button configuration. This will
   // change if we ever have to support XFCE's configuration system or KDE's.
-  scoped_ptr<GConfTitlebarListener> titlebar_listener_;
+  scoped_ptr<GConfListener> gconf_listener_;
 #endif  // defined(USE_GCONF)
 
   // If either of these vectors are non-empty, they represent the current
@@ -247,14 +247,17 @@ class Gtk2UI : public views::LinuxUI {
   // Objects to notify when the window frame button order changes.
   ObserverList<views::WindowButtonOrderObserver> observer_list_;
 
-  // Observers to notify when the theme state changes.
-  ObserverList<views::NativeThemeChangeObserver> theme_change_observers_;
+  // Whether we should lower the window on a middle click to the non client
+  // area.
+  NonClientMiddleClickAction middle_click_action_;
 
   // Image cache of lazily created images.
   mutable ImageCache gtk_images_;
 
-  // Whether to use the Gtk2 version of the native theme.
-  bool use_gtk_;
+  // Used to override the native theme for a window. If no override is provided
+  // or the callback returns NULL, Gtk2UI will default to a NativeThemeGtk2
+  // instance.
+  NativeThemeGetter native_theme_overrider_;
 
   DISALLOW_COPY_AND_ASSIGN(Gtk2UI);
 };