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 #include "ui/aura/root_window_host_win.h" | 5 #include "ui/aura/root_window_host_win.h" |
6 | 6 |
7 #include <windows.h> | 7 #include <windows.h> |
8 | 8 |
9 #include <algorithm> | 9 #include <algorithm> |
10 | 10 |
11 #include "base/message_loop.h" | 11 #include "base/message_loop.h" |
12 #include "ui/aura/client/capture_client.h" | 12 #include "ui/aura/client/capture_client.h" |
13 #include "ui/aura/env.h" | 13 #include "ui/aura/env.h" |
14 #include "ui/aura/root_window.h" | 14 #include "ui/aura/root_window.h" |
15 #include "ui/base/cursor/cursor_loader_win.h" | 15 #include "ui/base/cursor/cursor_loader_win.h" |
16 #include "ui/base/events/event.h" | 16 #include "ui/base/events/event.h" |
17 #include "ui/base/view_prop.h" | 17 #include "ui/base/view_prop.h" |
18 | 18 |
19 using std::max; | 19 using std::max; |
20 using std::min; | 20 using std::min; |
21 | 21 |
22 namespace aura { | 22 namespace aura { |
23 | 23 |
24 namespace { | 24 namespace { |
25 | 25 |
26 const char* kRootWindowHostWinKey = "__AURA_ROOT_WINDOW_HOST_WIN__"; | 26 const char* kRootWindowHostWinKey = "__AURA_ROOT_WINDOW_HOST_WIN__"; |
27 | 27 |
28 } // namespace | 28 } // namespace |
29 | 29 |
| 30 #if 0 |
| 31 // We disable the factory here and instead have the same factory |
| 32 // in remote_root_window_host_win.cc |
30 // static | 33 // static |
31 RootWindowHost* RootWindowHost::Create(RootWindowHostDelegate* delegate, | 34 RootWindowHost* RootWindowHost::Create(RootWindowHostDelegate* delegate, |
32 const gfx::Rect& bounds) { | 35 const gfx::Rect& bounds) { |
33 return new RootWindowHostWin(delegate, bounds); | 36 return new RootWindowHostWin(delegate, bounds); |
34 } | 37 } |
| 38 #endif |
35 | 39 |
36 // static | 40 // static |
37 RootWindowHost* RootWindowHost::GetForAcceleratedWidget( | 41 RootWindowHost* RootWindowHost::GetForAcceleratedWidget( |
38 gfx::AcceleratedWidget accelerated_widget) { | 42 gfx::AcceleratedWidget accelerated_widget) { |
39 return reinterpret_cast<RootWindowHost*>( | 43 return reinterpret_cast<RootWindowHost*>( |
40 ui::ViewProp::GetValue(accelerated_widget, kRootWindowHostWinKey)); | 44 ui::ViewProp::GetValue(accelerated_widget, kRootWindowHostWinKey)); |
41 } | 45 } |
42 | 46 |
43 // static | 47 // static |
44 gfx::Size RootWindowHost::GetNativeScreenSize() { | 48 gfx::Size RootWindowHost::GetNativeScreenSize() { |
(...skipping 227 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
272 } | 276 } |
273 | 277 |
274 void RootWindowHostWin::OnSize(UINT param, const CSize& size) { | 278 void RootWindowHostWin::OnSize(UINT param, const CSize& size) { |
275 // Minimizing resizes the window to 0x0 which causes our layout to go all | 279 // Minimizing resizes the window to 0x0 which causes our layout to go all |
276 // screwy, so we just ignore it. | 280 // screwy, so we just ignore it. |
277 if (param != SIZE_MINIMIZED) | 281 if (param != SIZE_MINIMIZED) |
278 delegate_->OnHostResized(gfx::Size(size.cx, size.cy)); | 282 delegate_->OnHostResized(gfx::Size(size.cx, size.cy)); |
279 } | 283 } |
280 | 284 |
281 } // namespace aura | 285 } // namespace aura |
OLD | NEW |