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

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: Show "An extension triggered full screen." when the extension's name is not available. 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 // The extension's name is displayed in the full screen bubble UI to attribute
59 // the cause of the full screen state change.
60 void ToggleFullscreenModeWithExtension(const Extension& extension);
57 61
58 // Notifications. 62 // Notifications.
59 void LostMouseLock(); 63 void LostMouseLock();
60 void OnTabClosing(content::WebContents* web_contents); 64 void OnTabClosing(content::WebContents* web_contents);
61 void OnTabDeactivated(TabContentsWrapper* contents); 65 void OnTabDeactivated(TabContentsWrapper* contents);
62 void OnAcceptFullscreenPermission(const GURL& url, 66 void OnAcceptFullscreenPermission(const GURL& url,
63 FullscreenExitBubbleType bubble_type); 67 FullscreenExitBubbleType bubble_type);
64 void OnDenyFullscreenPermission(FullscreenExitBubbleType bubble_type); 68 void OnDenyFullscreenPermission(FullscreenExitBubbleType bubble_type);
65 void WindowFullscreenStateChanged(); 69 void WindowFullscreenStateChanged();
66 bool HandleUserPressedEscape(); 70 bool HandleUserPressedEscape();
(...skipping 13 matching lines...) Expand all
80 // Notifies the tab that it has been forced out of fullscreen mode if 84 // Notifies the tab that it has been forced out of fullscreen mode if
81 // necessary. 85 // necessary.
82 void NotifyTabOfFullscreenExitIfNecessary(); 86 void NotifyTabOfFullscreenExitIfNecessary();
83 // Make the current tab exit fullscreen mode if it is in it. 87 // Make the current tab exit fullscreen mode if it is in it.
84 void ExitTabbedFullscreenModeIfNecessary(); 88 void ExitTabbedFullscreenModeIfNecessary();
85 void UpdateFullscreenExitBubbleContent(); 89 void UpdateFullscreenExitBubbleContent();
86 void NotifyFullscreenChange(); 90 void NotifyFullscreenChange();
87 ContentSetting GetFullscreenSetting(const GURL& url) const; 91 ContentSetting GetFullscreenSetting(const GURL& url) const;
88 ContentSetting GetMouseLockSetting(const GURL& url) const; 92 ContentSetting GetMouseLockSetting(const GURL& url) const;
89 93
94 #if defined(OS_MACOSX)
95 void TogglePresentationModeInternal(bool for_tab);
96 #endif
97 // TODO(koz): Change |for_tab| to an enum.
98 void ToggleFullscreenModeInternal(bool for_tab);
99
90 BrowserWindow* window_; 100 BrowserWindow* window_;
91 Profile* profile_; 101 Profile* profile_;
92 Browser* browser_; 102 Browser* browser_;
93 103
94 // If there is currently a tab in fullscreen mode (entered via 104 // If there is currently a tab in fullscreen mode (entered via
95 // webkitRequestFullScreen), this is its wrapper. 105 // webkitRequestFullScreen), this is its wrapper.
96 TabContentsWrapper* fullscreened_tab_; 106 TabContentsWrapper* fullscreened_tab_;
97 107
108 // The URL of the extension which trigerred "browser fullscreen" mode.
109 GURL extension_caused_fullscreen_;
110
98 // True if the current tab entered fullscreen mode via webkitRequestFullScreen 111 // True if the current tab entered fullscreen mode via webkitRequestFullScreen
99 bool tab_caused_fullscreen_; 112 bool tab_caused_fullscreen_;
100 // True if tab fullscreen has been allowed, either by settings or by user 113 // True if tab fullscreen has been allowed, either by settings or by user
101 // clicking the allow button on the fullscreen infobar. 114 // clicking the allow button on the fullscreen infobar.
102 bool tab_fullscreen_accepted_; 115 bool tab_fullscreen_accepted_;
103 116
104 MouseLockState mouse_lock_state_; 117 MouseLockState mouse_lock_state_;
105 118
106 DISALLOW_COPY_AND_ASSIGN(FullscreenController); 119 DISALLOW_COPY_AND_ASSIGN(FullscreenController);
107 }; 120 };
108 121
109 #endif // CHROME_BROWSER_UI_FULLSCREEN_CONTROLLER_H_ 122 #endif // CHROME_BROWSER_UI_FULLSCREEN_CONTROLLER_H_
OLDNEW
« no previous file with comments | « chrome/browser/ui/cocoa/browser_window_cocoa.mm ('k') | chrome/browser/ui/fullscreen_controller.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698