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

Unified Diff: chrome/browser/ui/views/frame/immersive_mode_controller_ash.h

Issue 15734011: Correct immersive mode gestures under rotation (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Moved SetPreTargetHandler() to private section Created 7 years, 7 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/views/frame/immersive_mode_controller_ash.h
diff --git a/chrome/browser/ui/views/frame/immersive_mode_controller_ash.h b/chrome/browser/ui/views/frame/immersive_mode_controller_ash.h
index 15d004e04781489259c6eda826c39b4e7bea5547..e970f8db1140771c3ea33387021c342de58e1d79 100644
--- a/chrome/browser/ui/views/frame/immersive_mode_controller_ash.h
+++ b/chrome/browser/ui/views/frame/immersive_mode_controller_ash.h
@@ -10,6 +10,7 @@
#include "base/timer.h"
#include "content/public/browser/notification_observer.h"
#include "content/public/browser/notification_registrar.h"
+#include "ui/aura/window_observer.h"
#include "ui/base/events/event_handler.h"
#include "ui/compositor/layer_animation_observer.h"
#include "ui/views/focus/focus_manager.h"
@@ -40,7 +41,8 @@ class ImmersiveModeControllerAsh : public ImmersiveModeController,
public ui::EventHandler,
public ui::ImplicitAnimationObserver,
public views::FocusChangeListener,
- public views::WidgetObserver {
+ public views::WidgetObserver,
+ public aura::WindowObserver {
public:
ImmersiveModeControllerAsh();
virtual ~ImmersiveModeControllerAsh();
@@ -95,6 +97,13 @@ class ImmersiveModeControllerAsh : public ImmersiveModeController,
// ui::ImplicitAnimationObserver override:
virtual void OnImplicitAnimationsCompleted() OVERRIDE;
+ // aura::WindowObserver overrides:
+ virtual void OnWindowPropertyChanged(aura::Window* window,
+ const void* key,
+ intptr_t old) OVERRIDE;
+ virtual void OnWindowAddedToRootWindow(aura::Window* window) OVERRIDE;
+ virtual void OnWindowRemovedFromRootWindow(aura::Window* window) OVERRIDE;
+
// Testing interface.
void SetForceHideTabIndicatorsForTest(bool force);
void StartRevealForTest(bool hovered);
@@ -202,7 +211,11 @@ class ImmersiveModeControllerAsh : public ImmersiveModeController,
// container is closed "near" means either within the displayed bounds or
// within a few pixels of it. This allow the container to steal enough pixels
// to detect a swipe in.
- bool IsNearTopContainer(gfx::Point location) const;
+ bool ShouldHandleEvent(const gfx::Point& location) const;
+
+ // Call Add/RemovePreTargerHandler since either the RootWindow has changed or
+ // the enabled state of observing has changed.
+ void SetPreTargetHandler();
James Cook 2013/05/28 16:29:42 nit: Consider making this UpdatePreTargetHandler(b
rharrison 2013/05/28 17:03:01 Done.
// Injected dependencies. Not owned.
Delegate* delegate_;
@@ -239,13 +252,9 @@ class ImmersiveModeControllerAsh : public ImmersiveModeController,
// and the active widget.
scoped_ptr<ImmersiveRevealedLock> focus_revealed_lock_;
- // Native window for the browser, needed to clean up observers.
+ // Native window for the browser.
aura::Window* native_window_;
- // Observer to disable immersive mode when window leaves the maximized state.
- class WindowObserver;
- scoped_ptr<WindowObserver> window_observer_;
-
// Manages widgets which are anchored to the top-of-window views.
class AnchoredWidgetManager;
scoped_ptr<AnchoredWidgetManager> anchored_widget_manager_;

Powered by Google App Engine
This is Rietveld 408576698