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

Unified Diff: chrome/browser/android/vr_shell/ui_elements/simple_textured_element.h

Issue 2955023002: VR: Factor transient timing out of UiSceneManager. (Closed)
Patch Set: Rebase again onto ExclusivePresentationToast class/file rename. 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/simple_textured_element.h
diff --git a/chrome/browser/android/vr_shell/ui_elements/simple_textured_element.h b/chrome/browser/android/vr_shell/ui_elements/simple_textured_element.h
index 2b42a2e611182e9f3fc35cff1d0742cf02f1e669..d0957e1f1486b2db2522f7c0165af0d084c4ab86 100644
--- a/chrome/browser/android/vr_shell/ui_elements/simple_textured_element.h
+++ b/chrome/browser/android/vr_shell/ui_elements/simple_textured_element.h
@@ -16,6 +16,7 @@
#include "chrome/browser/android/vr_shell/textures/splash_screen_icon_texture.h"
#include "chrome/browser/android/vr_shell/textures/ui_texture.h"
#include "chrome/browser/android/vr_shell/ui_elements/textured_element.h"
+#include "chrome/browser/android/vr_shell/ui_elements/transience_manager.h"
namespace vr_shell {
@@ -39,10 +40,29 @@ class SimpleTexturedElement : public TexturedElement {
DISALLOW_COPY_AND_ASSIGN(SimpleTexturedElement);
};
+template <class T>
+class TransientSimpleTexturedElement : public SimpleTexturedElement<T> {
+ public:
+ TransientSimpleTexturedElement(int maximum_width,
+ const base::TimeDelta& timeout)
+ : SimpleTexturedElement<T>(maximum_width), transience_(this, timeout) {}
+
+ ~TransientSimpleTexturedElement() override {}
+
+ void SetEnabled(bool enabled) override { transience_.SetEnabled(enabled); }
+
+ TransienceManager* transience() { return &transience_; }
+
+ private:
+ TransienceManager transience_;
+
+ DISALLOW_COPY_AND_ASSIGN(TransientSimpleTexturedElement);
+};
+
typedef SimpleTexturedElement<ExitWarningTexture> ExitWarning;
typedef SimpleTexturedElement<InsecureContentPermanentTexture>
PermanentSecurityWarning;
-typedef SimpleTexturedElement<InsecureContentTransientTexture>
+typedef TransientSimpleTexturedElement<InsecureContentTransientTexture>
TransientSecurityWarning;
typedef SimpleTexturedElement<SplashScreenIconTexture> SplashScreenIcon;

Powered by Google App Engine
This is Rietveld 408576698