| 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_GFX_COMPOSITOR_SCENE_STATE_H_ | 5 #ifndef SERVICES_GFX_COMPOSITOR_SCENE_STATE_H_ |
| 6 #define SERVICES_GFX_COMPOSITOR_SCENE_STATE_H_ | 6 #define SERVICES_GFX_COMPOSITOR_SCENE_STATE_H_ |
| 7 | 7 |
| 8 #include <memory> | 8 #include <memory> |
| 9 #include <string> | 9 #include <string> |
| 10 #include <unordered_map> | 10 #include <unordered_map> |
| (...skipping 16 matching lines...) Expand all Loading... |
| 27 class SceneState { | 27 class SceneState { |
| 28 public: | 28 public: |
| 29 SceneState(mojo::gfx::composition::SceneTokenPtr scene_token, | 29 SceneState(mojo::gfx::composition::SceneTokenPtr scene_token, |
| 30 const std::string& label); | 30 const std::string& label); |
| 31 ~SceneState(); | 31 ~SceneState(); |
| 32 | 32 |
| 33 base::WeakPtr<SceneState> GetWeakPtr() { return weak_factory_.GetWeakPtr(); } | 33 base::WeakPtr<SceneState> GetWeakPtr() { return weak_factory_.GetWeakPtr(); } |
| 34 | 34 |
| 35 // Gets the token used to refer to this scene globally. | 35 // Gets the token used to refer to this scene globally. |
| 36 // Caller does not obtain ownership of the token. | 36 // Caller does not obtain ownership of the token. |
| 37 const mojo::gfx::composition::SceneToken* scene_token() { | 37 const mojo::gfx::composition::SceneToken& scene_token() { |
| 38 return scene_token_.get(); | 38 return *scene_token_; |
| 39 } | 39 } |
| 40 | 40 |
| 41 // Gets or sets the scene listener interface. | 41 // Gets or sets the scene listener interface. |
| 42 mojo::gfx::composition::SceneListener* scene_listener() { | 42 mojo::gfx::composition::SceneListener* scene_listener() { |
| 43 return scene_listener_.get(); | 43 return scene_listener_.get(); |
| 44 } | 44 } |
| 45 void set_scene_listener(mojo::gfx::composition::SceneListenerPtr listener) { | 45 void set_scene_listener(mojo::gfx::composition::SceneListenerPtr listener) { |
| 46 scene_listener_ = listener.Pass(); | 46 scene_listener_ = listener.Pass(); |
| 47 } | 47 } |
| 48 | 48 |
| (...skipping 20 matching lines...) Expand all Loading... |
| 69 base::WeakPtrFactory<SceneState> weak_factory_; | 69 base::WeakPtrFactory<SceneState> weak_factory_; |
| 70 | 70 |
| 71 DISALLOW_COPY_AND_ASSIGN(SceneState); | 71 DISALLOW_COPY_AND_ASSIGN(SceneState); |
| 72 }; | 72 }; |
| 73 | 73 |
| 74 std::ostream& operator<<(std::ostream& os, SceneState* scene_state); | 74 std::ostream& operator<<(std::ostream& os, SceneState* scene_state); |
| 75 | 75 |
| 76 } // namespace compositor | 76 } // namespace compositor |
| 77 | 77 |
| 78 #endif // SERVICES_GFX_COMPOSITOR_SCENE_STATE_H_ | 78 #endif // SERVICES_GFX_COMPOSITOR_SCENE_STATE_H_ |
| OLD | NEW |