| OLD | NEW |
| (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 #ifndef CHROME_BROWSER_ANDROID_VR_SHELL_UI_ELEMENTS_TRANSIENCE_MANAGER_H_ |
| 6 #define CHROME_BROWSER_ANDROID_VR_SHELL_UI_ELEMENTS_TRANSIENCE_MANAGER_H_ |
| 7 |
| 8 #include <memory> |
| 9 |
| 10 #include "base/macros.h" |
| 11 #include "base/timer/timer.h" |
| 12 #include "chrome/browser/android/vr_shell/ui_elements/ui_element.h" |
| 13 |
| 14 namespace vr_shell { |
| 15 |
| 16 class TransienceManager { |
| 17 public: |
| 18 TransienceManager(UiElement* element, const base::TimeDelta& timeout); |
| 19 virtual ~TransienceManager() = default; |
| 20 |
| 21 void SetEnabled(bool enabled); |
| 22 void KickVisibilityIfEnabled(); |
| 23 void EndVisibilityIfEnabled(); |
| 24 |
| 25 private: |
| 26 void StartTimer(); |
| 27 void OnTimeout(); |
| 28 |
| 29 UiElement* element_; |
| 30 base::TimeDelta timeout_; |
| 31 bool enabled_ = false; |
| 32 base::OneShotTimer visibility_timer_; |
| 33 }; |
| 34 |
| 35 } // namespace vr_shell |
| 36 |
| 37 #endif // CHROME_BROWSER_ANDROID_VR_SHELL_UI_ELEMENTS_TRANSIENCE_MANAGER_H_ |
| OLD | NEW |