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