Chromium Code Reviews| 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_VR_TAB_HELPER_H_ | |
| 6 #define CHROME_BROWSER_ANDROID_VR_SHELL_VR_TAB_HELPER_H_ | |
| 7 | |
| 8 #include "base/macros.h" | |
| 9 #include "content/public/browser/web_contents_observer.h" | |
| 10 #include "content/public/browser/web_contents_user_data.h" | |
| 11 | |
| 12 namespace vr_shell { | |
| 13 | |
| 14 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
| |
| 15 public content::WebContentsUserData<VrTabHelper> { | |
| 16 public: | |
| 17 ~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
| |
| 18 | |
| 19 bool is_in_vr() const { return is_in_vr_; } | |
| 20 | |
| 21 // Called by VrShell when we enter and exit vr mode. It finds us by looking us | |
| 22 // up on the WebContents. Eventually, we will also set a number of flags here | |
| 23 // as we enter and exit vr mode (see TODO below). | |
| 24 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.
| |
| 25 | |
| 26 private: | |
| 27 friend class content::WebContentsUserData<VrTabHelper>; | |
| 28 | |
| 29 explicit VrTabHelper(content::WebContents* contents); | |
| 30 | |
| 31 // TODO(asimjour): once we have per-dialog flags for disabling specific | |
| 32 // content-related popups, we should hang onto a pointer to the web contents | |
| 33 // and set those flags as we enter and exit vr mode. | |
| 34 bool is_in_vr_ = false; | |
| 35 | |
| 36 DISALLOW_COPY_AND_ASSIGN(VrTabHelper); | |
| 37 }; | |
| 38 | |
| 39 } // namespace vr_shell | |
| 40 | |
| 41 #endif // CHROME_BROWSER_ANDROID_VR_SHELL_VR_TAB_HELPER_H_ | |
| OLD | NEW |