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

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

Issue 10443045: Silent mouse lock after unlock by target (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Update for silent mouse relock 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
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 #include "content/common/mouse_lock.h"
13 14
14 class Browser; 15 class Browser;
15 class BrowserWindow; 16 class BrowserWindow;
16 class GURL; 17 class GURL;
17 class Profile; 18 class Profile;
18 class TabContentsWrapper; 19 class TabContentsWrapper;
19 20
20 namespace content { 21 namespace content {
21 class WebContents; 22 class WebContents;
22 } 23 }
(...skipping 24 matching lines...) Expand all
47 // Returns true if fullscreen has been caused by a tab. 48 // Returns true if fullscreen has been caused by a tab.
48 // The window may still be transitioning, and window_->IsFullscreen() 49 // The window may still be transitioning, and window_->IsFullscreen()
49 // may still return false. 50 // may still return false.
50 bool IsFullscreenForTabOrPending() const; 51 bool IsFullscreenForTabOrPending() const;
51 bool IsFullscreenForTabOrPending(const content::WebContents* tab) const; 52 bool IsFullscreenForTabOrPending(const content::WebContents* tab) const;
52 53
53 bool IsMouseLockRequested() const; 54 bool IsMouseLockRequested() const;
54 bool IsMouseLocked() const; 55 bool IsMouseLocked() const;
55 56
56 // Requests. 57 // Requests.
57 void RequestToLockMouse(content::WebContents* tab, bool user_gesture); 58 void RequestToLockMouse(content::WebContents* tab,
59 content::MouseLockSource lock_source,
60 content::MouseUnlockSource previous_unlock_source);
58 void ToggleFullscreenModeForTab(content::WebContents* tab, 61 void ToggleFullscreenModeForTab(content::WebContents* tab,
59 bool enter_fullscreen); 62 bool enter_fullscreen);
60 #if defined(OS_MACOSX) 63 #if defined(OS_MACOSX)
61 void TogglePresentationMode(); 64 void TogglePresentationMode();
62 #endif 65 #endif
63 void ToggleFullscreenMode(); 66 void ToggleFullscreenMode();
64 // Extension API implementation uses this method to toggle fullscreen mode. 67 // Extension API implementation uses this method to toggle fullscreen mode.
65 // The extension's name is displayed in the full screen bubble UI to attribute 68 // The extension's name is displayed in the full screen bubble UI to attribute
66 // the cause of the full screen state change. 69 // the cause of the full screen state change.
67 void ToggleFullscreenModeWithExtension(const GURL& extension_url); 70 void ToggleFullscreenModeWithExtension(const GURL& extension_url);
(...skipping 12 matching lines...) Expand all
80 83
81 private: 84 private:
82 friend class base::RefCounted<FullscreenController>; 85 friend class base::RefCounted<FullscreenController>;
83 86
84 enum MouseLockState { 87 enum MouseLockState {
85 MOUSELOCK_NOT_REQUESTED, 88 MOUSELOCK_NOT_REQUESTED,
86 // The page requests to lock the mouse and the user hasn't responded to the 89 // The page requests to lock the mouse and the user hasn't responded to the
87 // request. 90 // request.
88 MOUSELOCK_REQUESTED, 91 MOUSELOCK_REQUESTED,
89 // Mouse lock has been allowed by the user. 92 // Mouse lock has been allowed by the user.
90 MOUSELOCK_ACCEPTED 93 MOUSELOCK_ACCEPTED,
94 // Mouse lock has been silently accepted, no notification to user.
95 MOUSELOCK_ACCEPTED_SILENTLY
91 }; 96 };
92 97
93 virtual ~FullscreenController(); 98 virtual ~FullscreenController();
94 99
95 // Notifies the tab that it has been forced out of fullscreen and mouse lock 100 // Notifies the tab that it has been forced out of fullscreen and mouse lock
96 // mode if necessary. 101 // mode if necessary.
97 void NotifyTabOfExitIfNecessary(); 102 void NotifyTabOfExitIfNecessary();
98 103
99 // Make the current tab exit fullscreen mode or mouse lock if it is in it. 104 // Make the current tab exit fullscreen mode or mouse lock if it is in it.
100 void ExitTabFullscreenOrMouseLockIfNecessary(); 105 void ExitTabFullscreenOrMouseLockIfNecessary();
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
132 137
133 // Wrapper for current tab requesting or currently in mouse lock. 138 // Wrapper for current tab requesting or currently in mouse lock.
134 TabContentsWrapper* mouse_lock_tab_; 139 TabContentsWrapper* mouse_lock_tab_;
135 140
136 MouseLockState mouse_lock_state_; 141 MouseLockState mouse_lock_state_;
137 142
138 DISALLOW_COPY_AND_ASSIGN(FullscreenController); 143 DISALLOW_COPY_AND_ASSIGN(FullscreenController);
139 }; 144 };
140 145
141 #endif // CHROME_BROWSER_UI_FULLSCREEN_CONTROLLER_H_ 146 #endif // CHROME_BROWSER_UI_FULLSCREEN_CONTROLLER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698