Upstream version 7.36.149.0
[platform/framework/web/crosswalk.git] / src / ui / native_theme / native_theme.h
index aed39ad..eec9d63 100644 (file)
@@ -5,6 +5,7 @@
 #ifndef UI_NATIVE_THEME_NATIVE_THEME_H_
 #define UI_NATIVE_THEME_NATIVE_THEME_H_
 
+#include "base/observer_list.h"
 #include "third_party/skia/include/core/SkColor.h"
 #include "ui/gfx/native_widget_types.h"
 #include "ui/native_theme/native_theme_export.h"
@@ -18,6 +19,8 @@ class Size;
 
 namespace ui {
 
+class NativeThemeObserver;
+
 // This class supports drawing UI controls (like buttons, text fields, lists,
 // comboboxes, etc) that look like the native UI controls of the underlying
 // platform, such as Windows or Linux. It also supplies default colors for
@@ -240,6 +243,7 @@ class NATIVE_THEME_EXPORT NativeTheme {
     kColorId_ButtonDisabledColor,
     kColorId_ButtonHighlightColor,
     kColorId_ButtonHoverColor,
+    kColorId_ButtonHoverBackgroundColor,
     // MenuItem
     kColorId_EnabledMenuItemForegroundColor,
     kColorId_DisabledMenuItemForegroundColor,
@@ -265,6 +269,8 @@ class NATIVE_THEME_EXPORT NativeTheme {
     kColorId_TextfieldReadOnlyBackground,
     kColorId_TextfieldSelectionColor,
     kColorId_TextfieldSelectionBackgroundFocused,
+    // Tooltip
+    kColorId_TooltipBackground,
     // Tree
     kColorId_TreeBackground,
     kColorId_TreeText,
@@ -281,6 +287,22 @@ class NATIVE_THEME_EXPORT NativeTheme {
     kColorId_TableSelectionBackgroundFocused,
     kColorId_TableSelectionBackgroundUnfocused,
     kColorId_TableGroupingIndicatorColor,
+    // Results Tables, such as the chrome omnibox.
+    kColorId_ResultsTableNormalBackground,
+    kColorId_ResultsTableHoveredBackground,
+    kColorId_ResultsTableSelectedBackground,
+    kColorId_ResultsTableNormalText,
+    kColorId_ResultsTableHoveredText,
+    kColorId_ResultsTableSelectedText,
+    kColorId_ResultsTableNormalDimmedText,
+    kColorId_ResultsTableHoveredDimmedText,
+    kColorId_ResultsTableSelectedDimmedText,
+    kColorId_ResultsTableNormalUrl,
+    kColorId_ResultsTableHoveredUrl,
+    kColorId_ResultsTableSelectedUrl,
+    kColorId_ResultsTableNormalDivider,
+    kColorId_ResultsTableHoveredDivider,
+    kColorId_ResultsTableSelectedDivider,
     // TODO(benrg): move other hardcoded colors here.
   };
 
@@ -294,6 +316,13 @@ class NATIVE_THEME_EXPORT NativeTheme {
   // function, returning the port's subclass.
   static NativeTheme* instance();
 
+  // Add or remove observers to be notified when the native theme changes.
+  void AddObserver(NativeThemeObserver* observer);
+  void RemoveObserver(NativeThemeObserver* observer);
+
+  // Notify observers of native theme changes.
+  void NotifyObservers();
+
  protected:
   NativeTheme();
   virtual ~NativeTheme();
@@ -302,6 +331,10 @@ class NATIVE_THEME_EXPORT NativeTheme {
   unsigned int thumb_active_color_;
   unsigned int track_color_;
 
+ private:
+  // Observers to notify when the native theme changes.
+  ObserverList<NativeThemeObserver> native_theme_observers_;
+
   DISALLOW_COPY_AND_ASSIGN(NativeTheme);
 };