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

Side by Side Diff: ui/views/widget/widget.h

Issue 1310183009: Add ability for Widgets to override the DefaultThemeProvider (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 3 months 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_VIEWS_WIDGET_WIDGET_H_ 5 #ifndef UI_VIEWS_WIDGET_WIDGET_H_
6 #define UI_VIEWS_WIDGET_WIDGET_H_ 6 #define UI_VIEWS_WIDGET_WIDGET_H_
7 7
8 #include <set> 8 #include <set>
9 #include <stack> 9 #include <stack>
10 #include <vector> 10 #include <vector>
(...skipping 536 matching lines...) Expand 10 before | Expand all | Expand 10 after
547 is_secondary_widget_ = is_secondary_widget; 547 is_secondary_widget_ = is_secondary_widget;
548 } 548 }
549 bool is_secondary_widget() const { return is_secondary_widget_; } 549 bool is_secondary_widget() const { return is_secondary_widget_; }
550 550
551 // Returns whether the Widget is visible to the user. 551 // Returns whether the Widget is visible to the user.
552 virtual bool IsVisible() const; 552 virtual bool IsVisible() const;
553 553
554 // Returns the ThemeProvider that provides theme resources for this Widget. 554 // Returns the ThemeProvider that provides theme resources for this Widget.
555 virtual ui::ThemeProvider* GetThemeProvider() const; 555 virtual ui::ThemeProvider* GetThemeProvider() const;
556 556
557 // Sets the ThemeProvider which provides theme resources for this Widget.
558 // Widget does not take ownership.
559 void SetThemeProvider(ui::ThemeProvider* theme_provider);
560
557 ui::NativeTheme* GetNativeTheme() { 561 ui::NativeTheme* GetNativeTheme() {
558 return const_cast<ui::NativeTheme*>( 562 return const_cast<ui::NativeTheme*>(
559 const_cast<const Widget*>(this)->GetNativeTheme()); 563 const_cast<const Widget*>(this)->GetNativeTheme());
560 } 564 }
561 const ui::NativeTheme* GetNativeTheme() const; 565 const ui::NativeTheme* GetNativeTheme() const;
562 566
563 // Returns the FocusManager for this widget. 567 // Returns the FocusManager for this widget.
564 // Note that all widgets in a widget hierarchy share the same focus manager. 568 // Note that all widgets in a widget hierarchy share the same focus manager.
565 FocusManager* GetFocusManager(); 569 FocusManager* GetFocusManager();
566 const FocusManager* GetFocusManager() const; 570 const FocusManager* GetFocusManager() const;
(...skipping 310 matching lines...) Expand 10 before | Expand all | Expand 10 after
877 881
878 // The focus manager keeping track of focus for this Widget and any of its 882 // The focus manager keeping track of focus for this Widget and any of its
879 // children. NULL for non top-level widgets. 883 // children. NULL for non top-level widgets.
880 // WARNING: RootView's destructor calls into the FocusManager. As such, this 884 // WARNING: RootView's destructor calls into the FocusManager. As such, this
881 // must be destroyed AFTER root_view_. This is enforced in DestroyRootView(). 885 // must be destroyed AFTER root_view_. This is enforced in DestroyRootView().
882 scoped_ptr<FocusManager> focus_manager_; 886 scoped_ptr<FocusManager> focus_manager_;
883 887
884 // A theme provider to use when no other theme provider is specified. 888 // A theme provider to use when no other theme provider is specified.
885 scoped_ptr<ui::DefaultThemeProvider> default_theme_provider_; 889 scoped_ptr<ui::DefaultThemeProvider> default_theme_provider_;
886 890
891 // The theme provider to use if specified. Otherwise |default_theme_provider_|
892 // is provided. This is not owned by Widget.
893 ui::ThemeProvider* theme_provider_;
894
887 // Valid for the lifetime of RunShellDrag(), indicates the view the drag 895 // Valid for the lifetime of RunShellDrag(), indicates the view the drag
888 // started from. 896 // started from.
889 View* dragged_view_; 897 View* dragged_view_;
890 898
891 // See class documentation for Widget above for a note about ownership. 899 // See class documentation for Widget above for a note about ownership.
892 InitParams::Ownership ownership_; 900 InitParams::Ownership ownership_;
893 901
894 // See set_is_secondary_widget(). 902 // See set_is_secondary_widget().
895 bool is_secondary_widget_; 903 bool is_secondary_widget_;
896 904
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after
956 bool movement_disabled_; 964 bool movement_disabled_;
957 965
958 ScopedObserver<ui::NativeTheme, ui::NativeThemeObserver> observer_manager_; 966 ScopedObserver<ui::NativeTheme, ui::NativeThemeObserver> observer_manager_;
959 967
960 DISALLOW_COPY_AND_ASSIGN(Widget); 968 DISALLOW_COPY_AND_ASSIGN(Widget);
961 }; 969 };
962 970
963 } // namespace views 971 } // namespace views
964 972
965 #endif // UI_VIEWS_WIDGET_WIDGET_H_ 973 #endif // UI_VIEWS_WIDGET_WIDGET_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698