Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(4)

Side by Side Diff: ui/native_theme/native_theme.h

Issue 2480993002: Clean up some NativeTheme code. (Closed)
Patch Set: no notreached Created 4 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | ui/native_theme/native_theme_android.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
366 // Add or remove observers to be notified when the native theme changes. 369 // Add or remove observers to be notified when the native theme changes.
367 void AddObserver(NativeThemeObserver* observer); 370 void AddObserver(NativeThemeObserver* observer);
368 void RemoveObserver(NativeThemeObserver* observer); 371 void RemoveObserver(NativeThemeObserver* observer);
369 372
370 // Notify observers of native theme changes. 373 // Notify observers of native theme changes.
371 void NotifyObservers(); 374 void NotifyObservers();
372 375
373 protected: 376 protected:
374 NativeTheme(); 377 NativeTheme();
375 virtual ~NativeTheme(); 378 virtual ~NativeTheme();
376 379
377 unsigned int thumb_inactive_color_; 380 unsigned int thumb_inactive_color_;
378 unsigned int thumb_active_color_; 381 unsigned int thumb_active_color_;
379 unsigned int track_color_; 382 unsigned int track_color_;
380 383
381 private: 384 private:
382 // Observers to notify when the native theme changes. 385 // Observers to notify when the native theme changes.
383 base::ObserverList<NativeThemeObserver> native_theme_observers_; 386 base::ObserverList<NativeThemeObserver> native_theme_observers_;
384 387
385 DISALLOW_COPY_AND_ASSIGN(NativeTheme); 388 DISALLOW_COPY_AND_ASSIGN(NativeTheme);
386 }; 389 };
387 390
388 } // namespace ui 391 } // namespace ui
389 392
390 #endif // UI_NATIVE_THEME_NATIVE_THEME_H_ 393 #endif // UI_NATIVE_THEME_NATIVE_THEME_H_
OLDNEW
« no previous file with comments | « no previous file | ui/native_theme/native_theme_android.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698