OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 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 MOJO_RUNNER_CONTEXT_H_ | 5 #ifndef MOJO_RUNNER_CONTEXT_H_ |
6 #define MOJO_RUNNER_CONTEXT_H_ | 6 #define MOJO_RUNNER_CONTEXT_H_ |
7 | 7 |
8 #include <set> | 8 #include <set> |
9 #include <string> | 9 #include <string> |
10 | 10 |
11 #include "base/callback_forward.h" | 11 #include "base/callback_forward.h" |
12 #include "base/macros.h" | 12 #include "base/macros.h" |
13 #include "base/time/time.h" | 13 #include "base/time/time.h" |
14 #include "mojo/runner/scoped_user_data_dir.h" | 14 #include "mojo/runner/scoped_user_data_dir.h" |
15 #include "mojo/runner/task_runners.h" | 15 #include "mojo/runner/task_runners.h" |
16 #include "mojo/runner/tracer.h" | 16 #include "mojo/runner/tracer.h" |
17 #include "mojo/shell/application_manager.h" | 17 #include "mojo/shell/application_manager.h" |
18 #include "third_party/mojo/src/mojo/edk/embedder/process_delegate.h" | 18 #include "third_party/mojo/src/mojo/edk/embedder/process_delegate.h" |
19 #include "url/gurl.h" | 19 #include "url/gurl.h" |
20 | 20 |
21 namespace mojo { | 21 namespace mojo { |
22 namespace package_manager { | 22 namespace shell { |
23 class PackageManagerImpl; | 23 class PackageManagerImpl; |
24 } | 24 } |
25 namespace runner { | 25 namespace runner { |
26 | 26 |
27 class NativeApplicationLoader; | 27 class NativeApplicationLoader; |
28 | 28 |
29 // The "global" context for the shell's main process. | 29 // The "global" context for the shell's main process. |
30 // TODO(use_chrome_edk) | 30 // TODO(use_chrome_edk) |
31 //class Context : public edk::ProcessDelegate { | 31 //class Context : public edk::ProcessDelegate { |
32 class Context : public embedder::ProcessDelegate { | 32 class Context : public embedder::ProcessDelegate { |
(...skipping 18 matching lines...) Expand all Loading... |
51 | 51 |
52 // Run the application specified on the commandline. When the app finishes, | 52 // Run the application specified on the commandline. When the app finishes, |
53 // |callback| is run if not null, otherwise the message loop is quit. | 53 // |callback| is run if not null, otherwise the message loop is quit. |
54 void RunCommandLineApplication(const base::Closure& callback); | 54 void RunCommandLineApplication(const base::Closure& callback); |
55 | 55 |
56 TaskRunners* task_runners() { return task_runners_.get(); } | 56 TaskRunners* task_runners() { return task_runners_.get(); } |
57 shell::ApplicationManager* application_manager() { | 57 shell::ApplicationManager* application_manager() { |
58 return application_manager_.get(); | 58 return application_manager_.get(); |
59 } | 59 } |
60 | 60 |
61 package_manager::PackageManagerImpl* package_manager() { | 61 shell::PackageManagerImpl* package_manager() { return package_manager_; } |
62 return package_manager_; | |
63 } | |
64 | 62 |
65 private: | 63 private: |
66 class NativeViewportApplicationLoader; | 64 class NativeViewportApplicationLoader; |
67 | 65 |
68 // ProcessDelegate implementation. | 66 // ProcessDelegate implementation. |
69 void OnShutdownComplete() override; | 67 void OnShutdownComplete() override; |
70 | 68 |
71 void OnApplicationEnd(const GURL& url); | 69 void OnApplicationEnd(const GURL& url); |
72 | 70 |
73 ScopedUserDataDir scoped_user_data_dir; | 71 ScopedUserDataDir scoped_user_data_dir; |
74 std::set<GURL> app_urls_; | 72 std::set<GURL> app_urls_; |
75 scoped_ptr<TaskRunners> task_runners_; | 73 scoped_ptr<TaskRunners> task_runners_; |
76 // Ensure this is destructed before task_runners_ since it owns a message pipe | 74 // Ensure this is destructed before task_runners_ since it owns a message pipe |
77 // that needs the IO thread to destruct cleanly. | 75 // that needs the IO thread to destruct cleanly. |
78 Tracer tracer_; | 76 Tracer tracer_; |
79 // Owned by |application_manager_|. | 77 // Owned by |application_manager_|. |
80 package_manager::PackageManagerImpl* package_manager_; | 78 shell::PackageManagerImpl* package_manager_; |
81 scoped_ptr<shell::ApplicationManager> application_manager_; | 79 scoped_ptr<shell::ApplicationManager> application_manager_; |
82 base::Closure app_complete_callback_; | 80 base::Closure app_complete_callback_; |
83 base::Time main_entry_time_; | 81 base::Time main_entry_time_; |
84 | 82 |
85 DISALLOW_COPY_AND_ASSIGN(Context); | 83 DISALLOW_COPY_AND_ASSIGN(Context); |
86 }; | 84 }; |
87 | 85 |
88 } // namespace runner | 86 } // namespace runner |
89 } // namespace mojo | 87 } // namespace mojo |
90 | 88 |
91 #endif // MOJO_RUNNER_CONTEXT_H_ | 89 #endif // MOJO_RUNNER_CONTEXT_H_ |
OLD | NEW |