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.
5 #ifndef MOJO_SHELL_CONTEXT_H_
6 #define MOJO_SHELL_CONTEXT_H_
10 #include "mojo/service_manager/service_manager.h"
11 #include "mojo/shell/keep_alive.h"
12 #include "mojo/shell/mojo_url_resolver.h"
13 #include "mojo/shell/task_runners.h"
15 #if defined(OS_ANDROID)
16 #include "base/android/scoped_java_ref.h"
17 #endif // defined(OS_ANDROID)
25 class DynamicServiceLoader
;
27 // The "global" context for the shell's main process.
33 TaskRunners
* task_runners() { return &task_runners_
; }
34 ServiceManager
* service_manager() { return &service_manager_
; }
35 KeepAliveCounter
* keep_alive_counter() { return &keep_alive_counter_
; }
36 MojoURLResolver
* mojo_url_resolver() { return &mojo_url_resolver_
; }
38 #if defined(OS_ANDROID)
39 jobject
activity() const { return activity_
.obj(); }
40 void set_activity(jobject activity
) { activity_
.Reset(NULL
, activity
); }
41 #endif // defined(OS_ANDROID)
44 class NativeViewportServiceLoader
;
46 TaskRunners task_runners_
;
47 ServiceManager service_manager_
;
48 MojoURLResolver mojo_url_resolver_
;
50 #if defined(OS_ANDROID)
51 base::android::ScopedJavaGlobalRef
<jobject
> activity_
;
52 #endif // defined(OS_ANDROID)
54 KeepAliveCounter keep_alive_counter_
;
56 DISALLOW_COPY_AND_ASSIGN(Context
);
62 #endif // MOJO_SHELL_CONTEXT_H_