| 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 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 85 MOUSELOCK_NOT_REQUESTED, | 85 MOUSELOCK_NOT_REQUESTED, |
| 86 // The page requests to lock the mouse and the user hasn't responded to the | 86 // The page requests to lock the mouse and the user hasn't responded to the |
| 87 // request. | 87 // request. |
| 88 MOUSELOCK_REQUESTED, | 88 MOUSELOCK_REQUESTED, |
| 89 // Mouse lock has been allowed by the user. | 89 // Mouse lock has been allowed by the user. |
| 90 MOUSELOCK_ACCEPTED | 90 MOUSELOCK_ACCEPTED |
| 91 }; | 91 }; |
| 92 | 92 |
| 93 virtual ~FullscreenController(); | 93 virtual ~FullscreenController(); |
| 94 | 94 |
| 95 // Notifies the tab that it has been forced out of fullscreen mode if | 95 // Notifies the tab that it has been forced out of fullscreen and mouse lock |
| 96 // necessary. | 96 // mode if necessary. |
| 97 void NotifyTabOfFullscreenExitIfNecessary(); | 97 void NotifyTabOfExitIfNecessary(); |
| 98 // Make the current tab exit fullscreen mode if it is in it. | 98 |
| 99 void ExitTabbedFullscreenModeIfNecessary(); | 99 // Make the current tab exit fullscreen mode or mouse lock if it is in it. |
| 100 void ExitTabFullscreenOrMouseLockIfNecessary(); |
| 100 void UpdateFullscreenExitBubbleContent(); | 101 void UpdateFullscreenExitBubbleContent(); |
| 101 void NotifyFullscreenChange(); | 102 void NotifyFullscreenChange(); |
| 103 void NotifyMouseLockChange(); |
| 102 ContentSetting GetFullscreenSetting(const GURL& url) const; | 104 ContentSetting GetFullscreenSetting(const GURL& url) const; |
| 103 ContentSetting GetMouseLockSetting(const GURL& url) const; | 105 ContentSetting GetMouseLockSetting(const GURL& url) const; |
| 104 | 106 |
| 105 #if defined(OS_MACOSX) | 107 #if defined(OS_MACOSX) |
| 106 void TogglePresentationModeInternal(bool for_tab); | 108 void TogglePresentationModeInternal(bool for_tab); |
| 107 #endif | 109 #endif |
| 108 // TODO(koz): Change |for_tab| to an enum. | 110 // TODO(koz): Change |for_tab| to an enum. |
| 109 void ToggleFullscreenModeInternal(bool for_tab); | 111 void ToggleFullscreenModeInternal(bool for_tab); |
| 110 | 112 |
| 111 BrowserWindow* window_; | 113 BrowserWindow* window_; |
| 112 Profile* profile_; | 114 Profile* profile_; |
| 113 Browser* browser_; | 115 Browser* browser_; |
| 114 | 116 |
| 115 // If there is currently a tab in fullscreen mode (entered via | 117 // If there is currently a tab in fullscreen mode (entered via |
| 116 // webkitRequestFullScreen), this is its wrapper. | 118 // webkitRequestFullScreen), this is its wrapper. |
| 117 TabContentsWrapper* fullscreened_tab_; | 119 TabContentsWrapper* fullscreened_tab_; |
| 118 | 120 |
| 119 // The URL of the extension which trigerred "browser fullscreen" mode. | 121 // The URL of the extension which trigerred "browser fullscreen" mode. |
| 120 GURL extension_caused_fullscreen_; | 122 GURL extension_caused_fullscreen_; |
| 121 | 123 |
| 122 // True if the current tab entered fullscreen mode via webkitRequestFullScreen | 124 // True if the current tab entered fullscreen mode via webkitRequestFullScreen |
| 123 bool tab_caused_fullscreen_; | 125 bool tab_caused_fullscreen_; |
| 124 // True if tab fullscreen has been allowed, either by settings or by user | 126 // True if tab fullscreen has been allowed, either by settings or by user |
| 125 // clicking the allow button on the fullscreen infobar. | 127 // clicking the allow button on the fullscreen infobar. |
| 126 bool tab_fullscreen_accepted_; | 128 bool tab_fullscreen_accepted_; |
| 127 | 129 |
| 130 // True if this controller has toggled into tab OR browser fullscreen. |
| 131 bool toggled_into_fullscreen_; |
| 132 |
| 133 // Wrapper for current tab requesting or currently in mouse lock. |
| 134 TabContentsWrapper* mouse_lock_tab_; |
| 135 |
| 128 MouseLockState mouse_lock_state_; | 136 MouseLockState mouse_lock_state_; |
| 129 | 137 |
| 130 DISALLOW_COPY_AND_ASSIGN(FullscreenController); | 138 DISALLOW_COPY_AND_ASSIGN(FullscreenController); |
| 131 }; | 139 }; |
| 132 | 140 |
| 133 #endif // CHROME_BROWSER_UI_FULLSCREEN_CONTROLLER_H_ | 141 #endif // CHROME_BROWSER_UI_FULLSCREEN_CONTROLLER_H_ |
| OLD | NEW |