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.
4
5#ifndef ASH_TEST_TEST_METRO_VIEWER_PROCESS_HOST_H_
6#define ASH_TEST_TEST_METRO_VIEWER_PROCESS_HOST_H_
7
8#include "base/memory/scoped_ptr.h"
9#include "win8/viewer/metro_viewer_process_host.h"
10
11class AcceleratedSurface;
12
13namespace ash {
14namespace test {
15
16class TestMetroViewerProcessHost : public win8::MetroViewerProcessHost {
17 public:
18  TestMetroViewerProcessHost(base::SingleThreadTaskRunner* ipc_task_runner);
19  virtual ~TestMetroViewerProcessHost();
20
21  bool closed_unexpectedly() { return closed_unexpectedly_; }
22
23  // Forcibly terminate the viewer. Used on completion of tests to ensure that
24  // it's gone (quickly) so that we can start the next test immediately.
25  void TerminateViewer();
26
27 private:
28  // win8::MetroViewerProcessHost implementation
29  virtual void OnChannelError() OVERRIDE;
30  virtual void OnSetTargetSurface(gfx::NativeViewId target_surface,
31                                  float device_scale) OVERRIDE;
32  virtual void OnOpenURL(const base::string16& url) OVERRIDE;
33  virtual void OnHandleSearchRequest(
34      const base::string16& search_string) OVERRIDE;
35  virtual void OnWindowSizeChanged(uint32 width, uint32 height) OVERRIDE;
36
37  bool closed_unexpectedly_;
38
39  DISALLOW_COPY_AND_ASSIGN(TestMetroViewerProcessHost);
40};
41
42
43}  // namespace test
44}  // namespace ash
45
46#endif  // ASH_TEST_TEST_METRO_VIEWER_PROCESS_HOST_H_
47