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

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

Issue 10567002: Mouse lock and fullscreen exit upon reload. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fullscreen added to test Created 8 years, 6 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"
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
51 bool IsFullscreenForTabOrPending( 51 bool IsFullscreenForTabOrPending(
52 const content::WebContents* web_contents) const; 52 const content::WebContents* web_contents) const;
53 53
54 #if defined(OS_WIN) 54 #if defined(OS_WIN)
55 // Returns whether we are currently in a Metro snap view. 55 // Returns whether we are currently in a Metro snap view.
56 bool IsInMetroSnapMode(); 56 bool IsInMetroSnapMode();
57 #endif 57 #endif
58 58
59 bool IsMouseLockRequested() const; 59 bool IsMouseLockRequested() const;
60 bool IsMouseLocked() const; 60 bool IsMouseLocked() const;
61 FullscreenExitBubbleType GetFullscreenExitBubbleType() const;
61 62
62 // Requests. 63 // Requests.
63 void RequestToLockMouse(content::WebContents* web_contents, 64 void RequestToLockMouse(content::WebContents* web_contents,
64 bool user_gesture, 65 bool user_gesture,
65 bool last_unlocked_by_target); 66 bool last_unlocked_by_target);
66 void ToggleFullscreenModeForTab(content::WebContents* web_contents, 67 void ToggleFullscreenModeForTab(content::WebContents* web_contents,
67 bool enter_fullscreen); 68 bool enter_fullscreen);
68 #if defined(OS_WIN) 69 #if defined(OS_WIN)
69 // API that puts the window into a mode suitable for rendering when Chrome 70 // API that puts the window into a mode suitable for rendering when Chrome
70 // is rendered in a 20% screen-width Metro snap view on Windows 8. 71 // is rendered in a 20% screen-width Metro snap view on Windows 8.
71 void SetMetroSnapMode(bool enable); 72 void SetMetroSnapMode(bool enable);
72 #endif 73 #endif
73 #if defined(OS_MACOSX) 74 #if defined(OS_MACOSX)
74 void TogglePresentationMode(); 75 void TogglePresentationMode();
75 #endif 76 #endif
76 void ToggleFullscreenMode(); 77 void ToggleFullscreenMode();
77 // Extension API implementation uses this method to toggle fullscreen mode. 78 // Extension API implementation uses this method to toggle fullscreen mode.
78 // The extension's name is displayed in the full screen bubble UI to attribute 79 // The extension's name is displayed in the full screen bubble UI to attribute
79 // the cause of the full screen state change. 80 // the cause of the full screen state change.
80 void ToggleFullscreenModeWithExtension(const GURL& extension_url); 81 void ToggleFullscreenModeWithExtension(const GURL& extension_url);
81 82
82 // Notifications. 83 // Notifications.
83 void LostMouseLock(); 84 void LostMouseLock();
84 void OnTabClosing(content::WebContents* web_contents); 85 void OnTabClosing(content::WebContents* web_contents);
85 void OnTabDeactivated(TabContents* contents); 86 void OnTabDeactivated(TabContents* contents);
86 void OnAcceptFullscreenPermission(const GURL& url, 87 void OnAcceptFullscreenPermission(const GURL& url,
87 FullscreenExitBubbleType bubble_type); 88 FullscreenExitBubbleType bubble_type);
88 void OnDenyFullscreenPermission(FullscreenExitBubbleType bubble_type); 89 void OnDenyFullscreenPermission(FullscreenExitBubbleType bubble_type);
89 void WindowFullscreenStateChanged(); 90 void WindowFullscreenStateChanged();
91
92 // User Interaction Handlers. They Return true to block default action.
yzshen1 2012/06/18 16:22:05 nit: Please use lower case for 'interaction' and '
90 bool HandleUserPressedEscape(); 93 bool HandleUserPressedEscape();
91 94 bool HandleUserPressedReload();
yzshen1 2012/06/18 16:22:05 [I don't know the exact answer, but would like to
92 FullscreenExitBubbleType GetFullscreenExitBubbleType() const;
93 95
94 private: 96 private:
95 friend class base::RefCounted<FullscreenController>; 97 friend class base::RefCounted<FullscreenController>;
96 98
97 enum MouseLockState { 99 enum MouseLockState {
98 MOUSELOCK_NOT_REQUESTED, 100 MOUSELOCK_NOT_REQUESTED,
99 // The page requests to lock the mouse and the user hasn't responded to the 101 // The page requests to lock the mouse and the user hasn't responded to the
100 // request. 102 // request.
101 MOUSELOCK_REQUESTED, 103 MOUSELOCK_REQUESTED,
102 // Mouse lock has been allowed by the user. 104 // Mouse lock has been allowed by the user.
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
147 149
148 // TabContents for current tab requesting or currently in mouse lock. 150 // TabContents for current tab requesting or currently in mouse lock.
149 TabContents* mouse_lock_tab_; 151 TabContents* mouse_lock_tab_;
150 152
151 MouseLockState mouse_lock_state_; 153 MouseLockState mouse_lock_state_;
152 154
153 DISALLOW_COPY_AND_ASSIGN(FullscreenController); 155 DISALLOW_COPY_AND_ASSIGN(FullscreenController);
154 }; 156 };
155 157
156 #endif // CHROME_BROWSER_UI_FULLSCREEN_CONTROLLER_H_ 158 #endif // CHROME_BROWSER_UI_FULLSCREEN_CONTROLLER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698