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

Side by Side Diff: ui/views/widget/widget_hwnd_utils.cc

Issue 286733002: [Refactor] Consolidate the logic for whether a widget can be activated. (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/widget.cc ('k') | ui/views/widget/widget_unittest.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 #include "ui/views/widget/widget_hwnd_utils.h" 5 #include "ui/views/widget/widget_hwnd_utils.h"
6 6
7 #include <dwmapi.h> 7 #include <dwmapi.h>
8 8
9 #include "base/command_line.h" 9 #include "base/command_line.h"
10 #include "base/win/windows_version.h" 10 #include "base/win/windows_version.h"
(...skipping 23 matching lines...) Expand all
34 34
35 // Set type-independent style attributes. 35 // Set type-independent style attributes.
36 if (params.child) 36 if (params.child)
37 *style |= WS_CHILD; 37 *style |= WS_CHILD;
38 if (params.show_state == ui::SHOW_STATE_MAXIMIZED) 38 if (params.show_state == ui::SHOW_STATE_MAXIMIZED)
39 *style |= WS_MAXIMIZE; 39 *style |= WS_MAXIMIZE;
40 if (params.show_state == ui::SHOW_STATE_MINIMIZED) 40 if (params.show_state == ui::SHOW_STATE_MINIMIZED)
41 *style |= WS_MINIMIZE; 41 *style |= WS_MINIMIZE;
42 if (!params.accept_events) 42 if (!params.accept_events)
43 *ex_style |= WS_EX_TRANSPARENT; 43 *ex_style |= WS_EX_TRANSPARENT;
44 if (!params.can_activate) 44 DCHECK_NE(Widget::InitParams::ACTIVATABLE_DEFAULT, params.activatable);
45 if (params.activatable == Widget::InitParams::ACTIVATABLE_NO)
45 *ex_style |= WS_EX_NOACTIVATE; 46 *ex_style |= WS_EX_NOACTIVATE;
46 if (params.keep_on_top) 47 if (params.keep_on_top)
47 *ex_style |= WS_EX_TOPMOST; 48 *ex_style |= WS_EX_TOPMOST;
48 if (params.mirror_origin_in_rtl) 49 if (params.mirror_origin_in_rtl)
49 *ex_style |= l10n_util::GetExtendedTooltipStyles(); 50 *ex_style |= l10n_util::GetExtendedTooltipStyles();
50 // Layered windows do not work with Aura. They are basically incompatible 51 // Layered windows do not work with Aura. They are basically incompatible
51 // with Direct3D surfaces. Officially, it should be impossible to achieve 52 // with Direct3D surfaces. Officially, it should be impossible to achieve
52 // per-pixel alpha compositing with the desktop and 3D acceleration but it 53 // per-pixel alpha compositing with the desktop and 3D acceleration but it
53 // has been discovered that since Vista There is a secret handshake between 54 // has been discovered that since Vista There is a secret handshake between
54 // user32 and the DMW. If things are set up just right DMW gets out of the 55 // user32 and the DMW. If things are set up just right DMW gets out of the
(...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after
152 DWORD class_style = 0; 153 DWORD class_style = 0;
153 CalculateWindowStylesFromInitParams(params, widget_delegate, 154 CalculateWindowStylesFromInitParams(params, widget_delegate,
154 native_widget_delegate, &style, &ex_style, 155 native_widget_delegate, &style, &ex_style,
155 &class_style); 156 &class_style);
156 handler->set_initial_class_style(class_style); 157 handler->set_initial_class_style(class_style);
157 handler->set_window_style(handler->window_style() | style); 158 handler->set_window_style(handler->window_style() | style);
158 handler->set_window_ex_style(handler->window_ex_style() | ex_style); 159 handler->set_window_ex_style(handler->window_ex_style() | ex_style);
159 } 160 }
160 161
161 } // namespace views 162 } // namespace views
OLDNEW
« no previous file with comments | « ui/views/widget/widget.cc ('k') | ui/views/widget/widget_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698