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

Unified Diff: chrome/browser/ui/fullscreen_controller.h

Issue 10378061: Exit tabbed fullscreen mode on navigation. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: add comment 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/ui/fullscreen_controller.h
diff --git a/chrome/browser/ui/fullscreen_controller.h b/chrome/browser/ui/fullscreen_controller.h
index 281622f515694ee10ae913ce488683bd5072785f..33adcf2d78e56d1ffab475b3fb570461d8a69f17 100644
--- a/chrome/browser/ui/fullscreen_controller.h
+++ b/chrome/browser/ui/fullscreen_controller.h
@@ -10,6 +10,8 @@
#include "base/memory/ref_counted.h"
#include "chrome/browser/ui/fullscreen_exit_bubble_type.h"
#include "chrome/common/content_settings.h"
+#include "content/public/browser/notification_observer.h"
+#include "content/public/browser/notification_registrar.h"
class Browser;
class BrowserWindow;
@@ -32,12 +34,18 @@ class WebContents;
// its fullscreen mode.
// This class implements fullscreen and mouselock behaviour.
-class FullscreenController : public base::RefCounted<FullscreenController> {
+class FullscreenController : public base::RefCounted<FullscreenController>,
+ public content::NotificationObserver {
public:
FullscreenController(BrowserWindow* window,
Profile* profile,
Browser* browser);
+ // content::NotificationObserver
sky 2012/06/15 15:01:08 nit: in general we try to put overriden methods at
koz (OOO until 15th September) 2012/06/18 02:28:10 Done.
+ virtual void Observe(int type,
+ const content::NotificationSource& source,
+ const content::NotificationDetails& details) OVERRIDE;
+
// Querying.
// Returns true if the window is currently fullscreen and was initially
@@ -111,6 +119,12 @@ class FullscreenController : public base::RefCounted<FullscreenController> {
// mode if necessary.
void NotifyTabOfExitIfNecessary();
+ // Makes the browser exit fullscreen mode when a navigation occurs.
+ void EnterCancelFullscreenOnNavigateMode();
+
+ // Makes the browser no longer exit fullscreen mode when a navigation occurs.
+ void ExitCancelFullscreenOnNavigateMode();
+
// Make the current tab exit fullscreen mode or mouse lock if it is in it.
void ExitTabFullscreenOrMouseLockIfNecessary();
void UpdateFullscreenExitBubbleContent();
@@ -150,6 +164,12 @@ class FullscreenController : public base::RefCounted<FullscreenController> {
MouseLockState mouse_lock_state_;
+ content::NotificationRegistrar registrar_;
+
+ // If this is true then we are listening for navigation events and will
+ // cancel fullscreen when one occurs.
+ bool cancel_fullscreen_on_navigate_mode_;
+
DISALLOW_COPY_AND_ASSIGN(FullscreenController);
};

Powered by Google App Engine
This is Rietveld 408576698