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

Side by Side Diff: mojo/services/view_manager/public/cpp/lib/view_manager_context.cc

Issue 861683003: Move services code brought in from Mojo to live under //third_party. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase Created 5 years, 10 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
OLDNEW
(Empty)
1 // Copyright 2014 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 #include "view_manager/public/cpp/view_manager_context.h"
6
7 #include "mojo/public/cpp/application/application_impl.h"
8 #include "mojo/public/cpp/bindings/interface_request.h"
9 #include "window_manager/public/interfaces/window_manager.mojom.h"
10
11 namespace mojo {
12 class ApplicationImpl;
13
14 class ViewManagerContext::InternalState {
15 public:
16 explicit InternalState(ApplicationImpl* application_impl) {
17 application_impl->ConnectToService("mojo:window_manager", &wm_);
18 }
19 ~InternalState() {}
20
21 WindowManager* wm() { return wm_.get(); }
22
23 private:
24 WindowManagerPtr wm_;
25
26 MOJO_DISALLOW_COPY_AND_ASSIGN(InternalState);
27 };
28
29 ViewManagerContext::ViewManagerContext(ApplicationImpl* application_impl)
30 : state_(new InternalState(application_impl)) {}
31 ViewManagerContext::~ViewManagerContext() {}
32
33 void ViewManagerContext::Embed(const String& url) {
34 Embed(url, nullptr, nullptr);
35 }
36
37 void ViewManagerContext::Embed(const String& url,
38 InterfaceRequest<ServiceProvider> services,
39 ServiceProviderPtr exposed_services) {
40 state_->wm()->Embed(url, services.Pass(), exposed_services.Pass());
41 }
42
43 } // namespace mojo
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698