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 #ifndef MOJO_SERVICES_PUBLIC_CPP_VIEW_MANAGER_VIEW_MANAGER_H_ 6 #define MOJO_SERVICES_PUBLIC_CPP_VIEW_MANAGER_VIEW_MANAGER_H_ 7 8 #include <string> 9 #include <vector> 10 11 #include "mojo/services/public/cpp/view_manager/types.h" 12 13 namespace mojo { 14 class Application; 15 namespace view_manager { 16 17 class Node; 18 class View; 19 class ViewManagerDelegate; 20 21 class ViewManager { 22 public: 23 // Delegate is owned by the caller. 24 static void Create(Application* application, ViewManagerDelegate* delegate); 25 26 // Returns the URL of the application that embedded this application. 27 virtual const std::string& GetEmbedderURL() const = 0; 28 29 // Returns all root nodes known to this connection. 30 virtual const std::vector<Node*>& GetRoots() const = 0; 31 32 // Returns a Node or View known to this connection. 33 virtual Node* GetNodeById(Id id) = 0; 34 virtual View* GetViewById(Id id) = 0; 35 36 protected: 37 virtual ~ViewManager() {} 38 39 }; 40 41 } // namespace view_manager 42 } // namespace mojo 43 44 #endif // MOJO_SERVICES_PUBLIC_CPP_VIEW_MANAGER_VIEW_MANAGER_H_ 45