| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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/platform_window/win/win_window.h" | 5 #include "ui/platform_window/win/win_window.h" |
| 6 | 6 |
| 7 #include "base/strings/string16.h" | 7 #include "base/strings/string16.h" |
| 8 #include "ui/events/event.h" | 8 #include "ui/events/event.h" |
| 9 #include "ui/events/event_utils.h" | 9 #include "ui/events/event_utils.h" |
| 10 #include "ui/gfx/win/msg_util.h" | 10 #include "ui/gfx/win/msg_util.h" |
| 11 #include "ui/platform_window/platform_window_delegate.h" | 11 #include "ui/platform_window/platform_window_delegate.h" |
| 12 | 12 |
| 13 namespace ui { | 13 namespace ui { |
| 14 | 14 |
| 15 // static |
| 16 scoped_ptr<PlatformWindow> PlatformWindow::Create( |
| 17 PlatformWindowDelegate* delegate, |
| 18 const gfx::Rect& bounds) { |
| 19 return new WinWindow(delegate, bounds); |
| 20 } |
| 21 |
| 15 namespace { | 22 namespace { |
| 16 | 23 |
| 17 bool use_popup_as_root_window_for_test = false; | 24 bool use_popup_as_root_window_for_test = false; |
| 18 | 25 |
| 19 gfx::Rect GetWindowBoundsForClientBounds(DWORD style, DWORD ex_style, | 26 gfx::Rect GetWindowBoundsForClientBounds(DWORD style, DWORD ex_style, |
| 20 const gfx::Rect& bounds) { | 27 const gfx::Rect& bounds) { |
| 21 RECT wr; | 28 RECT wr; |
| 22 wr.left = bounds.x(); | 29 wr.left = bounds.x(); |
| 23 wr.top = bounds.y(); | 30 wr.top = bounds.y(); |
| 24 wr.right = bounds.x() + bounds.width(); | 31 wr.right = bounds.x() + bounds.width(); |
| (...skipping 161 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 186 | 193 |
| 187 namespace test { | 194 namespace test { |
| 188 | 195 |
| 189 // static | 196 // static |
| 190 void SetUsePopupAsRootWindowForTest(bool use) { | 197 void SetUsePopupAsRootWindowForTest(bool use) { |
| 191 use_popup_as_root_window_for_test = use; | 198 use_popup_as_root_window_for_test = use; |
| 192 } | 199 } |
| 193 | 200 |
| 194 } // namespace test | 201 } // namespace test |
| 195 } // namespace ui | 202 } // namespace ui |
| OLD | NEW |