OLD | NEW |
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_VIEW_MANAGER_H_ | 5 #ifndef MOJO_SERVICES_VIEW_MANAGER_PUBLIC_CPP_VIEW_MANAGER_H_ |
6 #define MOJO_SERVICES_PUBLIC_CPP_VIEW_MANAGER_VIEW_MANAGER_H_ | 6 #define MOJO_SERVICES_VIEW_MANAGER_PUBLIC_CPP_VIEW_MANAGER_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
11 #include "mojo/services/public/cpp/view_manager/types.h" | 11 #include "mojo/services/view_manager/public/cpp/types.h" |
12 | 12 |
13 namespace mojo { | 13 namespace mojo { |
14 class View; | 14 class View; |
15 | 15 |
16 // Encapsulates a connection to the view manager service. | 16 // Encapsulates a connection to the view manager service. |
17 // A unique connection is made for every unique embed path for an app. e.g. for | 17 // A unique connection is made for every unique embed path for an app. e.g. for |
18 // app B embed by the following paths: A->B, A->C->B - there are two connections | 18 // app B embed by the following paths: A->B, A->C->B - there are two connections |
19 // and thus two instances of this class. | 19 // and thus two instances of this class. |
20 class ViewManager { | 20 class ViewManager { |
21 public: | 21 public: |
22 // Returns the URL of the application that embedded this application. | 22 // Returns the URL of the application that embedded this application. |
23 virtual const std::string& GetEmbedderURL() const = 0; | 23 virtual const std::string& GetEmbedderURL() const = 0; |
24 | 24 |
25 // Returns all root views known to this connection. | 25 // Returns all root views known to this connection. |
26 virtual const std::vector<View*>& GetRoots() const = 0; | 26 virtual const std::vector<View*>& GetRoots() const = 0; |
27 | 27 |
28 // Returns a View known to this connection. | 28 // Returns a View known to this connection. |
29 virtual View* GetViewById(Id id) = 0; | 29 virtual View* GetViewById(Id id) = 0; |
30 | 30 |
31 protected: | 31 protected: |
32 virtual ~ViewManager() {} | 32 virtual ~ViewManager() {} |
33 }; | 33 }; |
34 | 34 |
35 } // namespace mojo | 35 } // namespace mojo |
36 | 36 |
37 #endif // MOJO_SERVICES_PUBLIC_CPP_VIEW_MANAGER_VIEW_MANAGER_H_ | 37 #endif // MOJO_SERVICES_VIEW_MANAGER_PUBLIC_CPP_VIEW_MANAGER_H_ |
OLD | NEW |