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