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