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"
9 #include "base/logging.h"
10 #include "ui/aura/remote_root_window_host_win.h"
11 #include "ui/surface/accelerated_surface_win.h"
16 TestMetroViewerProcessHost::TestMetroViewerProcessHost(
17 base::SingleThreadTaskRunner* ipc_task_runner)
18 : MetroViewerProcessHost(ipc_task_runner), closed_unexpectedly_(false) {
21 TestMetroViewerProcessHost::~TestMetroViewerProcessHost() {
24 void TestMetroViewerProcessHost::OnChannelError() {
25 closed_unexpectedly_ = true;
26 aura::RemoteRootWindowHostWin::Instance()->Disconnected();
29 void TestMetroViewerProcessHost::OnSetTargetSurface(
30 gfx::NativeViewId target_surface) {
31 DLOG(INFO) << __FUNCTION__ << ", target_surface = " << target_surface;
32 HWND hwnd = reinterpret_cast<HWND>(target_surface);
33 aura::RemoteRootWindowHostWin::Instance()->Connected(this, hwnd);
35 backing_surface_.reset(new AcceleratedSurface(hwnd));
38 void TestMetroViewerProcessHost::OnOpenURL(const string16& url) {
41 void TestMetroViewerProcessHost::OnHandleSearchRequest(
42 const string16& search_string) {