| OLD | NEW |
| 1 // Copyright 2017 The Chromium Authors. All rights reserved. | 1 // Copyright 2017 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 CHROME_BROWSER_ANDROID_VR_SHELL_UI_ELEMENTS_PRESENTATION_TOAST_H_ | 5 #ifndef CHROME_BROWSER_ANDROID_VR_SHELL_UI_ELEMENTS_PRESENTATION_TOAST_H_ |
| 6 #define CHROME_BROWSER_ANDROID_VR_SHELL_UI_ELEMENTS_PRESENTATION_TOAST_H_ | 6 #define CHROME_BROWSER_ANDROID_VR_SHELL_UI_ELEMENTS_PRESENTATION_TOAST_H_ |
| 7 | 7 |
| 8 #include <memory> | 8 #include <memory> |
| 9 | 9 |
| 10 #include "base/macros.h" | 10 #include "base/macros.h" |
| 11 #include "chrome/browser/android/vr_shell/ui_elements/textured_element.h" | 11 #include "chrome/browser/android/vr_shell/ui_elements/textured_element.h" |
| 12 #include "chrome/browser/android/vr_shell/ui_elements/transience_manager.h" |
| 12 | 13 |
| 13 namespace vr_shell { | 14 namespace vr_shell { |
| 14 | 15 |
| 15 class UiTexture; | 16 class UiTexture; |
| 16 | 17 |
| 17 // TODO(bshe): A lot code duplication with exit_warning_texture and | 18 // TODO(bshe): A lot code duplication with exit_warning_texture and |
| 18 // insecure_content_transient_texture. Consider refactor(see crbug.com/735166). | 19 // insecure_content_transient_texture. Consider refactor(see crbug.com/735166). |
| 19 class PresentationToast : public TexturedElement { | 20 class PresentationToast : public TexturedElement { |
| 20 public: | 21 public: |
| 21 explicit PresentationToast(int preferred_width); | 22 PresentationToast(int preferred_width, const base::TimeDelta& timeout); |
| 22 ~PresentationToast() override; | 23 ~PresentationToast() override; |
| 24 TransienceManager* transience() { return &transience_; } |
| 25 |
| 26 // This element manages its own visibility. |
| 27 void SetEnabled(bool enabled) override; |
| 23 | 28 |
| 24 private: | 29 private: |
| 25 UiTexture* GetTexture() const override; | 30 UiTexture* GetTexture() const override; |
| 26 | 31 |
| 27 std::unique_ptr<UiTexture> texture_; | 32 std::unique_ptr<UiTexture> texture_; |
| 33 TransienceManager transience_; |
| 28 | 34 |
| 29 DISALLOW_COPY_AND_ASSIGN(PresentationToast); | 35 DISALLOW_COPY_AND_ASSIGN(PresentationToast); |
| 30 }; | 36 }; |
| 31 | 37 |
| 32 } // namespace vr_shell | 38 } // namespace vr_shell |
| 33 | 39 |
| 34 #endif // CHROME_BROWSER_ANDROID_VR_SHELL_UI_ELEMENTS_PRESENTATION_TOAST_H_ | 40 #endif // CHROME_BROWSER_ANDROID_VR_SHELL_UI_ELEMENTS_PRESENTATION_TOAST_H_ |
| OLD | NEW |