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

Side by Side Diff: ui/views/win/hwnd_util_win.cc

Issue 13896011: Make javascript dialogs into top-level windows. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix non-aura build. Created 7 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/win/hwnd_util_aurawin.cc ('k') | ui/views/window/native_frame_view.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) 2013 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2013 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/win/hwnd_util.h" 5 #include "ui/views/win/hwnd_util.h"
6 6
7 #include "ui/views/widget/widget.h" 7 #include "ui/views/widget/widget.h"
8 8
9 namespace views { 9 namespace views {
10 10
11 HWND HWNDForView(View* view) { 11 HWND HWNDForView(View* view) {
12 return view->GetWidget() ? HWNDForWidget(view->GetWidget()) : NULL; 12 return view->GetWidget() ? HWNDForWidget(view->GetWidget()) : NULL;
13 } 13 }
14 14
15 // Returns the HWND associated with the specified widget. 15 // Returns the HWND associated with the specified widget.
16 HWND HWNDForWidget(Widget* widget) { 16 HWND HWNDForWidget(Widget* widget) {
17 return widget->GetNativeView(); 17 return widget->GetNativeView();
18 } 18 }
19 19
20 HWND HWNDForNativeView(gfx::NativeView view) { 20 HWND HWNDForNativeView(gfx::NativeView view) {
21 return view; 21 return view;
22 } 22 }
23 23
24 HWND HWNDForNativeWindow(gfx::NativeWindow window) { 24 HWND HWNDForNativeWindow(gfx::NativeWindow window) {
25 return window; 25 return window;
26 } 26 }
27 27
28 gfx::Rect GetWindowBoundsForClientBounds(View* view,
29 const gfx::Rect& client_bounds) {
30 DCHECK(view);
31 HWND hwnd = view->GetWidget()->GetNativeWindow();
32 RECT rect = client_bounds.ToRECT();
33 DWORD style = ::GetWindowLong(hwnd, GWL_STYLE);
34 DWORD ex_style = ::GetWindowLong(hwnd, GWL_EXSTYLE);
35 AdjustWindowRectEx(&rect, style, FALSE, ex_style);
36 return gfx::Rect(rect);
28 } 37 }
38
39 } // namespace views
OLDNEW
« no previous file with comments | « ui/views/win/hwnd_util_aurawin.cc ('k') | ui/views/window/native_frame_view.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698