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

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

Issue 795593004: Update mojo sdk to rev cc531b32182099a5a034a99daff35ed5d38a61c8 (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: More workarounds for MSVC Created 5 years, 11 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
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_VIEW_MANAGER_PUBLIC_CPP_VIEW_MANAGER_DELEGATE_H_ 5 #ifndef MOJO_SERVICES_VIEW_MANAGER_PUBLIC_CPP_VIEW_MANAGER_DELEGATE_H_
6 #define MOJO_SERVICES_VIEW_MANAGER_PUBLIC_CPP_VIEW_MANAGER_DELEGATE_H_ 6 #define MOJO_SERVICES_VIEW_MANAGER_PUBLIC_CPP_VIEW_MANAGER_DELEGATE_H_
7 7
8 #include "base/memory/scoped_ptr.h" 8 #include "base/memory/scoped_ptr.h"
9 #include "mojo/public/interfaces/application/service_provider.mojom.h" 9 #include "mojo/public/interfaces/application/service_provider.mojom.h"
10 10
11 namespace mojo { 11 namespace mojo {
12 12
13 class ServiceProviderImpl; 13 class ServiceProviderImpl;
14 class View; 14 class View;
15 class ViewManager; 15 class ViewManager;
16 16
17 // Interface implemented by an application using the view manager. 17 // Interface implemented by an application using the view manager.
18 class ViewManagerDelegate { 18 class ViewManagerDelegate {
19 public: 19 public:
20 // Called when the application implementing this interface is embedded at 20 // Called when the application implementing this interface is embedded at
21 // |root|. |view_manager| is an implementation of an object bound to a 21 // |root|. Every embed results in a new ViewManager and root View being
22 // connection to the view manager service. The object is valid until 22 // created. |root| and it's corresponding ViewManager are valid until
23 // OnViewManagerDisconnected() is called with the same object. 23 // OnViewManagerDisconnected() is called with the same object.
24 // This function is called for every embed, but there will be a unique 24 //
25 // instance of |view_manager| only for every unique connection. See
26 // the class description of ViewManager for some rules about when a new
27 // connection is made.
28 // |exported_services| is an object that the delegate can add services to 25 // |exported_services| is an object that the delegate can add services to
29 // expose to the embedder. |imported_services| exposes the services offered by 26 // expose to the embedder. |imported_services| exposes the services offered by
30 // the embedder to the delegate. Note that if a different application is 27 // the embedder to the delegate. Note that if a different application is
31 // subsequently embedded at |root|, the pipe(s) connecting |imported_services| 28 // subsequently embedded at |root|, the pipe(s) connecting |imported_services|
32 // to the embedder and any services obtained from it are not broken and will 29 // to the embedder and any services obtained from it are not broken and will
33 // continue to be valid. 30 // continue to be valid.
34 virtual void OnEmbed(ViewManager* view_manager, 31 virtual void OnEmbed(View* root,
35 View* root,
36 ServiceProviderImpl* exported_services, 32 ServiceProviderImpl* exported_services,
37 scoped_ptr<ServiceProvider> imported_services) = 0; 33 scoped_ptr<ServiceProvider> imported_services) = 0;
38 34
39 // Called when a connection to the view manager service is closed. 35 // Called when a connection to the view manager service is closed.
40 // |view_manager| is not valid after this function returns. 36 // |view_manager| is not valid after this function returns.
41 virtual void OnViewManagerDisconnected(ViewManager* view_manager) = 0; 37 virtual void OnViewManagerDisconnected(ViewManager* view_manager) = 0;
42 38
43 protected: 39 protected:
44 virtual ~ViewManagerDelegate() {} 40 virtual ~ViewManagerDelegate() {}
45 }; 41 };
46 42
47 } // namespace mojo 43 } // namespace mojo
48 44
49 #endif // MOJO_SERVICES_VIEW_MANAGER_PUBLIC_CPP_VIEW_MANAGER_DELEGATE_H_ 45 #endif // MOJO_SERVICES_VIEW_MANAGER_PUBLIC_CPP_VIEW_MANAGER_DELEGATE_H_
OLDNEW
« no previous file with comments | « mojo/services/view_manager/public/cpp/view_manager.h ('k') | mojo/services/view_manager/public/cpp/view_observer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698