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

Side by Side 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, 5 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 unified diff | Download patch
OLDNEW
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
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698