| 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 162 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 173 enum Ownership { | 173 enum Ownership { |
| 174 // Default. Creator is not responsible for managing the lifetime of the | 174 // Default. Creator is not responsible for managing the lifetime of the |
| 175 // Widget, it is destroyed when the corresponding NativeWidget is | 175 // Widget, it is destroyed when the corresponding NativeWidget is |
| 176 // destroyed. | 176 // destroyed. |
| 177 NATIVE_WIDGET_OWNS_WIDGET, | 177 NATIVE_WIDGET_OWNS_WIDGET, |
| 178 // Used when the Widget is owned by someone other than the NativeWidget, | 178 // Used when the Widget is owned by someone other than the NativeWidget, |
| 179 // e.g. a scoped_ptr in tests. | 179 // e.g. a scoped_ptr in tests. |
| 180 WIDGET_OWNS_NATIVE_WIDGET | 180 WIDGET_OWNS_NATIVE_WIDGET |
| 181 }; | 181 }; |
| 182 | 182 |
| 183 enum ShadowType { |
| 184 SHADOW_TYPE_DEFAULT, // Use default shadow setting. It will be one of |
| 185 // the settings below depending on InitParams::type |
| 186 // and the native widget's type. |
| 187 SHADOW_TYPE_NONE, // Don't draw any shadow. |
| 188 SHADOW_TYPE_DROP, // Draw a drop shadow that emphasizes Z-order |
| 189 // relationship to other windows. |
| 190 }; |
| 191 |
| 183 InitParams(); | 192 InitParams(); |
| 184 explicit InitParams(Type type); | 193 explicit InitParams(Type type); |
| 185 ~InitParams(); | 194 ~InitParams(); |
| 186 | 195 |
| 187 Type type; | 196 Type type; |
| 188 // If NULL, a default implementation will be constructed. | 197 // If NULL, a default implementation will be constructed. |
| 189 WidgetDelegate* delegate; | 198 WidgetDelegate* delegate; |
| 190 bool child; | 199 bool child; |
| 191 // If TRANSLUCENT_WINDOW, the widget may be fully or partially transparent. | 200 // If TRANSLUCENT_WINDOW, the widget may be fully or partially transparent. |
| 192 // If OPAQUE_WINDOW, we can perform optimizations based on the widget being | 201 // If OPAQUE_WINDOW, we can perform optimizations based on the widget being |
| 193 // fully opaque. Defaults to TRANSLUCENT_WINDOW if | 202 // fully opaque. Defaults to TRANSLUCENT_WINDOW if |
| 194 // ViewsDelegate::UseTransparentWindows(). Defaults to OPAQUE_WINDOW for | 203 // ViewsDelegate::UseTransparentWindows(). Defaults to OPAQUE_WINDOW for |
| 195 // non-window widgets. | 204 // non-window widgets. |
| 196 WindowOpacity opacity; | 205 WindowOpacity opacity; |
| 197 bool accept_events; | 206 bool accept_events; |
| 198 Activatable activatable; | 207 Activatable activatable; |
| 199 bool keep_on_top; | 208 bool keep_on_top; |
| 200 bool visible_on_all_workspaces; | 209 bool visible_on_all_workspaces; |
| 201 Ownership ownership; | 210 Ownership ownership; |
| 202 bool mirror_origin_in_rtl; | 211 bool mirror_origin_in_rtl; |
| 203 bool has_dropshadow; | 212 ShadowType shadow_type; |
| 204 // Specifies that the system default caption and icon should not be | 213 // Specifies that the system default caption and icon should not be |
| 205 // rendered, and that the client area should be equivalent to the window | 214 // rendered, and that the client area should be equivalent to the window |
| 206 // area. Only used on some platforms (Windows and Linux). | 215 // area. Only used on some platforms (Windows and Linux). |
| 207 bool remove_standard_frame; | 216 bool remove_standard_frame; |
| 208 // Only used by ShellWindow on Windows. Specifies that the default icon of | 217 // Only used by ShellWindow on Windows. Specifies that the default icon of |
| 209 // packaged app should be the system default icon. | 218 // packaged app should be the system default icon. |
| 210 bool use_system_default_icon; | 219 bool use_system_default_icon; |
| 211 // Whether the widget should be maximized or minimized. | 220 // Whether the widget should be maximized or minimized. |
| 212 ui::WindowShowState show_state; | 221 ui::WindowShowState show_state; |
| 213 // Should the widget be double buffered? Default is false. | 222 // Should the widget be double buffered? Default is false. |
| (...skipping 716 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 930 bool movement_disabled_; | 939 bool movement_disabled_; |
| 931 | 940 |
| 932 ScopedObserver<ui::NativeTheme, ui::NativeThemeObserver> observer_manager_; | 941 ScopedObserver<ui::NativeTheme, ui::NativeThemeObserver> observer_manager_; |
| 933 | 942 |
| 934 DISALLOW_COPY_AND_ASSIGN(Widget); | 943 DISALLOW_COPY_AND_ASSIGN(Widget); |
| 935 }; | 944 }; |
| 936 | 945 |
| 937 } // namespace views | 946 } // namespace views |
| 938 | 947 |
| 939 #endif // UI_VIEWS_WIDGET_WIDGET_H_ | 948 #endif // UI_VIEWS_WIDGET_WIDGET_H_ |
| OLD | NEW |