cygprofile: increase timeouts to allow showing web contents
[chromium-blink-merge.git] / components / view_manager / public / cpp / lib / view_private.h
bloba95296f0ce569f3c8c2cd55a2843e31922a9c248
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_LIB_VIEW_PRIVATE_H_
6 #define COMPONENTS_VIEW_MANAGER_PUBLIC_CPP_LIB_VIEW_PRIVATE_H_
8 #include "components/view_manager/public/cpp/view.h"
10 namespace mojo {
12 // This class is a friend of a View and contains functions to mutate internal
13 // state of View.
14 class ViewPrivate {
15 public:
16 explicit ViewPrivate(View* view);
17 ~ViewPrivate();
19 // Creates and returns a new View. Caller owns the return value.
20 static View* LocalCreate();
22 base::ObserverList<ViewObserver>* observers() { return &view_->observers_; }
24 void ClearParent() { view_->parent_ = NULL; }
26 void set_visible(bool visible) { view_->visible_ = visible; }
28 void set_drawn(bool drawn) { view_->drawn_ = drawn; }
30 void set_id(Id id) { view_->id_ = id; }
32 void set_connection(ViewTreeConnection* connection) {
33 view_->connection_ = connection;
36 void set_properties(const std::map<std::string, std::vector<uint8_t>>& data) {
37 view_->properties_ = data;
40 void LocalSetViewportMetrics(const ViewportMetrics& old_metrics,
41 const ViewportMetrics& new_metrics) {
42 view_->LocalSetViewportMetrics(new_metrics, new_metrics);
45 void LocalDestroy() {
46 view_->LocalDestroy();
48 void LocalAddChild(View* child) {
49 view_->LocalAddChild(child);
51 void LocalRemoveChild(View* child) {
52 view_->LocalRemoveChild(child);
54 void LocalReorder(View* relative, OrderDirection direction) {
55 view_->LocalReorder(relative, direction);
57 void LocalSetBounds(const Rect& old_bounds,
58 const Rect& new_bounds) {
59 view_->LocalSetBounds(old_bounds, new_bounds);
61 void LocalSetDrawn(bool drawn) { view_->LocalSetDrawn(drawn); }
62 void LocalSetVisible(bool visible) { view_->LocalSetVisible(visible); }
64 private:
65 View* view_;
67 MOJO_DISALLOW_COPY_AND_ASSIGN(ViewPrivate);
70 } // namespace mojo
72 #endif // COMPONENTS_VIEW_MANAGER_PUBLIC_CPP_LIB_VIEW_PRIVATE_H_