| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 SERVICES_UI_VIEW_MANAGER_VIEW_TREE_STATE_H_ | 5 #ifndef SERVICES_UI_VIEW_MANAGER_VIEW_TREE_STATE_H_ |
| 6 #define SERVICES_UI_VIEW_MANAGER_VIEW_TREE_STATE_H_ | 6 #define SERVICES_UI_VIEW_MANAGER_VIEW_TREE_STATE_H_ |
| 7 | 7 |
| 8 #include <memory> | 8 #include <memory> |
| 9 #include <set> | 9 #include <set> |
| 10 #include <string> | 10 #include <string> |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 43 mojo::ui::ViewTreeToken* view_tree_token() const { | 43 mojo::ui::ViewTreeToken* view_tree_token() const { |
| 44 return view_tree_token_.get(); | 44 return view_tree_token_.get(); |
| 45 } | 45 } |
| 46 | 46 |
| 47 // Gets the view tree listener interface, never null. | 47 // Gets the view tree listener interface, never null. |
| 48 // Caller does not obtain ownership of the view tree listener. | 48 // Caller does not obtain ownership of the view tree listener. |
| 49 mojo::ui::ViewTreeListener* view_tree_listener() const { | 49 mojo::ui::ViewTreeListener* view_tree_listener() const { |
| 50 return view_tree_listener_.get(); | 50 return view_tree_listener_.get(); |
| 51 } | 51 } |
| 52 | 52 |
| 53 // The view tree's renderer. |
| 54 mojo::gfx::composition::Renderer* renderer() const { return renderer_.get(); } |
| 55 void set_renderer(mojo::gfx::composition::RendererPtr renderer) { |
| 56 renderer_ = renderer.Pass(); |
| 57 } |
| 58 |
| 53 // Gets the root of the view tree, or null if there is no root. | 59 // Gets the root of the view tree, or null if there is no root. |
| 54 ViewStub* root() const { return root_.get(); } | 60 ViewStub* root() const { return root_.get(); } |
| 55 | 61 |
| 56 // Links the root of the view tree. | 62 // Links the root of the view tree. |
| 57 void LinkRoot(uint32_t key, std::unique_ptr<ViewStub> root); | 63 void LinkRoot(uint32_t key, std::unique_ptr<ViewStub> root); |
| 58 | 64 |
| 59 // Unlinks the root of the view tree and returns it. | 65 // Unlinks the root of the view tree and returns it. |
| 60 std::unique_ptr<ViewStub> UnlinkRoot(); | 66 std::unique_ptr<ViewStub> UnlinkRoot(); |
| 61 | 67 |
| 62 // True if there is a pending layout request. | 68 // True if there is a pending layout request. |
| (...skipping 12 matching lines...) Expand all Loading... |
| 75 private: | 81 private: |
| 76 mojo::ui::ViewTreeTokenPtr view_tree_token_; | 82 mojo::ui::ViewTreeTokenPtr view_tree_token_; |
| 77 mojo::ui::ViewTreeListenerPtr view_tree_listener_; | 83 mojo::ui::ViewTreeListenerPtr view_tree_listener_; |
| 78 | 84 |
| 79 const std::string label_; | 85 const std::string label_; |
| 80 mutable std::string formatted_label_cache_; | 86 mutable std::string formatted_label_cache_; |
| 81 | 87 |
| 82 std::unique_ptr<ViewTreeImpl> impl_; | 88 std::unique_ptr<ViewTreeImpl> impl_; |
| 83 mojo::Binding<mojo::ui::ViewTree> view_tree_binding_; | 89 mojo::Binding<mojo::ui::ViewTree> view_tree_binding_; |
| 84 | 90 |
| 91 mojo::gfx::composition::RendererPtr renderer_; |
| 92 |
| 85 std::unique_ptr<ViewStub> root_; | 93 std::unique_ptr<ViewStub> root_; |
| 86 bool layout_request_pending_ = false; | 94 bool layout_request_pending_ = false; |
| 87 bool layout_request_issued_ = false; | 95 bool layout_request_issued_ = false; |
| 88 | 96 |
| 89 base::WeakPtrFactory<ViewTreeState> weak_factory_; // must be last | 97 base::WeakPtrFactory<ViewTreeState> weak_factory_; // must be last |
| 90 | 98 |
| 91 DISALLOW_COPY_AND_ASSIGN(ViewTreeState); | 99 DISALLOW_COPY_AND_ASSIGN(ViewTreeState); |
| 92 }; | 100 }; |
| 93 | 101 |
| 94 std::ostream& operator<<(std::ostream& os, ViewTreeState* view_tree_state); | 102 std::ostream& operator<<(std::ostream& os, ViewTreeState* view_tree_state); |
| 95 | 103 |
| 96 } // namespace view_manager | 104 } // namespace view_manager |
| 97 | 105 |
| 98 #endif // SERVICES_UI_VIEW_MANAGER_VIEW_TREE_STATE_H_ | 106 #endif // SERVICES_UI_VIEW_MANAGER_VIEW_TREE_STATE_H_ |
| OLD | NEW |