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_SPINNING_CUBE_SPINNING_CUBE_VIEW_H_ | 5 #ifndef EXAMPLES_UI_SPINNING_CUBE_SPINNING_CUBE_VIEW_H_ |
6 #define EXAMPLES_UI_SPINNING_CUBE_SPINNING_CUBE_VIEW_H_ | 6 #define EXAMPLES_UI_SPINNING_CUBE_SPINNING_CUBE_VIEW_H_ |
7 | 7 |
8 #include <memory> | 8 #include <memory> |
9 | 9 |
10 #include "examples/spinning_cube/spinning_cube.h" | 10 #include "examples/spinning_cube/spinning_cube.h" |
11 #include "mojo/ui/choreographer.h" | 11 #include "mojo/ui/choreographer.h" |
12 #include "mojo/ui/gl_view.h" | 12 #include "mojo/ui/gl_view.h" |
13 #include "mojo/ui/input_handler.h" | 13 #include "mojo/ui/input_handler.h" |
14 | 14 |
15 namespace examples { | 15 namespace examples { |
16 | 16 |
17 class SpinningCubeView : public mojo::ui::GLView, | 17 class SpinningCubeView : public mojo::ui::GLView, |
18 public mojo::ui::ChoreographerDelegate, | 18 public mojo::ui::ChoreographerDelegate, |
19 public mojo::ui::InputListener { | 19 public mojo::ui::InputListener { |
20 public: | 20 public: |
21 SpinningCubeView( | 21 SpinningCubeView( |
22 mojo::ApplicationImpl* app_impl, | 22 mojo::ApplicationImpl* app_impl, |
23 const mojo::ui::ViewProvider::CreateViewCallback& create_view_callback); | 23 mojo::InterfaceRequest<mojo::ui::ViewOwner> view_owner_request); |
24 | 24 |
25 ~SpinningCubeView() override; | 25 ~SpinningCubeView() override; |
26 | 26 |
27 private: | 27 private: |
28 // |GLView|: | 28 // |GLView|: |
29 void OnLayout(mojo::ui::ViewLayoutParamsPtr layout_params, | 29 void OnLayout(mojo::ui::ViewLayoutParamsPtr layout_params, |
30 mojo::Array<uint32_t> children_needing_layout, | 30 mojo::Array<uint32_t> children_needing_layout, |
31 const OnLayoutCallback& callback) override; | 31 const OnLayoutCallback& callback) override; |
32 | 32 |
33 // |ChoreographerDelegate|: | 33 // |ChoreographerDelegate|: |
(...skipping 17 matching lines...) Expand all Loading... |
51 MojoTimeTicks drag_start_time_ = 0u; | 51 MojoTimeTicks drag_start_time_ = 0u; |
52 | 52 |
53 base::WeakPtrFactory<SpinningCubeView> weak_ptr_factory_; | 53 base::WeakPtrFactory<SpinningCubeView> weak_ptr_factory_; |
54 | 54 |
55 DISALLOW_COPY_AND_ASSIGN(SpinningCubeView); | 55 DISALLOW_COPY_AND_ASSIGN(SpinningCubeView); |
56 }; | 56 }; |
57 | 57 |
58 } // namespace examples | 58 } // namespace examples |
59 | 59 |
60 #endif // EXAMPLES_UI_SPINNING_CUBE_SPINNING_CUBE_VIEW_H_ | 60 #endif // EXAMPLES_UI_SPINNING_CUBE_SPINNING_CUBE_VIEW_H_ |
OLD | NEW |