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_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 223 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
234 ui::WindowShowState show_state; | 234 ui::WindowShowState show_state; |
235 gfx::NativeView parent; | 235 gfx::NativeView parent; |
236 // Specifies the initial bounds of the Widget. Default is empty, which means | 236 // Specifies the initial bounds of the Widget. Default is empty, which means |
237 // the NativeWidget may specify a default size. If the parent is specified, | 237 // the NativeWidget may specify a default size. If the parent is specified, |
238 // |bounds| is in the parent's coordinate system. If the parent is not | 238 // |bounds| is in the parent's coordinate system. If the parent is not |
239 // specified, it's in screen's global coordinate system. | 239 // specified, it's in screen's global coordinate system. |
240 gfx::Rect bounds; | 240 gfx::Rect bounds; |
241 // When set, this value is used as the Widget's NativeWidget implementation. | 241 // When set, this value is used as the Widget's NativeWidget implementation. |
242 // The Widget will not construct a default one. Default is NULL. | 242 // The Widget will not construct a default one. Default is NULL. |
243 NativeWidget* native_widget; | 243 NativeWidget* native_widget; |
244 // If provided, sets the native theme for this widget. | |
245 ui::NativeTheme* native_theme; | |
246 // Aura-only. Provides a DesktopWindowTreeHost implementation to use instead | 244 // Aura-only. Provides a DesktopWindowTreeHost implementation to use instead |
247 // of the default one. | 245 // of the default one. |
248 // TODO(beng): Figure out if there's a better way to expose this, e.g. get | 246 // TODO(beng): Figure out if there's a better way to expose this, e.g. get |
249 // rid of NW subclasses and do this all via message handling. | 247 // rid of NW subclasses and do this all via message handling. |
250 DesktopWindowTreeHost* desktop_window_tree_host; | 248 DesktopWindowTreeHost* desktop_window_tree_host; |
251 // Only used by NativeWidgetAura. Specifies the type of layer for the | 249 // Only used by NativeWidgetAura. Specifies the type of layer for the |
252 // aura::Window. Default is ui::LAYER_TEXTURED. | 250 // aura::Window. Default is ui::LAYER_TEXTURED. |
253 ui::LayerType layer_type; | 251 ui::LayerType layer_type; |
254 // Only used by Aura. Provides a context window whose RootWindow is | 252 // Only used by Aura. Provides a context window whose RootWindow is |
255 // consulted during widget creation to determine where in the Window | 253 // consulted during widget creation to determine where in the Window |
(...skipping 301 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
557 // Returns whether the Widget is visible to the user. | 555 // Returns whether the Widget is visible to the user. |
558 virtual bool IsVisible() const; | 556 virtual bool IsVisible() const; |
559 | 557 |
560 // Returns the ThemeProvider that provides theme resources for this Widget. | 558 // Returns the ThemeProvider that provides theme resources for this Widget. |
561 virtual const ui::ThemeProvider* GetThemeProvider() const; | 559 virtual const ui::ThemeProvider* GetThemeProvider() const; |
562 | 560 |
563 ui::NativeTheme* GetNativeTheme() { | 561 ui::NativeTheme* GetNativeTheme() { |
564 return const_cast<ui::NativeTheme*>( | 562 return const_cast<ui::NativeTheme*>( |
565 const_cast<const Widget*>(this)->GetNativeTheme()); | 563 const_cast<const Widget*>(this)->GetNativeTheme()); |
566 } | 564 } |
567 const ui::NativeTheme* GetNativeTheme() const; | 565 virtual const ui::NativeTheme* GetNativeTheme() const; |
568 | 566 |
569 // Returns the FocusManager for this widget. | 567 // Returns the FocusManager for this widget. |
570 // 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. |
571 FocusManager* GetFocusManager(); | 569 FocusManager* GetFocusManager(); |
572 const FocusManager* GetFocusManager() const; | 570 const FocusManager* GetFocusManager() const; |
573 | 571 |
574 // Returns the ui::InputMethod for this widget. | 572 // Returns the ui::InputMethod for this widget. |
575 ui::InputMethod* GetInputMethod(); | 573 ui::InputMethod* GetInputMethod(); |
576 | 574 |
577 // Starts a drag operation for the specified view. This blocks until the drag | 575 // Starts a drag operation for the specified view. This blocks until the drag |
(...skipping 280 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
858 // Sizes and positions the frameless window just after it is created. | 856 // Sizes and positions the frameless window just after it is created. |
859 void SetInitialBoundsForFramelessWindow(const gfx::Rect& bounds); | 857 void SetInitialBoundsForFramelessWindow(const gfx::Rect& bounds); |
860 | 858 |
861 // Returns the bounds and "show" state from the delegate. Returns true if | 859 // Returns the bounds and "show" state from the delegate. Returns true if |
862 // the delegate wants to use a specified bounds. | 860 // the delegate wants to use a specified bounds. |
863 bool GetSavedWindowPlacement(gfx::Rect* bounds, | 861 bool GetSavedWindowPlacement(gfx::Rect* bounds, |
864 ui::WindowShowState* show_state); | 862 ui::WindowShowState* show_state); |
865 | 863 |
866 internal::NativeWidgetPrivate* native_widget_; | 864 internal::NativeWidgetPrivate* native_widget_; |
867 | 865 |
868 // If non-null, the native theme for this widget. Otherwise the native theme | |
869 // comes from |native_widget_|. | |
870 ui::NativeTheme* native_theme_; | |
871 | |
872 base::ObserverList<WidgetObserver> observers_; | 866 base::ObserverList<WidgetObserver> observers_; |
873 | 867 |
874 base::ObserverList<WidgetRemovalsObserver> removals_observers_; | 868 base::ObserverList<WidgetRemovalsObserver> removals_observers_; |
875 | 869 |
876 // Non-owned pointer to the Widget's delegate. If a NULL delegate is supplied | 870 // Non-owned pointer to the Widget's delegate. If a NULL delegate is supplied |
877 // to Init() a default WidgetDelegate is created. | 871 // to Init() a default WidgetDelegate is created. |
878 WidgetDelegate* widget_delegate_; | 872 WidgetDelegate* widget_delegate_; |
879 | 873 |
880 // The root of the View hierarchy attached to this window. | 874 // The root of the View hierarchy attached to this window. |
881 // WARNING: see warning in tooltip_manager_ for ordering dependencies with | 875 // WARNING: see warning in tooltip_manager_ for ordering dependencies with |
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
969 bool movement_disabled_; | 963 bool movement_disabled_; |
970 | 964 |
971 ScopedObserver<ui::NativeTheme, ui::NativeThemeObserver> observer_manager_; | 965 ScopedObserver<ui::NativeTheme, ui::NativeThemeObserver> observer_manager_; |
972 | 966 |
973 DISALLOW_COPY_AND_ASSIGN(Widget); | 967 DISALLOW_COPY_AND_ASSIGN(Widget); |
974 }; | 968 }; |
975 | 969 |
976 } // namespace views | 970 } // namespace views |
977 | 971 |
978 #endif // UI_VIEWS_WIDGET_WIDGET_H_ | 972 #endif // UI_VIEWS_WIDGET_WIDGET_H_ |
OLD | NEW |