| 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 EXAMPLES_UI_TILE_TILE_VIEW_H_ | 5 #ifndef EXAMPLES_UI_TILE_TILE_VIEW_H_ |
| 6 #define EXAMPLES_UI_TILE_TILE_VIEW_H_ | 6 #define EXAMPLES_UI_TILE_TILE_VIEW_H_ |
| 7 | 7 |
| 8 #include <map> | 8 #include <map> |
| 9 #include <memory> | 9 #include <memory> |
| 10 | 10 |
| (...skipping 14 matching lines...) Expand all Loading... |
| 25 struct ViewData { | 25 struct ViewData { |
| 26 explicit ViewData(const std::string& url, uint32_t key); | 26 explicit ViewData(const std::string& url, uint32_t key); |
| 27 ~ViewData(); | 27 ~ViewData(); |
| 28 | 28 |
| 29 const std::string url; | 29 const std::string url; |
| 30 const uint32_t key; | 30 const uint32_t key; |
| 31 | 31 |
| 32 bool layout_pending; | 32 bool layout_pending; |
| 33 mojo::ui::ViewLayoutParamsPtr layout_params; | 33 mojo::ui::ViewLayoutParamsPtr layout_params; |
| 34 mojo::ui::ViewLayoutInfoPtr layout_info; | 34 mojo::ui::ViewLayoutInfoPtr layout_info; |
| 35 mojo::Rect layout_bounds; | 35 mojo::RectF layout_bounds; |
| 36 }; | 36 }; |
| 37 | 37 |
| 38 // |BaseView|: | 38 // |BaseView|: |
| 39 void OnLayout(mojo::ui::ViewLayoutParamsPtr layout_params, | 39 void OnLayout(mojo::ui::ViewLayoutParamsPtr layout_params, |
| 40 mojo::Array<uint32_t> children_needing_layout, | 40 mojo::Array<uint32_t> children_needing_layout, |
| 41 const OnLayoutCallback& callback) override; | 41 const OnLayoutCallback& callback) override; |
| 42 void OnChildUnavailable(uint32_t child_key, | 42 void OnChildUnavailable(uint32_t child_key, |
| 43 const OnChildUnavailableCallback& callback) override; | 43 const OnChildUnavailableCallback& callback) override; |
| 44 | 44 |
| 45 void ConnectViews(); | 45 void ConnectViews(); |
| 46 void OnChildLayoutFinished(uint32_t child_key, | 46 void OnChildLayoutFinished(uint32_t child_key, |
| 47 mojo::ui::ViewLayoutInfoPtr child_layout_info); | 47 mojo::ui::ViewLayoutInfoPtr child_layout_info); |
| 48 void FinishLayout(); | 48 void FinishLayout(); |
| 49 | 49 |
| 50 void OnFrameSubmitted(); | 50 void OnFrameSubmitted(); |
| 51 | 51 |
| 52 std::vector<std::string> view_urls_; | 52 std::vector<std::string> view_urls_; |
| 53 std::map<uint32_t, std::unique_ptr<ViewData>> views_; | 53 std::map<uint32_t, std::unique_ptr<ViewData>> views_; |
| 54 | 54 |
| 55 mojo::Size size_; | 55 mojo::Size size_; |
| 56 OnLayoutCallback pending_layout_callback_; | 56 OnLayoutCallback pending_layout_callback_; |
| 57 uint32_t pending_child_layout_count_ = 0u; | 57 uint32_t pending_child_layout_count_ = 0u; |
| 58 | 58 |
| 59 DISALLOW_COPY_AND_ASSIGN(TileView); | 59 DISALLOW_COPY_AND_ASSIGN(TileView); |
| 60 }; | 60 }; |
| 61 | 61 |
| 62 } // namespace examples | 62 } // namespace examples |
| 63 | 63 |
| 64 #endif // EXAMPLES_UI_TILE_TILE_VIEW_H_ | 64 #endif // EXAMPLES_UI_TILE_TILE_VIEW_H_ |
| OLD | NEW |