| OLD | NEW |
| (Empty) |
| 1 // Copyright 2012 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 CHROME_BROWSER_METRO_VIEWER_METRO_VIEWER_PROCESS_HOST_WIN_H_ | |
| 6 #define CHROME_BROWSER_METRO_VIEWER_METRO_VIEWER_PROCESS_HOST_WIN_H_ | |
| 7 | |
| 8 #include <string> | |
| 9 | |
| 10 #include "base/memory/scoped_ptr.h" | |
| 11 #include "base/process_util.h" | |
| 12 #include "base/threading/non_thread_safe.h" | |
| 13 #include "ipc/ipc_listener.h" | |
| 14 #include "ipc/ipc_sender.h" | |
| 15 #include "ui/gfx/native_widget_types.h" | |
| 16 | |
| 17 namespace IPC { | |
| 18 class ChannelProxy; | |
| 19 } | |
| 20 | |
| 21 class MetroViewerProcessHost : public IPC::Listener, | |
| 22 public IPC::Sender, | |
| 23 public base::NonThreadSafe { | |
| 24 public: | |
| 25 explicit MetroViewerProcessHost(const std::string& ipc_channel_name); | |
| 26 virtual ~MetroViewerProcessHost(); | |
| 27 | |
| 28 // Returns the process id of the viewer process if one is connected to this | |
| 29 // host, returns base::kNullProcessId otherwise. | |
| 30 base::ProcessId GetViewerProcessId(); | |
| 31 | |
| 32 private: | |
| 33 // IPC::Sender implementation: | |
| 34 virtual bool Send(IPC::Message* msg) OVERRIDE; | |
| 35 | |
| 36 // IPC::Listener implementation: | |
| 37 virtual bool OnMessageReceived(const IPC::Message& message) OVERRIDE; | |
| 38 virtual void OnChannelError() OVERRIDE; | |
| 39 | |
| 40 void OnSetTargetSurface(gfx::NativeViewId target_surface); | |
| 41 | |
| 42 scoped_ptr<IPC::ChannelProxy> channel_; | |
| 43 | |
| 44 DISALLOW_COPY_AND_ASSIGN(MetroViewerProcessHost); | |
| 45 }; | |
| 46 | |
| 47 #endif // CHROME_BROWSER_METRO_VIEWER_METRO_VIEWER_PROCESS_HOST_WIN_H_ | |
| OLD | NEW |