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