| 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/macros.h" | 8 #include "base/macros.h" |
| 9 #include "base/observer_list.h" | 9 #include "base/observer_list.h" |
| 10 #include "build/build_config.h" | 10 #include "build/build_config.h" |
| (...skipping 345 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 356 virtual SkColor GetSystemColor(ColorId color_id) const = 0; | 356 virtual SkColor GetSystemColor(ColorId color_id) const = 0; |
| 357 | 357 |
| 358 // Returns a shared instance of the native theme that should be used for web | 358 // Returns a shared instance of the native theme that should be used for web |
| 359 // rendering. Do not use it in a normal application context (i.e. browser). | 359 // rendering. Do not use it in a normal application context (i.e. browser). |
| 360 // The returned object should not be deleted by the caller. This function is | 360 // The returned object should not be deleted by the caller. This function is |
| 361 // not thread safe and should only be called from the UI thread. Each port of | 361 // not thread safe and should only be called from the UI thread. Each port of |
| 362 // NativeTheme should provide its own implementation of this function, | 362 // NativeTheme should provide its own implementation of this function, |
| 363 // returning the port's subclass. | 363 // returning the port's subclass. |
| 364 static NativeTheme* GetInstanceForWeb(); | 364 static NativeTheme* GetInstanceForWeb(); |
| 365 | 365 |
| 366 // Returns a shared instance of the default native theme for native UI. | |
| 367 static NativeTheme* GetInstanceForNativeUi(); | |
| 368 | |
| 369 // Add or remove observers to be notified when the native theme changes. | 366 // Add or remove observers to be notified when the native theme changes. |
| 370 void AddObserver(NativeThemeObserver* observer); | 367 void AddObserver(NativeThemeObserver* observer); |
| 371 void RemoveObserver(NativeThemeObserver* observer); | 368 void RemoveObserver(NativeThemeObserver* observer); |
| 372 | 369 |
| 373 // Notify observers of native theme changes. | 370 // Notify observers of native theme changes. |
| 374 void NotifyObservers(); | 371 void NotifyObservers(); |
| 375 | 372 |
| 376 protected: | 373 protected: |
| 377 NativeTheme(); | 374 NativeTheme(); |
| 378 virtual ~NativeTheme(); | 375 virtual ~NativeTheme(); |
| 379 | 376 |
| 380 unsigned int thumb_inactive_color_; | 377 unsigned int thumb_inactive_color_; |
| 381 unsigned int thumb_active_color_; | 378 unsigned int thumb_active_color_; |
| 382 unsigned int track_color_; | 379 unsigned int track_color_; |
| 383 | 380 |
| 384 private: | 381 private: |
| 385 // Observers to notify when the native theme changes. | 382 // Observers to notify when the native theme changes. |
| 386 base::ObserverList<NativeThemeObserver> native_theme_observers_; | 383 base::ObserverList<NativeThemeObserver> native_theme_observers_; |
| 387 | 384 |
| 388 DISALLOW_COPY_AND_ASSIGN(NativeTheme); | 385 DISALLOW_COPY_AND_ASSIGN(NativeTheme); |
| 389 }; | 386 }; |
| 390 | 387 |
| 391 } // namespace ui | 388 } // namespace ui |
| 392 | 389 |
| 393 #endif // UI_NATIVE_THEME_NATIVE_THEME_H_ | 390 #endif // UI_NATIVE_THEME_NATIVE_THEME_H_ |
| OLD | NEW |