Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1671)

Unified Diff: chrome/browser/android/vr_shell/ui_elements/presentation_toast.cc

Issue 2955023002: VR: Factor transient timing out of UiSceneManager. (Closed)
Patch Set: Get rid of EndVisibility(). Created 3 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/browser/android/vr_shell/ui_elements/presentation_toast.cc
diff --git a/chrome/browser/android/vr_shell/ui_elements/presentation_toast.cc b/chrome/browser/android/vr_shell/ui_elements/presentation_toast.cc
index a2b4a87b5c02e1f39bc23b158a34a46c1c41323e..097cd7ad18b75f079c1df83524ef05278dd02900 100644
--- a/chrome/browser/android/vr_shell/ui_elements/presentation_toast.cc
+++ b/chrome/browser/android/vr_shell/ui_elements/presentation_toast.cc
@@ -9,9 +9,11 @@
namespace vr_shell {
-PresentationToast::PresentationToast(int preferred_width)
+PresentationToast::PresentationToast(int preferred_width,
+ const base::TimeDelta& timeout)
: TexturedElement(preferred_width),
- texture_(base::MakeUnique<PresentationToastTexture>()) {}
+ texture_(base::MakeUnique<PresentationToastTexture>()),
+ 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!
PresentationToast::~PresentationToast() = default;
@@ -19,4 +21,8 @@ UiTexture* PresentationToast::GetTexture() const {
return texture_.get();
}
+void PresentationToast::SetEnabled(bool enabled) {
+ transience_.SetEnabled(enabled);
+}
+
} // namespace vr_shell

Powered by Google App Engine
This is Rietveld 408576698