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