[SyncFS] Build indexes from FileTracker entries on disk.
[chromium-blink-merge.git] / mojo / shell / context.h
blobc643cd933171b2da2a3ce01798257794c2750eda
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_
8 #include <string>
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)
19 namespace mojo {
21 class Spy;
23 namespace shell {
25 class DynamicServiceLoader;
27 // The "global" context for the shell's main process.
28 class Context {
29 public:
30 Context();
31 ~Context();
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)
43 private:
44 class NativeViewportServiceLoader;
46 TaskRunners task_runners_;
47 ServiceManager service_manager_;
48 MojoURLResolver mojo_url_resolver_;
49 scoped_ptr<Spy> spy_;
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);
59 } // namespace shell
60 } // namespace mojo
62 #endif // MOJO_SHELL_CONTEXT_H_