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 #include "mojo/shell/android/mojo_main.h" | 5 #include "mojo/shell/android/mojo_main.h" |
6 | 6 |
7 #include "base/android/jni_string.h" | 7 #include "base/android/jni_string.h" |
8 #include "base/at_exit.h" | 8 #include "base/at_exit.h" |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
(...skipping 22 matching lines...) Expand all Loading... |
33 LazyInstance<scoped_ptr<shell::Context> > g_context = | 33 LazyInstance<scoped_ptr<shell::Context> > g_context = |
34 LAZY_INSTANCE_INITIALIZER; | 34 LAZY_INSTANCE_INITIALIZER; |
35 | 35 |
36 class NativeViewportServiceLoader : public shell::ServiceManager::Loader { | 36 class NativeViewportServiceLoader : public shell::ServiceManager::Loader { |
37 public: | 37 public: |
38 NativeViewportServiceLoader() {} | 38 NativeViewportServiceLoader() {} |
39 virtual ~NativeViewportServiceLoader() {} | 39 virtual ~NativeViewportServiceLoader() {} |
40 | 40 |
41 private: | 41 private: |
42 virtual void Load(const GURL& url, | 42 virtual void Load(const GURL& url, |
43 shell::ServiceManager* manager, | |
44 ScopedMessagePipeHandle service_handle) | 43 ScopedMessagePipeHandle service_handle) |
45 MOJO_OVERRIDE { | 44 MOJO_OVERRIDE { |
46 service_.reset(CreateNativeViewportService(service_handle.Pass())); | 45 service_.reset(CreateNativeViewportService(service_handle.Pass())); |
47 service_->set_context(g_context.Get().get()); | 46 service_->set_context(g_context.Get().get()); |
48 } | 47 } |
49 scoped_ptr<services::NativeViewportService> service_; | 48 scoped_ptr<services::NativeViewportService> service_; |
50 }; | 49 }; |
51 | 50 |
52 LazyInstance<scoped_ptr<NativeViewportServiceLoader> > | 51 LazyInstance<scoped_ptr<NativeViewportServiceLoader> > |
53 g_viewport_service_loader = LAZY_INSTANCE_INITIALIZER; | 52 g_viewport_service_loader = LAZY_INSTANCE_INITIALIZER; |
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
97 | 96 |
98 g_context.Get().reset(shell_context); | 97 g_context.Get().reset(shell_context); |
99 shell::Run(shell_context); | 98 shell::Run(shell_context); |
100 } | 99 } |
101 | 100 |
102 bool RegisterMojoMain(JNIEnv* env) { | 101 bool RegisterMojoMain(JNIEnv* env) { |
103 return RegisterNativesImpl(env); | 102 return RegisterNativesImpl(env); |
104 } | 103 } |
105 | 104 |
106 } // namespace mojo | 105 } // namespace mojo |
OLD | NEW |