| 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" |
| 11 #include "chrome/browser/ui/fullscreen_exit_bubble_type.h" | 11 #include "chrome/browser/ui/fullscreen_exit_bubble_type.h" |
| 12 #include "chrome/common/content_settings.h" | 12 #include "chrome/common/content_settings.h" |
| 13 | 13 |
| 14 class Browser; | 14 class Browser; |
| 15 class BrowserWindow; | 15 class BrowserWindow; |
| 16 class Extension; |
| 16 class GURL; | 17 class GURL; |
| 17 class Profile; | 18 class Profile; |
| 18 class TabContents; | 19 class TabContents; |
| 19 class TabContentsWrapper; | 20 class TabContentsWrapper; |
| 20 | 21 |
| 21 namespace content { | 22 namespace content { |
| 22 class WebContents; | 23 class WebContents; |
| 23 } | 24 } |
| 24 | 25 |
| 25 // There are two different kinds of fullscreen mode - "tab fullscreen" and | 26 // There are two different kinds of fullscreen mode - "tab fullscreen" and |
| (...skipping 17 matching lines...) Expand all Loading... |
| 43 // Querying. | 44 // Querying. |
| 44 bool IsFullscreenForTab() const; | 45 bool IsFullscreenForTab() const; |
| 45 bool IsFullscreenForTab(const content::WebContents* tab) const; | 46 bool IsFullscreenForTab(const content::WebContents* tab) const; |
| 46 bool IsFullscreenForTabOrPending(const content::WebContents* tab) const; | 47 bool IsFullscreenForTabOrPending(const content::WebContents* tab) const; |
| 47 | 48 |
| 48 // Requests. | 49 // Requests. |
| 49 void RequestToLockMouse(content::WebContents* tab); | 50 void RequestToLockMouse(content::WebContents* tab); |
| 50 void ToggleFullscreenModeForTab(content::WebContents* tab, | 51 void ToggleFullscreenModeForTab(content::WebContents* tab, |
| 51 bool enter_fullscreen); | 52 bool enter_fullscreen); |
| 52 #if defined(OS_MACOSX) | 53 #if defined(OS_MACOSX) |
| 53 void TogglePresentationMode(bool for_tab); | 54 void TogglePresentationMode(); |
| 54 #endif | 55 #endif |
| 55 // TODO(koz): Change |for_tab| to an enum. | 56 void ToggleFullscreenMode(); |
| 56 void ToggleFullscreenMode(bool for_tab); | 57 void ToggleFullscreenModeWithExtension(const Extension& extension); |
| 57 | 58 |
| 58 // Notifications. | 59 // Notifications. |
| 59 void LostMouseLock(); | 60 void LostMouseLock(); |
| 60 void OnTabClosing(content::WebContents* web_contents); | 61 void OnTabClosing(content::WebContents* web_contents); |
| 61 void OnTabDeactivated(TabContentsWrapper* contents); | 62 void OnTabDeactivated(TabContentsWrapper* contents); |
| 62 void OnAcceptFullscreenPermission(const GURL& url, | 63 void OnAcceptFullscreenPermission(const GURL& url, |
| 63 FullscreenExitBubbleType bubble_type); | 64 FullscreenExitBubbleType bubble_type); |
| 64 void OnDenyFullscreenPermission(FullscreenExitBubbleType bubble_type); | 65 void OnDenyFullscreenPermission(FullscreenExitBubbleType bubble_type); |
| 65 void WindowFullscreenStateChanged(); | 66 void WindowFullscreenStateChanged(); |
| 66 bool HandleUserPressedEscape(); | 67 bool HandleUserPressedEscape(); |
| (...skipping 13 matching lines...) Expand all Loading... |
| 80 // Notifies the tab that it has been forced out of fullscreen mode if | 81 // Notifies the tab that it has been forced out of fullscreen mode if |
| 81 // necessary. | 82 // necessary. |
| 82 void NotifyTabOfFullscreenExitIfNecessary(); | 83 void NotifyTabOfFullscreenExitIfNecessary(); |
| 83 // Make the current tab exit fullscreen mode if it is in it. | 84 // Make the current tab exit fullscreen mode if it is in it. |
| 84 void ExitTabbedFullscreenModeIfNecessary(); | 85 void ExitTabbedFullscreenModeIfNecessary(); |
| 85 void UpdateFullscreenExitBubbleContent(); | 86 void UpdateFullscreenExitBubbleContent(); |
| 86 void NotifyFullscreenChange(); | 87 void NotifyFullscreenChange(); |
| 87 ContentSetting GetFullscreenSetting(const GURL& url) const; | 88 ContentSetting GetFullscreenSetting(const GURL& url) const; |
| 88 ContentSetting GetMouseLockSetting(const GURL& url) const; | 89 ContentSetting GetMouseLockSetting(const GURL& url) const; |
| 89 | 90 |
| 91 #if defined(OS_MACOSX) |
| 92 void TogglePresentationModeInternal(bool for_tab); |
| 93 #endif |
| 94 // TODO(koz): Change |for_tab| to an enum. |
| 95 void ToggleFullscreenModeInternal(bool for_tab, const Extension* extension); |
| 96 |
| 90 BrowserWindow* window_; | 97 BrowserWindow* window_; |
| 91 Profile* profile_; | 98 Profile* profile_; |
| 92 Browser* browser_; | 99 Browser* browser_; |
| 93 | 100 |
| 94 // If there is currently a tab in fullscreen mode (entered via | 101 // If there is currently a tab in fullscreen mode (entered via |
| 95 // webkitRequestFullScreen), this is its wrapper. | 102 // webkitRequestFullScreen), this is its wrapper. |
| 96 TabContentsWrapper* fullscreened_tab_; | 103 TabContentsWrapper* fullscreened_tab_; |
| 97 | 104 |
| 98 // True if the current tab entered fullscreen mode via webkitRequestFullScreen | 105 // True if the current tab entered fullscreen mode via webkitRequestFullScreen |
| 99 bool tab_caused_fullscreen_; | 106 bool tab_caused_fullscreen_; |
| 100 // True if tab fullscreen has been allowed, either by settings or by user | 107 // True if tab fullscreen has been allowed, either by settings or by user |
| 101 // clicking the allow button on the fullscreen infobar. | 108 // clicking the allow button on the fullscreen infobar. |
| 102 bool tab_fullscreen_accepted_; | 109 bool tab_fullscreen_accepted_; |
| 103 | 110 |
| 104 MouseLockState mouse_lock_state_; | 111 MouseLockState mouse_lock_state_; |
| 105 | 112 |
| 106 DISALLOW_COPY_AND_ASSIGN(FullscreenController); | 113 DISALLOW_COPY_AND_ASSIGN(FullscreenController); |
| 107 }; | 114 }; |
| 108 | 115 |
| 109 #endif // CHROME_BROWSER_UI_FULLSCREEN_CONTROLLER_H_ | 116 #endif // CHROME_BROWSER_UI_FULLSCREEN_CONTROLLER_H_ |
| OLD | NEW |