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

Side by Side Diff: chrome/browser/android/vr_shell/ui_elements/transience_manager.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
(Empty)
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
3 // found in the LICENSE file.
4
5 #include "chrome/browser/android/vr_shell/ui_elements/transience_manager.h"
6
7 namespace vr_shell {
8
9 void TransienceManager::SetEnabled(bool enabled) {
10 if (enabled_ == enabled)
11 return;
12 enabled_ = enabled;
13 if (!enabled) {
14 element_->set_visible(false);
15 visibility_timer_.Stop();
16 return;
bshe 2017/06/27 14:57:09 no need to return
cjgrant 2017/06/28 19:00:55 Done.
17 }
18 }
19
20 void TransienceManager::KickVisibility() {
21 if (enabled_) {
22 element_->set_visible(true);
23 StartTimer();
24 }
25 }
26
27 void TransienceManager::StartTimer() {
28 visibility_timer_.Start(
29 FROM_HERE, timeout_,
30 base::Bind(&TransienceManager::OnTimeout, base::Unretained(this)));
31 }
32
33 void TransienceManager::OnTimeout() {
34 element_->set_visible(false);
35 }
36
37 } // namespace vr_shell
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698