| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef UI_NATIVE_THEME_NATIVE_THEME_H_ | 5 #ifndef UI_NATIVE_THEME_NATIVE_THEME_H_ |
| 6 #define UI_NATIVE_THEME_NATIVE_THEME_H_ | 6 #define UI_NATIVE_THEME_NATIVE_THEME_H_ |
| 7 | 7 |
| 8 #include "base/observer_list.h" | 8 #include "base/observer_list.h" |
| 9 #include "third_party/skia/include/core/SkColor.h" | 9 #include "third_party/skia/include/core/SkColor.h" |
| 10 #include "ui/gfx/native_widget_types.h" | 10 #include "ui/gfx/native_widget_types.h" |
| (...skipping 326 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 337 kColorId_ThrobberWaitingColor, | 337 kColorId_ThrobberWaitingColor, |
| 338 kColorId_ThrobberLightColor, | 338 kColorId_ThrobberLightColor, |
| 339 // TODO(benrg): move other hardcoded colors here. | 339 // TODO(benrg): move other hardcoded colors here. |
| 340 | 340 |
| 341 kColorId_NumColors, | 341 kColorId_NumColors, |
| 342 }; | 342 }; |
| 343 | 343 |
| 344 // Return a color from the system theme. | 344 // Return a color from the system theme. |
| 345 virtual SkColor GetSystemColor(ColorId color_id) const = 0; | 345 virtual SkColor GetSystemColor(ColorId color_id) const = 0; |
| 346 | 346 |
| 347 // Returns a shared instance of the native theme. | 347 // Returns a shared instance of the native theme that should be used for web |
| 348 // The returned object should not be deleted by the caller. This function | 348 // rendering. Do not use it in a normal application context (i.e. browser). |
| 349 // is not thread safe and should only be called from the UI thread. | 349 // The returned object should not be deleted by the caller. This function is |
| 350 // Each port of NativeTheme should provide its own implementation of this | 350 // not thread safe and should only be called from the UI thread. Each port of |
| 351 // function, returning the port's subclass. | 351 // NativeTheme should provide its own implementation of this function, |
| 352 static NativeTheme* instance(); | 352 // returning the port's subclass. |
| 353 static NativeTheme* GetInstanceForWeb(); |
| 353 | 354 |
| 354 // Add or remove observers to be notified when the native theme changes. | 355 // Add or remove observers to be notified when the native theme changes. |
| 355 void AddObserver(NativeThemeObserver* observer); | 356 void AddObserver(NativeThemeObserver* observer); |
| 356 void RemoveObserver(NativeThemeObserver* observer); | 357 void RemoveObserver(NativeThemeObserver* observer); |
| 357 | 358 |
| 358 // Notify observers of native theme changes. | 359 // Notify observers of native theme changes. |
| 359 void NotifyObservers(); | 360 void NotifyObservers(); |
| 360 | 361 |
| 361 protected: | 362 protected: |
| 362 NativeTheme(); | 363 NativeTheme(); |
| 363 virtual ~NativeTheme(); | 364 virtual ~NativeTheme(); |
| 364 | 365 |
| 365 unsigned int thumb_inactive_color_; | 366 unsigned int thumb_inactive_color_; |
| 366 unsigned int thumb_active_color_; | 367 unsigned int thumb_active_color_; |
| 367 unsigned int track_color_; | 368 unsigned int track_color_; |
| 368 | 369 |
| 369 private: | 370 private: |
| 370 // Observers to notify when the native theme changes. | 371 // Observers to notify when the native theme changes. |
| 371 base::ObserverList<NativeThemeObserver> native_theme_observers_; | 372 base::ObserverList<NativeThemeObserver> native_theme_observers_; |
| 372 | 373 |
| 373 DISALLOW_COPY_AND_ASSIGN(NativeTheme); | 374 DISALLOW_COPY_AND_ASSIGN(NativeTheme); |
| 374 }; | 375 }; |
| 375 | 376 |
| 376 } // namespace ui | 377 } // namespace ui |
| 377 | 378 |
| 378 #endif // UI_NATIVE_THEME_NATIVE_THEME_H_ | 379 #endif // UI_NATIVE_THEME_NATIVE_THEME_H_ |
| OLD | NEW |