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

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: respond to comments, remove flaky reload 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | chrome/browser/ui/fullscreen_controller.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..ef7eac81743823fe6fa389736663f4f1ae982ab7 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,7 +34,8 @@ 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,
@@ -91,6 +94,11 @@ class FullscreenController : public base::RefCounted<FullscreenController> {
FullscreenExitBubbleType GetFullscreenExitBubbleType() const;
+ // content::NotificationObserver
+ virtual void Observe(int type,
+ const content::NotificationSource& source,
+ const content::NotificationDetails& details) OVERRIDE;
+
private:
friend class base::RefCounted<FullscreenController>;
@@ -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);
};
« no previous file with comments | « no previous file | chrome/browser/ui/fullscreen_controller.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698