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