| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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_UI_FULLSCREEN_CONTROLLER_H_ | 5 #ifndef CHROME_BROWSER_UI_FULLSCREEN_CONTROLLER_H_ |
| 6 #define CHROME_BROWSER_UI_FULLSCREEN_CONTROLLER_H_ | 6 #define CHROME_BROWSER_UI_FULLSCREEN_CONTROLLER_H_ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include "base/basictypes.h" | 9 #include "base/basictypes.h" |
| 10 #include "base/memory/ref_counted.h" | 10 #include "base/memory/ref_counted.h" |
| (...skipping 22 matching lines...) Expand all Loading... |
| 33 | 33 |
| 34 // This class implements fullscreen and mouselock behaviour. | 34 // This class implements fullscreen and mouselock behaviour. |
| 35 class FullscreenController : public base::RefCounted<FullscreenController> { | 35 class FullscreenController : public base::RefCounted<FullscreenController> { |
| 36 public: | 36 public: |
| 37 FullscreenController(BrowserWindow* window, | 37 FullscreenController(BrowserWindow* window, |
| 38 Profile* profile, | 38 Profile* profile, |
| 39 Browser* browser); | 39 Browser* browser); |
| 40 virtual ~FullscreenController(); | 40 virtual ~FullscreenController(); |
| 41 | 41 |
| 42 // Querying. | 42 // Querying. |
| 43 bool IsFullscreenForTab() const; | 43 |
| 44 bool IsFullscreenForTab(const content::WebContents* tab) const; | 44 // Returns true if the window is currently fullscreen and was initially |
| 45 // transitioned to fullscreen by a browser (vs tab) mode transition. |
| 46 bool IsFullscreenForBrowser() const; |
| 47 |
| 48 // Returns true if fullscreen has been caused by a tab. |
| 49 // The window may still be transitioning, and window_->IsFullscreen() |
| 50 // may still return false. |
| 51 bool IsFullscreenForTabOrPending() const; |
| 45 bool IsFullscreenForTabOrPending(const content::WebContents* tab) const; | 52 bool IsFullscreenForTabOrPending(const content::WebContents* tab) const; |
| 46 | 53 |
| 54 // Returns true if the mouse has been locked or a lock request is pending |
| 55 // user confirmation. |
| 56 bool IsMouseLockedOrPending() const; |
| 57 |
| 47 // Requests. | 58 // Requests. |
| 48 void RequestToLockMouse(content::WebContents* tab); | 59 void RequestToLockMouse(content::WebContents* tab); |
| 49 void ToggleFullscreenModeForTab(content::WebContents* tab, | 60 void ToggleFullscreenModeForTab(content::WebContents* tab, |
| 50 bool enter_fullscreen); | 61 bool enter_fullscreen); |
| 51 #if defined(OS_MACOSX) | 62 #if defined(OS_MACOSX) |
| 52 void TogglePresentationMode(); | 63 void TogglePresentationMode(); |
| 53 #endif | 64 #endif |
| 54 void ToggleFullscreenMode(); | 65 void ToggleFullscreenMode(); |
| 55 // Extension API implementation uses this method to toggle fullscreen mode. | 66 // Extension API implementation uses this method to toggle fullscreen mode. |
| 56 // The extension's name is displayed in the full screen bubble UI to attribute | 67 // The extension's name is displayed in the full screen bubble UI to attribute |
| (...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 111 // True if tab fullscreen has been allowed, either by settings or by user | 122 // True if tab fullscreen has been allowed, either by settings or by user |
| 112 // clicking the allow button on the fullscreen infobar. | 123 // clicking the allow button on the fullscreen infobar. |
| 113 bool tab_fullscreen_accepted_; | 124 bool tab_fullscreen_accepted_; |
| 114 | 125 |
| 115 MouseLockState mouse_lock_state_; | 126 MouseLockState mouse_lock_state_; |
| 116 | 127 |
| 117 DISALLOW_COPY_AND_ASSIGN(FullscreenController); | 128 DISALLOW_COPY_AND_ASSIGN(FullscreenController); |
| 118 }; | 129 }; |
| 119 | 130 |
| 120 #endif // CHROME_BROWSER_UI_FULLSCREEN_CONTROLLER_H_ | 131 #endif // CHROME_BROWSER_UI_FULLSCREEN_CONTROLLER_H_ |
| OLD | NEW |