OLD | NEW |
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 "ash/test/test_metro_viewer_process_host.h" | 5 #include "ash/test/test_metro_viewer_process_host.h" |
6 | 6 |
7 #include <windef.h> | 7 #include <windef.h> |
8 | 8 |
9 #include "base/logging.h" | 9 #include "base/logging.h" |
10 #include "ui/aura/remote_window_tree_host_win.h" | 10 #include "ui/aura/remote_window_tree_host_win.h" |
| 11 #include "ui/gfx/win/dpi.h" |
11 | 12 |
12 namespace ash { | 13 namespace ash { |
13 namespace test { | 14 namespace test { |
14 | 15 |
15 TestMetroViewerProcessHost::TestMetroViewerProcessHost( | 16 TestMetroViewerProcessHost::TestMetroViewerProcessHost( |
16 base::SingleThreadTaskRunner* ipc_task_runner) | 17 base::SingleThreadTaskRunner* ipc_task_runner) |
17 : MetroViewerProcessHost(ipc_task_runner), closed_unexpectedly_(false) { | 18 : MetroViewerProcessHost(ipc_task_runner), |
| 19 closed_unexpectedly_(false) { |
18 } | 20 } |
19 | 21 |
20 TestMetroViewerProcessHost::~TestMetroViewerProcessHost() { | 22 TestMetroViewerProcessHost::~TestMetroViewerProcessHost() { |
21 } | 23 } |
22 | 24 |
23 void TestMetroViewerProcessHost::OnChannelError() { | 25 void TestMetroViewerProcessHost::OnChannelError() { |
24 closed_unexpectedly_ = true; | 26 closed_unexpectedly_ = true; |
25 aura::RemoteWindowTreeHostWin::Instance()->Disconnected(); | 27 aura::RemoteWindowTreeHostWin::Instance()->Disconnected(); |
26 } | 28 } |
27 | 29 |
28 void TestMetroViewerProcessHost::OnSetTargetSurface( | 30 void TestMetroViewerProcessHost::OnSetTargetSurface( |
29 gfx::NativeViewId target_surface, | 31 gfx::NativeViewId target_surface, |
30 float device_scale) { | 32 float device_scale) { |
31 DLOG(INFO) << __FUNCTION__ << ", target_surface = " << target_surface; | 33 DLOG(INFO) << __FUNCTION__ << ", target_surface = " << target_surface; |
32 HWND hwnd = reinterpret_cast<HWND>(target_surface); | 34 HWND hwnd = reinterpret_cast<HWND>(target_surface); |
33 aura::RemoteWindowTreeHostWin::Instance()-> | 35 gfx::InitDeviceScaleFactor(device_scale); |
34 InitializeRemoteWindowAndScaleFactor(hwnd, device_scale); | 36 aura::RemoteWindowTreeHostWin::Instance()->SetRemoteWindowHandle(hwnd); |
35 aura::RemoteWindowTreeHostWin::Instance()->Connected(this); | 37 aura::RemoteWindowTreeHostWin::Instance()->Connected(this); |
36 } | 38 } |
37 | 39 |
38 void TestMetroViewerProcessHost::OnOpenURL(const base::string16& url) { | 40 void TestMetroViewerProcessHost::OnOpenURL(const base::string16& url) { |
39 } | 41 } |
40 | 42 |
41 void TestMetroViewerProcessHost::OnHandleSearchRequest( | 43 void TestMetroViewerProcessHost::OnHandleSearchRequest( |
42 const base::string16& search_string) { | 44 const base::string16& search_string) { |
43 } | 45 } |
44 | 46 |
45 void TestMetroViewerProcessHost::OnWindowSizeChanged(uint32 width, | 47 void TestMetroViewerProcessHost::OnWindowSizeChanged(uint32 width, |
46 uint32 height) { | 48 uint32 height) { |
47 } | 49 } |
48 | 50 |
49 } // namespace test | 51 } // namespace test |
50 } // namespace ash | 52 } // namespace ash |
OLD | NEW |