cygprofile: increase timeouts to allow showing web contents
[chromium-blink-merge.git] / components / view_manager / public / cpp / view_tree_connection.h
blob5e01111446db6bbbf4d924a7d414703d260dc95d
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.
5 #ifndef COMPONENTS_VIEW_MANAGER_PUBLIC_CPP_VIEW_TREE_CONNECTION_H_
6 #define COMPONENTS_VIEW_MANAGER_PUBLIC_CPP_VIEW_TREE_CONNECTION_H_
8 #include <string>
10 #include "components/view_manager/public/cpp/types.h"
11 #include "components/view_manager/public/interfaces/view_tree.mojom.h"
12 #include "third_party/mojo/src/mojo/public/cpp/bindings/interface_request.h"
14 namespace mojo {
15 class View;
16 class ViewTreeDelegate;
18 // Encapsulates a connection to a view tree. A unique connection is made
19 // every time an app is embedded.
20 class ViewTreeConnection {
21 public:
22 virtual ~ViewTreeConnection() {}
24 // The returned ViewTreeConnection instance owns itself, and is deleted when
25 // the last root is destroyed or the connection to the service is broken.
26 static ViewTreeConnection* Create(
27 ViewTreeDelegate* delegate,
28 InterfaceRequest<ViewTreeClient> request);
30 // Returns the root of this connection.
31 virtual View* GetRoot() = 0;
33 // Returns a View known to this connection.
34 virtual View* GetViewById(Id id) = 0;
36 // Returns the focused view; null if focus is not yet known or another app is
37 // focused.
38 virtual View* GetFocusedView() = 0;
40 // Creates and returns a new View (which is owned by the ViewManager). Views
41 // are initially hidden, use SetVisible(true) to show.
42 virtual View* CreateView() = 0;
44 // Returns true if ACCESS_POLICY_EMBED_ROOT was specified.
45 virtual bool IsEmbedRoot() = 0;
48 } // namespace mojo
50 #endif // COMPONENTS_VIEW_MANAGER_PUBLIC_CPP_VIEW_TREE_CONNECTION_H_