Chromium Code Reviews| 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 #include "chrome/browser/android/vr_shell/ui_elements/presentation_toast.h" | 5 #include "chrome/browser/android/vr_shell/ui_elements/presentation_toast.h" |
| 6 | 6 |
| 7 #include "base/memory/ptr_util.h" | 7 #include "base/memory/ptr_util.h" |
| 8 #include "chrome/browser/android/vr_shell/textures/presentation_toast_texture.h" | 8 #include "chrome/browser/android/vr_shell/textures/presentation_toast_texture.h" |
| 9 | 9 |
| 10 namespace vr_shell { | 10 namespace vr_shell { |
| 11 | 11 |
| 12 PresentationToast::PresentationToast(int preferred_width) | 12 PresentationToast::PresentationToast(int preferred_width, |
| 13 const base::TimeDelta& timeout) | |
| 13 : TexturedElement(preferred_width), | 14 : TexturedElement(preferred_width), |
| 14 texture_(base::MakeUnique<PresentationToastTexture>()) {} | 15 texture_(base::MakeUnique<PresentationToastTexture>()), |
| 16 transience_(this, base::TimeDelta::FromSeconds(10)) {} | |
|
bshe
2017/06/27 14:57:09
Use |timeout| instead?
cjgrant
2017/06/28 19:00:54
Done. Oops!
| |
| 15 | 17 |
| 16 PresentationToast::~PresentationToast() = default; | 18 PresentationToast::~PresentationToast() = default; |
| 17 | 19 |
| 18 UiTexture* PresentationToast::GetTexture() const { | 20 UiTexture* PresentationToast::GetTexture() const { |
| 19 return texture_.get(); | 21 return texture_.get(); |
| 20 } | 22 } |
| 21 | 23 |
| 24 void PresentationToast::SetEnabled(bool enabled) { | |
| 25 transience_.SetEnabled(enabled); | |
| 26 } | |
| 27 | |
| 22 } // namespace vr_shell | 28 } // namespace vr_shell |
| OLD | NEW |