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

Unified Diff: chrome/browser/android/vr_shell/vr_tab_helper.h

Issue 2874623004: [vr] Introduce VrTabHelper (Closed)
Patch Set: . Created 3 years, 7 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/vr_tab_helper.h
diff --git a/chrome/browser/android/vr_shell/vr_tab_helper.h b/chrome/browser/android/vr_shell/vr_tab_helper.h
new file mode 100644
index 0000000000000000000000000000000000000000..93ea9d63ea2c84193ec8531241eb869796956b67
--- /dev/null
+++ b/chrome/browser/android/vr_shell/vr_tab_helper.h
@@ -0,0 +1,41 @@
+// Copyright 2017 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef CHROME_BROWSER_ANDROID_VR_SHELL_VR_TAB_HELPER_H_
+#define CHROME_BROWSER_ANDROID_VR_SHELL_VR_TAB_HELPER_H_
+
+#include "base/macros.h"
+#include "content/public/browser/web_contents_observer.h"
+#include "content/public/browser/web_contents_user_data.h"
+
+namespace vr_shell {
+
+class VrTabHelper : public content::WebContentsObserver,
Ted C 2017/05/11 18:32:23 why a WebContentsObserver? Why being a user data
Ian Vollick 2017/05/11 19:30:10 It's true, I don't need to be a WebContentsObserve
+ public content::WebContentsUserData<VrTabHelper> {
+ public:
+ ~VrTabHelper() override;
Ted C 2017/05/11 18:32:23 I suspect it might also be nice to have a simple s
Ian Vollick 2017/05/11 19:30:10 Actually, we were hoping to do this slightly diffe
Ted C 2017/05/11 20:25:36 Hmm...from our other meeting, I didn't think that
+
+ bool is_in_vr() const { return is_in_vr_; }
+
+ // Called by VrShell when we enter and exit vr mode. It finds us by looking us
+ // up on the WebContents. Eventually, we will also set a number of flags here
+ // as we enter and exit vr mode (see TODO below).
+ void set_is_in_vr(bool is_in_vr) { is_in_vr_ = is_in_vr; }
Ted C 2017/05/11 18:32:22 since we expect this to do more in the not distanc
Ian Vollick 2017/05/11 19:30:10 Done.
+
+ private:
+ friend class content::WebContentsUserData<VrTabHelper>;
+
+ explicit VrTabHelper(content::WebContents* contents);
+
+ // TODO(asimjour): once we have per-dialog flags for disabling specific
+ // content-related popups, we should hang onto a pointer to the web contents
+ // and set those flags as we enter and exit vr mode.
+ bool is_in_vr_ = false;
+
+ DISALLOW_COPY_AND_ASSIGN(VrTabHelper);
+};
+
+} // namespace vr_shell
+
+#endif // CHROME_BROWSER_ANDROID_VR_SHELL_VR_TAB_HELPER_H_

Powered by Google App Engine
This is Rietveld 408576698