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

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

Issue 297503003: Revert: [Refactor] Consolidate the logic for whether a widget can be activated. This is a first ste (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 7 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 | Annotate | Revision Log
« no previous file with comments | « ui/views/widget/native_widget_aura_unittest.cc ('k') | ui/views/widget/widget.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 144 matching lines...) Expand 10 before | Expand all | Expand 10 after
155 // Infer fully opaque or not. For WinAura, top-level windows that are not 155 // Infer fully opaque or not. For WinAura, top-level windows that are not
156 // of TYPE_WINDOW are translucent so that they can be made to fade in. In 156 // of TYPE_WINDOW are translucent so that they can be made to fade in. In
157 // all other cases, windows are fully opaque. 157 // all other cases, windows are fully opaque.
158 INFER_OPACITY, 158 INFER_OPACITY,
159 // Fully opaque. 159 // Fully opaque.
160 OPAQUE_WINDOW, 160 OPAQUE_WINDOW,
161 // Possibly translucent/transparent. 161 // Possibly translucent/transparent.
162 TRANSLUCENT_WINDOW, 162 TRANSLUCENT_WINDOW,
163 }; 163 };
164 164
165 enum Activatable {
166 // Infer whether the window should be activatable from the window type.
167 ACTIVATABLE_DEFAULT,
168
169 ACTIVATABLE_YES,
170 ACTIVATABLE_NO
171 };
172
173 enum Ownership { 165 enum Ownership {
174 // Default. Creator is not responsible for managing the lifetime of the 166 // Default. Creator is not responsible for managing the lifetime of the
175 // Widget, it is destroyed when the corresponding NativeWidget is 167 // Widget, it is destroyed when the corresponding NativeWidget is
176 // destroyed. 168 // destroyed.
177 NATIVE_WIDGET_OWNS_WIDGET, 169 NATIVE_WIDGET_OWNS_WIDGET,
178 // Used when the Widget is owned by someone other than the NativeWidget, 170 // Used when the Widget is owned by someone other than the NativeWidget,
179 // e.g. a scoped_ptr in tests. 171 // e.g. a scoped_ptr in tests.
180 WIDGET_OWNS_NATIVE_WIDGET 172 WIDGET_OWNS_NATIVE_WIDGET
181 }; 173 };
182 174
183 InitParams(); 175 InitParams();
184 explicit InitParams(Type type); 176 explicit InitParams(Type type);
185 ~InitParams(); 177 ~InitParams();
186 178
187 Type type; 179 Type type;
188 // If NULL, a default implementation will be constructed. 180 // If NULL, a default implementation will be constructed.
189 WidgetDelegate* delegate; 181 WidgetDelegate* delegate;
190 bool child; 182 bool child;
191 // If TRANSLUCENT_WINDOW, the widget may be fully or partially transparent. 183 // If TRANSLUCENT_WINDOW, the widget may be fully or partially transparent.
192 // If OPAQUE_WINDOW, we can perform optimizations based on the widget being 184 // If OPAQUE_WINDOW, we can perform optimizations based on the widget being
193 // fully opaque. Defaults to TRANSLUCENT_WINDOW if 185 // fully opaque. Defaults to TRANSLUCENT_WINDOW if
194 // ViewsDelegate::UseTransparentWindows(). Defaults to OPAQUE_WINDOW for 186 // ViewsDelegate::UseTransparentWindows(). Defaults to OPAQUE_WINDOW for
195 // non-window widgets. 187 // non-window widgets.
196 WindowOpacity opacity; 188 WindowOpacity opacity;
197 bool accept_events; 189 bool accept_events;
198 Activatable activatable; 190 bool can_activate;
199 bool keep_on_top; 191 bool keep_on_top;
200 bool visible_on_all_workspaces; 192 bool visible_on_all_workspaces;
201 Ownership ownership; 193 Ownership ownership;
202 bool mirror_origin_in_rtl; 194 bool mirror_origin_in_rtl;
203 bool has_dropshadow; 195 bool has_dropshadow;
204 // Specifies that the system default caption and icon should not be 196 // Specifies that the system default caption and icon should not be
205 // rendered, and that the client area should be equivalent to the window 197 // rendered, and that the client area should be equivalent to the window
206 // area. Only used on some platforms (Windows and Linux). 198 // area. Only used on some platforms (Windows and Linux).
207 bool remove_standard_frame; 199 bool remove_standard_frame;
208 // Only used by ShellWindow on Windows. Specifies that the default icon of 200 // Only used by ShellWindow on Windows. Specifies that the default icon of
(...skipping 666 matching lines...) Expand 10 before | Expand all | Expand 10 after
875 bool widget_closed_; 867 bool widget_closed_;
876 868
877 // The saved "show" state for this window. See note in SetInitialBounds 869 // The saved "show" state for this window. See note in SetInitialBounds
878 // that explains why we save this. 870 // that explains why we save this.
879 ui::WindowShowState saved_show_state_; 871 ui::WindowShowState saved_show_state_;
880 872
881 // The restored bounds used for the initial show. This is only used if 873 // The restored bounds used for the initial show. This is only used if
882 // |saved_show_state_| is maximized. 874 // |saved_show_state_| is maximized.
883 gfx::Rect initial_restored_bounds_; 875 gfx::Rect initial_restored_bounds_;
884 876
885 // True if the widget can be activated.
886 bool can_activate_;
887
888 // Focus is automatically set to the view provided by the delegate 877 // Focus is automatically set to the view provided by the delegate
889 // when the widget is shown. Set this value to false to override 878 // when the widget is shown. Set this value to false to override
890 // initial focus for the widget. 879 // initial focus for the widget.
891 bool focus_on_creation_; 880 bool focus_on_creation_;
892 881
893 mutable scoped_ptr<InputMethod> input_method_; 882 mutable scoped_ptr<InputMethod> input_method_;
894 883
895 // See |is_top_level()| accessor. 884 // See |is_top_level()| accessor.
896 bool is_top_level_; 885 bool is_top_level_;
897 886
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
930 bool movement_disabled_; 919 bool movement_disabled_;
931 920
932 ScopedObserver<ui::NativeTheme, ui::NativeThemeObserver> observer_manager_; 921 ScopedObserver<ui::NativeTheme, ui::NativeThemeObserver> observer_manager_;
933 922
934 DISALLOW_COPY_AND_ASSIGN(Widget); 923 DISALLOW_COPY_AND_ASSIGN(Widget);
935 }; 924 };
936 925
937 } // namespace views 926 } // namespace views
938 927
939 #endif // UI_VIEWS_WIDGET_WIDGET_H_ 928 #endif // UI_VIEWS_WIDGET_WIDGET_H_
OLDNEW
« no previous file with comments | « ui/views/widget/native_widget_aura_unittest.cc ('k') | ui/views/widget/widget.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698