Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(314)

Side by Side Diff: chrome/browser/ui/fullscreen_controller.h

Issue 9353010: Add FullscreenController::ToggleFullscreenModeWithExtension (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix method defenition ordering, add comment Created 8 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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
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 // Extension API implementation uses this method to toggle fullscreen mode.
58 void ToggleFullscreenModeWithExtension(const Extension& extension);
57 59
58 // Notifications. 60 // Notifications.
59 void LostMouseLock(); 61 void LostMouseLock();
60 void OnTabClosing(content::WebContents* web_contents); 62 void OnTabClosing(content::WebContents* web_contents);
61 void OnTabDeactivated(TabContentsWrapper* contents); 63 void OnTabDeactivated(TabContentsWrapper* contents);
62 void OnAcceptFullscreenPermission(const GURL& url, 64 void OnAcceptFullscreenPermission(const GURL& url,
63 FullscreenExitBubbleType bubble_type); 65 FullscreenExitBubbleType bubble_type);
64 void OnDenyFullscreenPermission(FullscreenExitBubbleType bubble_type); 66 void OnDenyFullscreenPermission(FullscreenExitBubbleType bubble_type);
65 void WindowFullscreenStateChanged(); 67 void WindowFullscreenStateChanged();
66 bool HandleUserPressedEscape(); 68 bool HandleUserPressedEscape();
(...skipping 13 matching lines...) Expand all
80 // Notifies the tab that it has been forced out of fullscreen mode if 82 // Notifies the tab that it has been forced out of fullscreen mode if
81 // necessary. 83 // necessary.
82 void NotifyTabOfFullscreenExitIfNecessary(); 84 void NotifyTabOfFullscreenExitIfNecessary();
83 // Make the current tab exit fullscreen mode if it is in it. 85 // Make the current tab exit fullscreen mode if it is in it.
84 void ExitTabbedFullscreenModeIfNecessary(); 86 void ExitTabbedFullscreenModeIfNecessary();
85 void UpdateFullscreenExitBubbleContent(); 87 void UpdateFullscreenExitBubbleContent();
86 void NotifyFullscreenChange(); 88 void NotifyFullscreenChange();
87 ContentSetting GetFullscreenSetting(const GURL& url) const; 89 ContentSetting GetFullscreenSetting(const GURL& url) const;
88 ContentSetting GetMouseLockSetting(const GURL& url) const; 90 ContentSetting GetMouseLockSetting(const GURL& url) const;
89 91
92 #if defined(OS_MACOSX)
93 void TogglePresentationModeInternal(bool for_tab);
94 #endif
95 // TODO(koz): Change |for_tab| to an enum.
96 void ToggleFullscreenModeInternal(bool for_tab);
97
90 BrowserWindow* window_; 98 BrowserWindow* window_;
91 Profile* profile_; 99 Profile* profile_;
92 Browser* browser_; 100 Browser* browser_;
93 101
94 // If there is currently a tab in fullscreen mode (entered via 102 // If there is currently a tab in fullscreen mode (entered via
95 // webkitRequestFullScreen), this is its wrapper. 103 // webkitRequestFullScreen), this is its wrapper.
96 TabContentsWrapper* fullscreened_tab_; 104 TabContentsWrapper* fullscreened_tab_;
97 105
106 // The extension which trigerred "browser fullscreen" mode.
107 const Extension* extension_caused_fullscreen_;
108
98 // True if the current tab entered fullscreen mode via webkitRequestFullScreen 109 // True if the current tab entered fullscreen mode via webkitRequestFullScreen
99 bool tab_caused_fullscreen_; 110 bool tab_caused_fullscreen_;
100 // True if tab fullscreen has been allowed, either by settings or by user 111 // True if tab fullscreen has been allowed, either by settings or by user
101 // clicking the allow button on the fullscreen infobar. 112 // clicking the allow button on the fullscreen infobar.
102 bool tab_fullscreen_accepted_; 113 bool tab_fullscreen_accepted_;
103 114
104 MouseLockState mouse_lock_state_; 115 MouseLockState mouse_lock_state_;
105 116
106 DISALLOW_COPY_AND_ASSIGN(FullscreenController); 117 DISALLOW_COPY_AND_ASSIGN(FullscreenController);
107 }; 118 };
108 119
109 #endif // CHROME_BROWSER_UI_FULLSCREEN_CONTROLLER_H_ 120 #endif // CHROME_BROWSER_UI_FULLSCREEN_CONTROLLER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698