Updating trunk VERSION from 2139.0 to 2140.0
[chromium-blink-merge.git] / ash / test / test_metro_viewer_process_host.cc
blob85df3e21cbccfb6f64faad4fb6aaa9ea2dbdf6f5
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.
5 #include "ash/test/test_metro_viewer_process_host.h"
7 #include <windef.h>
9 #include "base/logging.h"
10 #include "ui/aura/remote_window_tree_host_win.h"
11 #include "ui/gfx/win/dpi.h"
13 namespace ash {
14 namespace test {
16 TestMetroViewerProcessHost::TestMetroViewerProcessHost(
17 base::SingleThreadTaskRunner* ipc_task_runner)
18 : MetroViewerProcessHost(ipc_task_runner),
19 closed_unexpectedly_(false) {
22 TestMetroViewerProcessHost::~TestMetroViewerProcessHost() {
25 void TestMetroViewerProcessHost::OnChannelError() {
26 closed_unexpectedly_ = true;
27 aura::RemoteWindowTreeHostWin::Instance()->Disconnected();
30 void TestMetroViewerProcessHost::OnSetTargetSurface(
31 gfx::NativeViewId target_surface,
32 float device_scale) {
33 DLOG(INFO) << __FUNCTION__ << ", target_surface = " << target_surface;
34 HWND hwnd = reinterpret_cast<HWND>(target_surface);
35 gfx::InitDeviceScaleFactor(device_scale);
36 aura::RemoteWindowTreeHostWin::Instance()->SetRemoteWindowHandle(hwnd);
37 aura::RemoteWindowTreeHostWin::Instance()->Connected(this);
40 void TestMetroViewerProcessHost::OnOpenURL(const base::string16& url) {
43 void TestMetroViewerProcessHost::OnHandleSearchRequest(
44 const base::string16& search_string) {
47 void TestMetroViewerProcessHost::OnWindowSizeChanged(uint32 width,
48 uint32 height) {
51 } // namespace test
52 } // namespace ash