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 #ifndef WIN8_VIEWER_METRO_VIEWER_PROCESS_HOST_H_ | 5 #ifndef WIN8_VIEWER_METRO_VIEWER_PROCESS_HOST_H_ |
6 #define WIN8_VIEWER_METRO_VIEWER_PROCESS_HOST_H_ | 6 #define WIN8_VIEWER_METRO_VIEWER_PROCESS_HOST_H_ |
7 | 7 |
8 #include "base/basictypes.h" | 8 #include "base/basictypes.h" |
9 #include "base/memory/scoped_ptr.h" | 9 #include "base/memory/scoped_ptr.h" |
10 #include "base/strings/string16.h" | 10 #include "base/strings/string16.h" |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
47 base::ProcessId GetViewerProcessId(); | 47 base::ProcessId GetViewerProcessId(); |
48 | 48 |
49 // Launches the viewer process associated with the given |app_user_model_id| | 49 // Launches the viewer process associated with the given |app_user_model_id| |
50 // and blocks until that viewer process connects or until a timeout is | 50 // and blocks until that viewer process connects or until a timeout is |
51 // reached. Returns true if the viewer process connects before the timeout is | 51 // reached. Returns true if the viewer process connects before the timeout is |
52 // reached. NOTE: this assumes that the app referred to by |app_user_model_id| | 52 // reached. NOTE: this assumes that the app referred to by |app_user_model_id| |
53 // is registered as the default browser. | 53 // is registered as the default browser. |
54 bool LaunchViewerAndWaitForConnection( | 54 bool LaunchViewerAndWaitForConnection( |
55 const base::string16& app_user_model_id); | 55 const base::string16& app_user_model_id); |
56 | 56 |
57 private: | |
58 // IPC::Sender implementation: | 57 // IPC::Sender implementation: |
59 virtual bool Send(IPC::Message* msg) OVERRIDE; | 58 virtual bool Send(IPC::Message* msg) OVERRIDE; |
60 | 59 |
| 60 private: |
61 // IPC::Listener implementation: | 61 // IPC::Listener implementation: |
62 virtual bool OnMessageReceived(const IPC::Message& message) OVERRIDE; | 62 virtual bool OnMessageReceived(const IPC::Message& message) OVERRIDE; |
63 virtual void OnChannelError() OVERRIDE = 0; | 63 virtual void OnChannelError() OVERRIDE = 0; |
64 | 64 |
65 // Called over IPC by the viewer process to tell this host that it should be | 65 // Called over IPC by the viewer process to tell this host that it should be |
66 // drawing to |target_surface|. | 66 // drawing to |target_surface|. |
67 virtual void OnSetTargetSurface(gfx::NativeViewId target_surface, | 67 virtual void OnSetTargetSurface(gfx::NativeViewId target_surface, |
68 float device_scale) = 0; | 68 float device_scale) = 0; |
69 | 69 |
70 // Called over IPC by the viewer process to request that the url passed in be | 70 // Called over IPC by the viewer process to request that the url passed in be |
(...skipping 29 matching lines...) Expand all Loading... |
100 scoped_ptr<IPC::ChannelProxy> channel_; | 100 scoped_ptr<IPC::ChannelProxy> channel_; |
101 scoped_ptr<base::WaitableEvent> channel_connected_event_; | 101 scoped_ptr<base::WaitableEvent> channel_connected_event_; |
102 scoped_refptr<InternalMessageFilter> message_filter_; | 102 scoped_refptr<InternalMessageFilter> message_filter_; |
103 | 103 |
104 DISALLOW_COPY_AND_ASSIGN(MetroViewerProcessHost); | 104 DISALLOW_COPY_AND_ASSIGN(MetroViewerProcessHost); |
105 }; | 105 }; |
106 | 106 |
107 } // namespace win8 | 107 } // namespace win8 |
108 | 108 |
109 #endif // WIN8_VIEWER_METRO_VIEWER_PROCESS_HOST_H_ | 109 #endif // WIN8_VIEWER_METRO_VIEWER_PROCESS_HOST_H_ |
OLD | NEW |