| 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_SHELL_CONTEXT_H_ | 5 #ifndef MOJO_SHELL_CONTEXT_H_ |
| 6 #define MOJO_SHELL_CONTEXT_H_ | 6 #define MOJO_SHELL_CONTEXT_H_ |
| 7 | 7 |
| 8 #include "mojo/common/bindings_support_impl.h" | 8 #include "mojo/common/bindings_support_impl.h" |
| 9 #include "mojo/shell/loader.h" | 9 #include "mojo/shell/loader.h" |
| 10 #include "mojo/shell/service_manager.h" |
| 10 #include "mojo/shell/storage.h" | 11 #include "mojo/shell/storage.h" |
| 11 #include "mojo/shell/task_runners.h" | 12 #include "mojo/shell/task_runners.h" |
| 12 | 13 |
| 13 #if defined(OS_ANDROID) | 14 #if defined(OS_ANDROID) |
| 14 #include "base/android/scoped_java_ref.h" | 15 #include "base/android/scoped_java_ref.h" |
| 15 #endif // defined(OS_ANDROID) | 16 #endif // defined(OS_ANDROID) |
| 16 | 17 |
| 17 namespace mojo { | 18 namespace mojo { |
| 18 namespace shell { | 19 namespace shell { |
| 19 | 20 |
| 20 class Context { | 21 class Context { |
| 21 public: | 22 public: |
| 22 Context(); | 23 Context(); |
| 23 ~Context(); | 24 ~Context(); |
| 24 | 25 |
| 25 TaskRunners* task_runners() { return &task_runners_; } | 26 TaskRunners* task_runners() { return &task_runners_; } |
| 26 Storage* storage() { return &storage_; } | 27 Storage* storage() { return &storage_; } |
| 27 Loader* loader() { return &loader_; } | 28 Loader* loader() { return &loader_; } |
| 29 ServiceManager* service_manager() { return service_manager_.get(); } |
| 28 | 30 |
| 29 #if defined(OS_ANDROID) | 31 #if defined(OS_ANDROID) |
| 30 jobject activity() const { return activity_.obj(); } | 32 jobject activity() const { return activity_.obj(); } |
| 31 void set_activity(jobject activity) { activity_.Reset(NULL, activity); } | 33 void set_activity(jobject activity) { activity_.Reset(NULL, activity); } |
| 32 #endif // defined(OS_ANDROID) | 34 #endif // defined(OS_ANDROID) |
| 33 | 35 |
| 34 private: | 36 private: |
| 35 TaskRunners task_runners_; | 37 TaskRunners task_runners_; |
| 36 Storage storage_; | 38 Storage storage_; |
| 37 Loader loader_; | 39 Loader loader_; |
| 38 common::BindingsSupportImpl bindings_support_impl_; | 40 common::BindingsSupportImpl bindings_support_impl_; |
| 41 scoped_ptr<ServiceManager> service_manager_; |
| 39 | 42 |
| 40 #if defined(OS_ANDROID) | 43 #if defined(OS_ANDROID) |
| 41 base::android::ScopedJavaGlobalRef<jobject> activity_; | 44 base::android::ScopedJavaGlobalRef<jobject> activity_; |
| 42 #endif // defined(OS_ANDROID) | 45 #endif // defined(OS_ANDROID) |
| 43 | 46 |
| 44 DISALLOW_COPY_AND_ASSIGN(Context); | 47 DISALLOW_COPY_AND_ASSIGN(Context); |
| 45 }; | 48 }; |
| 46 | 49 |
| 47 } // namespace shell | 50 } // namespace shell |
| 48 } // namespace mojo | 51 } // namespace mojo |
| 49 | 52 |
| 50 #endif // MOJO_SHELL_CONTEXT_H_ | 53 #endif // MOJO_SHELL_CONTEXT_H_ |
| OLD | NEW |