| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef CHROME_BROWSER_ANDROID_VR_SHELL_VR_WEB_CONTENTS_OBSERVER_H_ | 5 #ifndef CHROME_BROWSER_ANDROID_VR_SHELL_VR_WEB_CONTENTS_OBSERVER_H_ |
| 6 #define CHROME_BROWSER_ANDROID_VR_SHELL_VR_WEB_CONTENTS_OBSERVER_H_ | 6 #define CHROME_BROWSER_ANDROID_VR_SHELL_VR_WEB_CONTENTS_OBSERVER_H_ |
| 7 | 7 |
| 8 #include "base/macros.h" | 8 #include "base/macros.h" |
| 9 #include "content/public/browser/web_contents_observer.h" | 9 #include "content/public/browser/web_contents_observer.h" |
| 10 | 10 |
| 11 namespace content { | 11 namespace content { |
| 12 class NavigationHandle; | 12 class NavigationHandle; |
| 13 } | 13 } |
| 14 | 14 |
| 15 namespace vr_shell { | 15 namespace vr_shell { |
| 16 | 16 |
| 17 class UiInterface; | 17 class UiInterface; |
| 18 class VrShell; | 18 class VrShell; |
| 19 class ToolbarHelper; |
| 19 | 20 |
| 20 class CONTENT_EXPORT VrWebContentsObserver | 21 class CONTENT_EXPORT VrWebContentsObserver |
| 21 : public content::WebContentsObserver { | 22 : public content::WebContentsObserver { |
| 22 public: | 23 public: |
| 23 VrWebContentsObserver(content::WebContents* web_contents, | 24 VrWebContentsObserver(content::WebContents* web_contents, |
| 25 VrShell* vr_shell, |
| 24 UiInterface* ui_interface, | 26 UiInterface* ui_interface, |
| 25 VrShell* vr_shell); | 27 ToolbarHelper* toolbar); |
| 26 ~VrWebContentsObserver() override; | 28 ~VrWebContentsObserver() override; |
| 27 | 29 |
| 28 void SetUiInterface(UiInterface* ui_interface); | 30 void SetUiInterface(UiInterface* ui_interface); |
| 29 | 31 |
| 30 private: | 32 private: |
| 31 // WebContentsObserver implementation. | 33 // WebContentsObserver implementation. |
| 32 void DidStartLoading() override; | 34 void DidStartLoading() override; |
| 33 void DidStopLoading() override; | 35 void DidStopLoading() override; |
| 34 void DidStartNavigation( | 36 void DidStartNavigation( |
| 35 content::NavigationHandle* navigation_handle) override; | 37 content::NavigationHandle* navigation_handle) override; |
| 36 void DidRedirectNavigation( | 38 void DidRedirectNavigation( |
| 37 content::NavigationHandle* navigation_handle) override; | 39 content::NavigationHandle* navigation_handle) override; |
| 38 void DidFinishNavigation( | 40 void DidFinishNavigation( |
| 39 content::NavigationHandle* navigation_handle) override; | 41 content::NavigationHandle* navigation_handle) override; |
| 40 void DidToggleFullscreenModeForTab(bool entered_fullscreen, | 42 void DidToggleFullscreenModeForTab(bool entered_fullscreen, |
| 41 bool will_cause_resize) override; | 43 bool will_cause_resize) override; |
| 42 void DidChangeVisibleSecurityState() override; | 44 void DidChangeVisibleSecurityState() override; |
| 43 void WebContentsDestroyed() override; | 45 void WebContentsDestroyed() override; |
| 44 void WasHidden() override; | 46 void WasHidden() override; |
| 45 void WasShown() override; | 47 void WasShown() override; |
| 46 void MainFrameWasResized(bool width_changed) override; | 48 void MainFrameWasResized(bool width_changed) override; |
| 47 void RenderViewHostChanged(content::RenderViewHost* old_host, | 49 void RenderViewHostChanged(content::RenderViewHost* old_host, |
| 48 content::RenderViewHost* new_host) override; | 50 content::RenderViewHost* new_host) override; |
| 49 | 51 |
| 50 // This class does not own the UI interface. | 52 // This class does not own these pointers. |
| 53 VrShell* vr_shell_; |
| 51 UiInterface* ui_interface_; | 54 UiInterface* ui_interface_; |
| 52 VrShell* vr_shell_; | 55 ToolbarHelper* toolbar_; |
| 53 | 56 |
| 54 DISALLOW_COPY_AND_ASSIGN(VrWebContentsObserver); | 57 DISALLOW_COPY_AND_ASSIGN(VrWebContentsObserver); |
| 55 }; | 58 }; |
| 56 | 59 |
| 57 } // namespace vr_shell | 60 } // namespace vr_shell |
| 58 | 61 |
| 59 #endif // CHROME_BROWSER_ANDROID_VR_SHELL_VR_WEB_CONTENTS_OBSERVER_H_ | 62 #endif // CHROME_BROWSER_ANDROID_VR_SHELL_VR_WEB_CONTENTS_OBSERVER_H_ |
| OLD | NEW |