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

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: Fix misnamed overrides correctly this time :-/ 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
« no previous file with comments | « no previous file | chrome/browser/ui/views/frame/immersive_mode_controller_ash.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..e7cfbbfdd19e9d359a928df643228b26032dcfdf 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 OnWindowRemovingFromRootWindow(aura::Window* window) OVERRIDE;
+
// Testing interface.
void SetForceHideTabIndicatorsForTest(bool force);
void StartRevealForTest(bool hovered);
@@ -198,11 +207,16 @@ class ImmersiveModeControllerAsh : public ImmersiveModeController,
SwipeType GetSwipeType(ui::GestureEvent* event) const;
// True when |location| is "near" to the top container. When the top container
- // is not closed "near" means within the displayed bounds. When the top
- // 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;
+ // is not closed "near" means within the displayed bounds or above it. When
+ // the top container is closed "near" means either within the displayed
+ // bounds, above it, or within a few pixels below it. This allow the container
+ // to steal enough pixels to detect a swipe in and handles the case that there
+ // is a bezel sensor above the top container.
+ 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 UpdatePreTargetHandler();
// Injected dependencies. Not owned.
Delegate* delegate_;
@@ -239,13 +253,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_;
« no previous file with comments | « no previous file | chrome/browser/ui/views/frame/immersive_mode_controller_ash.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698