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

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

Issue 851853002: It is time. (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Trying to reup because the last upload failed. Created 5 years, 11 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
« no previous file with comments | « ui/views/win/hwnd_util.h ('k') | ui/views/win/scoped_fullscreen_visibility.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
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
3 // found in the LICENSE file.
4
5 #include "ui/views/win/hwnd_util.h"
6
7 #include "ui/aura/window.h"
8 #include "ui/aura/window_tree_host.h"
9 #include "ui/views/widget/widget.h"
10
11 namespace views {
12
13 HWND HWNDForView(const View* view) {
14 return view->GetWidget() ? HWNDForWidget(view->GetWidget()) : NULL;
15 }
16
17 HWND HWNDForWidget(const Widget* widget) {
18 return HWNDForNativeWindow(widget->GetNativeWindow());
19 }
20
21 HWND HWNDForNativeView(const gfx::NativeView view) {
22 return view && view->GetRootWindow() ?
23 view->GetHost()->GetAcceleratedWidget() : NULL;
24 }
25
26 HWND HWNDForNativeWindow(const gfx::NativeWindow window) {
27 return window && window->GetRootWindow() ?
28 window->GetHost()->GetAcceleratedWidget() : NULL;
29 }
30
31 gfx::Rect GetWindowBoundsForClientBounds(View* view,
32 const gfx::Rect& client_bounds) {
33 DCHECK(view);
34 aura::WindowTreeHost* host = view->GetWidget()->GetNativeWindow()->GetHost();
35 if (host) {
36 HWND hwnd = host->GetAcceleratedWidget();
37 RECT rect = client_bounds.ToRECT();
38 DWORD style = ::GetWindowLong(hwnd, GWL_STYLE);
39 DWORD ex_style = ::GetWindowLong(hwnd, GWL_EXSTYLE);
40 AdjustWindowRectEx(&rect, style, FALSE, ex_style);
41 return gfx::Rect(rect);
42 }
43 return client_bounds;
44 }
45
46 } // namespace views
OLDNEW
« no previous file with comments | « ui/views/win/hwnd_util.h ('k') | ui/views/win/scoped_fullscreen_visibility.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698