Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(19)

Side by Side Diff: mojo/shell/context.cc

Issue 404913002: Break dependency of native_viewport_service on mojo::shell::Context (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Cleanup Created 6 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« mojo/shell/context.h ('K') | « mojo/shell/context.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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/context.h" 5 #include "mojo/shell/context.h"
6 6
7 #include "build/build_config.h" 7 #include "build/build_config.h"
8 #include "base/command_line.h" 8 #include "base/command_line.h"
9 #include "base/lazy_instance.h" 9 #include "base/lazy_instance.h"
10 #include "base/memory/scoped_vector.h" 10 #include "base/memory/scoped_vector.h"
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after
65 65
66 class Context::NativeViewportServiceLoader : public ServiceLoader { 66 class Context::NativeViewportServiceLoader : public ServiceLoader {
67 public: 67 public:
68 explicit NativeViewportServiceLoader(Context* context) : context_(context) {} 68 explicit NativeViewportServiceLoader(Context* context) : context_(context) {}
69 virtual ~NativeViewportServiceLoader() {} 69 virtual ~NativeViewportServiceLoader() {}
70 70
71 private: 71 private:
72 virtual void LoadService(ServiceManager* manager, 72 virtual void LoadService(ServiceManager* manager,
73 const GURL& url, 73 const GURL& url,
74 ScopedMessagePipeHandle shell_handle) OVERRIDE { 74 ScopedMessagePipeHandle shell_handle) OVERRIDE {
75 app_.reset(::CreateNativeViewportService(context_, shell_handle.Pass())); 75 app_.reset(services::CreateNativeViewportService(
76 context_, shell_handle.Pass()));
76 } 77 }
77 78
78 virtual void OnServiceError(ServiceManager* manager, 79 virtual void OnServiceError(ServiceManager* manager,
79 const GURL& url) OVERRIDE { 80 const GURL& url) OVERRIDE {
80 } 81 }
81 82
82 Context* context_; 83 Context* context_;
83 scoped_ptr<ApplicationImpl> app_; 84 scoped_ptr<ApplicationImpl> app_;
84 DISALLOW_COPY_AND_ASSIGN(NativeViewportServiceLoader); 85 DISALLOW_COPY_AND_ASSIGN(NativeViewportServiceLoader);
85 }; 86 };
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after
156 // that there aren't shutdown ordering issues. Once native viewport service is 157 // that there aren't shutdown ordering issues. Once native viewport service is
157 // moved into its own process this can likely be nuked. 158 // moved into its own process this can likely be nuked.
158 #if defined(USE_AURA) 159 #if defined(USE_AURA)
159 service_manager_.SetLoaderForURL( 160 service_manager_.SetLoaderForURL(
160 scoped_ptr<ServiceLoader>(), 161 scoped_ptr<ServiceLoader>(),
161 GURL("mojo:mojo_view_manager")); 162 GURL("mojo:mojo_view_manager"));
162 #endif 163 #endif
163 service_manager_.set_default_loader(scoped_ptr<ServiceLoader>()); 164 service_manager_.set_default_loader(scoped_ptr<ServiceLoader>());
164 } 165 }
165 166
167 #if defined(OS_ANDROID)
168 jobject Context::GetActivity() { return activity_.obj(); }
169 #endif // defined(OS_ANDROID)
170
166 } // namespace shell 171 } // namespace shell
167 } // namespace mojo 172 } // namespace mojo
OLDNEW
« mojo/shell/context.h ('K') | « mojo/shell/context.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698