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

Side by Side Diff: mojo/services/public/cpp/view_manager/node.h

Issue 433513005: Pass ServiceProvider thru ViewManagerService::Embed() allowing embedder & embeddee to expose servic… (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 6 years, 4 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
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 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 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 #ifndef MOJO_SERVICES_PUBLIC_CPP_VIEW_MANAGER_NODE_H_ 5 #ifndef MOJO_SERVICES_PUBLIC_CPP_VIEW_MANAGER_NODE_H_
6 #define MOJO_SERVICES_PUBLIC_CPP_VIEW_MANAGER_NODE_H_ 6 #define MOJO_SERVICES_PUBLIC_CPP_VIEW_MANAGER_NODE_H_
7 7
8 #include <vector> 8 #include <vector>
9 9
10 #include "base/basictypes.h" 10 #include "base/basictypes.h"
11 #include "base/observer_list.h" 11 #include "base/observer_list.h"
12 #include "mojo/public/cpp/bindings/array.h" 12 #include "mojo/public/cpp/bindings/array.h"
13 #include "mojo/public/interfaces/application/service_provider.mojom.h"
13 #include "mojo/services/public/cpp/view_manager/types.h" 14 #include "mojo/services/public/cpp/view_manager/types.h"
14 #include "mojo/services/public/interfaces/view_manager/view_manager_constants.mo jom.h" 15 #include "mojo/services/public/interfaces/view_manager/view_manager_constants.mo jom.h"
15 #include "ui/gfx/geometry/rect.h" 16 #include "ui/gfx/geometry/rect.h"
16 17
17 namespace mojo { 18 namespace mojo {
18 19
20 class ServiceProviderImpl;
19 class View; 21 class View;
20 class ViewManager; 22 class ViewManager;
21 class NodeObserver; 23 class NodeObserver;
22 24
23 // Nodes are owned by the ViewManager. 25 // Nodes are owned by the ViewManager.
24 // TODO(beng): Right now, you'll have to implement a NodeObserver to track 26 // TODO(beng): Right now, you'll have to implement a NodeObserver to track
25 // destruction and NULL any pointers you have. 27 // destruction and NULL any pointers you have.
26 // Investigate some kind of smart pointer or weak pointer for these. 28 // Investigate some kind of smart pointer or weak pointer for these.
27 class Node { 29 class Node {
28 public: 30 public:
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
66 68
67 // View. 69 // View.
68 void SetActiveView(View* view); 70 void SetActiveView(View* view);
69 View* active_view() { return active_view_; } 71 View* active_view() { return active_view_; }
70 72
71 // Focus. 73 // Focus.
72 void SetFocus(); 74 void SetFocus();
73 75
74 // Embedding. 76 // Embedding.
75 void Embed(const String& url); 77 void Embed(const String& url);
78 scoped_ptr<ServiceProvider> Embed(
79 const String& url,
80 scoped_ptr<ServiceProviderImpl> exported_services);
76 81
77 protected: 82 protected:
78 // This class is subclassed only by test classes that provide a public ctor. 83 // This class is subclassed only by test classes that provide a public ctor.
79 Node(); 84 Node();
80 ~Node(); 85 ~Node();
81 86
82 private: 87 private:
83 friend class NodePrivate; 88 friend class NodePrivate;
84 friend class ViewManagerClientImpl; 89 friend class ViewManagerClientImpl;
85 90
(...skipping 16 matching lines...) Expand all
102 107
103 gfx::Rect bounds_; 108 gfx::Rect bounds_;
104 View* active_view_; 109 View* active_view_;
105 110
106 DISALLOW_COPY_AND_ASSIGN(Node); 111 DISALLOW_COPY_AND_ASSIGN(Node);
107 }; 112 };
108 113
109 } // namespace mojo 114 } // namespace mojo
110 115
111 #endif // MOJO_SERVICES_PUBLIC_CPP_VIEW_MANAGER_NODE_H_ 116 #endif // MOJO_SERVICES_PUBLIC_CPP_VIEW_MANAGER_NODE_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698