| 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 ASH_TEST_TEST_METRO_VIEWER_PROCESS_HOST_H_ | 5 #ifndef ASH_TEST_TEST_METRO_VIEWER_PROCESS_HOST_H_ |
| 6 #define ASH_TEST_TEST_METRO_VIEWER_PROCESS_HOST_H_ | 6 #define ASH_TEST_TEST_METRO_VIEWER_PROCESS_HOST_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "base/memory/scoped_ptr.h" | 10 #include "base/memory/scoped_ptr.h" |
| (...skipping 10 matching lines...) Expand all Loading... |
| 21 namespace ash { | 21 namespace ash { |
| 22 namespace test { | 22 namespace test { |
| 23 | 23 |
| 24 class TestMetroViewerProcessHost : public IPC::Listener, | 24 class TestMetroViewerProcessHost : public IPC::Listener, |
| 25 public IPC::Sender, | 25 public IPC::Sender, |
| 26 public base::NonThreadSafe { | 26 public base::NonThreadSafe { |
| 27 public: | 27 public: |
| 28 explicit TestMetroViewerProcessHost(const std::string& ipc_channel_name); | 28 explicit TestMetroViewerProcessHost(const std::string& ipc_channel_name); |
| 29 virtual ~TestMetroViewerProcessHost(); | 29 virtual ~TestMetroViewerProcessHost(); |
| 30 | 30 |
| 31 // Launches the Chrome viewer process and blocks until that viewer process | 31 // Launches the viewer process associated with the given |app_user_model_id| |
| 32 // connects or until a timeout is reached. Returns true if the viewer process | 32 // and blocks until that viewer process connects or until a timeout is |
| 33 // connects before the timeout is reached. | 33 // reached. Returns true if the viewer process connects before the timeout is |
| 34 // TODO(robertshield): This creates a run-time dependency on chrome.exe as the | 34 // reached. |
| 35 // viewer process and, indirectly, setup.exe as the only thing that can | 35 bool LaunchViewerAndWaitForConnection(const string16& app_user_model_id); |
| 36 // correctly register a program as the default browser on metro. Investigate | |
| 37 // extracting the registration code and the metro init code and building them | |
| 38 // into a standalone viewer process. | |
| 39 bool LaunchImmersiveChromeAndWaitForConnection(); | |
| 40 | 36 |
| 41 // IPC::Sender implementation: | 37 // IPC::Sender implementation: |
| 42 virtual bool Send(IPC::Message* msg) OVERRIDE; | 38 virtual bool Send(IPC::Message* msg) OVERRIDE; |
| 43 | 39 |
| 44 // IPC::Listener implementation: | 40 // IPC::Listener implementation: |
| 45 virtual bool OnMessageReceived(const IPC::Message& message) OVERRIDE; | 41 virtual bool OnMessageReceived(const IPC::Message& message) OVERRIDE; |
| 46 virtual void OnChannelError() OVERRIDE; | 42 virtual void OnChannelError() OVERRIDE; |
| 47 | 43 |
| 48 bool closed_unexpectedly() { return closed_unexpectedly_; } | 44 bool closed_unexpectedly() { return closed_unexpectedly_; } |
| 49 | 45 |
| (...skipping 29 matching lines...) Expand all Loading... |
| 79 bool closed_unexpectedly_; | 75 bool closed_unexpectedly_; |
| 80 | 76 |
| 81 DISALLOW_COPY_AND_ASSIGN(TestMetroViewerProcessHost); | 77 DISALLOW_COPY_AND_ASSIGN(TestMetroViewerProcessHost); |
| 82 }; | 78 }; |
| 83 | 79 |
| 84 | 80 |
| 85 } // namespace test | 81 } // namespace test |
| 86 } // namespace ash | 82 } // namespace ash |
| 87 | 83 |
| 88 #endif // ASH_TEST_TEST_METRO_VIEWER_PROCESS_HOST_H_ | 84 #endif // ASH_TEST_TEST_METRO_VIEWER_PROCESS_HOST_H_ |
| OLD | NEW |