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