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

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

Issue 2485013002: Reland of Clean up some NativeTheme code. (Closed)
Patch Set: 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
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 347 matching lines...) Expand 10 before | Expand all | Expand 10 after
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
368 // Add or remove observers to be notified when the native theme changes. 371 // Add or remove observers to be notified when the native theme changes.
369 void AddObserver(NativeThemeObserver* observer); 372 void AddObserver(NativeThemeObserver* observer);
370 void RemoveObserver(NativeThemeObserver* observer); 373 void RemoveObserver(NativeThemeObserver* observer);
371 374
372 // Notify observers of native theme changes. 375 // Notify observers of native theme changes.
373 void NotifyObservers(); 376 void NotifyObservers();
374 377
375 protected: 378 protected:
376 NativeTheme(); 379 NativeTheme();
377 virtual ~NativeTheme(); 380 virtual ~NativeTheme();
378 381
379 unsigned int thumb_inactive_color_; 382 unsigned int thumb_inactive_color_;
380 unsigned int thumb_active_color_; 383 unsigned int thumb_active_color_;
381 unsigned int track_color_; 384 unsigned int track_color_;
382 385
383 private: 386 private:
384 // Observers to notify when the native theme changes. 387 // Observers to notify when the native theme changes.
385 base::ObserverList<NativeThemeObserver> native_theme_observers_; 388 base::ObserverList<NativeThemeObserver> native_theme_observers_;
386 389
387 DISALLOW_COPY_AND_ASSIGN(NativeTheme); 390 DISALLOW_COPY_AND_ASSIGN(NativeTheme);
388 }; 391 };
389 392
390 } // namespace ui 393 } // namespace ui
391 394
392 #endif // UI_NATIVE_THEME_NATIVE_THEME_H_ 395 #endif // UI_NATIVE_THEME_NATIVE_THEME_H_
OLDNEW
« no previous file with comments | « no previous file | ui/native_theme/native_theme_android.cc » ('j') | ui/native_theme/native_theme_aura.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698