| 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_SHAPES_SHAPES_VIEW_H_ | 5 #ifndef EXAMPLES_UI_SHAPES_SHAPES_VIEW_H_ |
| 6 #define EXAMPLES_UI_SHAPES_SHAPES_VIEW_H_ | 6 #define EXAMPLES_UI_SHAPES_SHAPES_VIEW_H_ |
| 7 | 7 |
| 8 #include "mojo/ui/ganesh_view.h" | 8 #include "mojo/ui/ganesh_view.h" |
| 9 | 9 |
| 10 class SkCanvas; | 10 class SkCanvas; |
| 11 | 11 |
| 12 namespace examples { | 12 namespace examples { |
| 13 | 13 |
| 14 class ShapesView : public mojo::ui::GaneshView { | 14 class ShapesView : public mojo::ui::GaneshView { |
| 15 public: | 15 public: |
| 16 ShapesView( | 16 ShapesView(mojo::ApplicationImpl* app_impl, |
| 17 mojo::ApplicationImpl* app_impl, | 17 mojo::InterfaceRequest<mojo::ui::ViewOwner> view_owner_request); |
| 18 const mojo::ui::ViewProvider::CreateViewCallback& create_view_callback); | |
| 19 | 18 |
| 20 ~ShapesView() override; | 19 ~ShapesView() override; |
| 21 | 20 |
| 22 private: | 21 private: |
| 23 // |GaneshView|: | 22 // |GaneshView|: |
| 24 void OnLayout(mojo::ui::ViewLayoutParamsPtr layout_params, | 23 void OnLayout(mojo::ui::ViewLayoutParamsPtr layout_params, |
| 25 mojo::Array<uint32_t> children_needing_layout, | 24 mojo::Array<uint32_t> children_needing_layout, |
| 26 const OnLayoutCallback& callback) override; | 25 const OnLayoutCallback& callback) override; |
| 27 | 26 |
| 28 void UpdateScene(); | 27 void UpdateScene(); |
| 29 void DrawContent(SkCanvas* canvas); | 28 void DrawContent(SkCanvas* canvas); |
| 30 | 29 |
| 31 mojo::Size size_; | 30 mojo::Size size_; |
| 32 | 31 |
| 33 DISALLOW_COPY_AND_ASSIGN(ShapesView); | 32 DISALLOW_COPY_AND_ASSIGN(ShapesView); |
| 34 }; | 33 }; |
| 35 | 34 |
| 36 } // namespace examples | 35 } // namespace examples |
| 37 | 36 |
| 38 #endif // EXAMPLES_UI_SHAPES_SHAPES_VIEW_H_ | 37 #endif // EXAMPLES_UI_SHAPES_SHAPES_VIEW_H_ |
| OLD | NEW |