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_VIEW_MANAGER_PUBLIC_CPP_LIB_VIEW_PRIVATE_H_ | 5 #ifndef MOJO_SERVICES_VIEW_MANAGER_PUBLIC_CPP_LIB_VIEW_PRIVATE_H_ |
6 #define MOJO_SERVICES_VIEW_MANAGER_PUBLIC_CPP_LIB_VIEW_PRIVATE_H_ | 6 #define MOJO_SERVICES_VIEW_MANAGER_PUBLIC_CPP_LIB_VIEW_PRIVATE_H_ |
7 | 7 |
8 #include "base/basictypes.h" | 8 #include "base/basictypes.h" |
9 | 9 |
10 #include "mojo/services/view_manager/public/cpp/view.h" | 10 #include "view_manager/public/cpp/view.h" |
11 | 11 |
12 namespace mojo { | 12 namespace mojo { |
13 | 13 |
14 // This class is a friend of a View and contains functions to mutate internal | 14 // This class is a friend of a View and contains functions to mutate internal |
15 // state of View. | 15 // state of View. |
16 class ViewPrivate { | 16 class ViewPrivate { |
17 public: | 17 public: |
18 explicit ViewPrivate(View* view); | 18 explicit ViewPrivate(View* view); |
19 ~ViewPrivate(); | 19 ~ViewPrivate(); |
20 | 20 |
(...skipping 11 matching lines...) Expand all Loading... |
32 void set_id(Id id) { view_->id_ = id; } | 32 void set_id(Id id) { view_->id_ = id; } |
33 | 33 |
34 void set_view_manager(ViewManager* manager) { | 34 void set_view_manager(ViewManager* manager) { |
35 view_->manager_ = manager; | 35 view_->manager_ = manager; |
36 } | 36 } |
37 | 37 |
38 void set_properties(const std::map<std::string, std::vector<uint8_t>>& data) { | 38 void set_properties(const std::map<std::string, std::vector<uint8_t>>& data) { |
39 view_->properties_ = data; | 39 view_->properties_ = data; |
40 } | 40 } |
41 | 41 |
| 42 void set_viewport_metrics(ViewportMetricsPtr viewport_metrics) { |
| 43 view_->viewport_metrics_ = viewport_metrics.Pass(); |
| 44 } |
| 45 |
42 void LocalDestroy() { | 46 void LocalDestroy() { |
43 view_->LocalDestroy(); | 47 view_->LocalDestroy(); |
44 } | 48 } |
45 void LocalAddChild(View* child) { | 49 void LocalAddChild(View* child) { |
46 view_->LocalAddChild(child); | 50 view_->LocalAddChild(child); |
47 } | 51 } |
48 void LocalRemoveChild(View* child) { | 52 void LocalRemoveChild(View* child) { |
49 view_->LocalRemoveChild(child); | 53 view_->LocalRemoveChild(child); |
50 } | 54 } |
51 void LocalReorder(View* relative, OrderDirection direction) { | 55 void LocalReorder(View* relative, OrderDirection direction) { |
52 view_->LocalReorder(relative, direction); | 56 view_->LocalReorder(relative, direction); |
53 } | 57 } |
54 void LocalSetBounds(const Rect& old_bounds, | 58 void LocalSetBounds(const Rect& old_bounds, |
55 const Rect& new_bounds) { | 59 const Rect& new_bounds) { |
56 view_->LocalSetBounds(old_bounds, new_bounds); | 60 view_->LocalSetBounds(old_bounds, new_bounds); |
57 } | 61 } |
58 void LocalSetDrawn(bool drawn) { view_->LocalSetDrawn(drawn); } | 62 void LocalSetDrawn(bool drawn) { view_->LocalSetDrawn(drawn); } |
59 | 63 |
60 private: | 64 private: |
61 View* view_; | 65 View* view_; |
62 | 66 |
63 DISALLOW_COPY_AND_ASSIGN(ViewPrivate); | 67 DISALLOW_COPY_AND_ASSIGN(ViewPrivate); |
64 }; | 68 }; |
65 | 69 |
66 } // namespace mojo | 70 } // namespace mojo |
67 | 71 |
68 #endif // MOJO_SERVICES_VIEW_MANAGER_PUBLIC_CPP_LIB_VIEW_PRIVATE_H_ | 72 #endif // MOJO_SERVICES_VIEW_MANAGER_PUBLIC_CPP_LIB_VIEW_PRIVATE_H_ |
OLD | NEW |