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

Unified Diff: chrome/browser/ui/views/immersive_mode_controller.h

Issue 11411250: Immersive mode reveals the tabstrip/omnibox on top of web content (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: update comment Created 8 years, 1 month 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/immersive_mode_controller.h
diff --git a/chrome/browser/ui/views/immersive_mode_controller.h b/chrome/browser/ui/views/immersive_mode_controller.h
index 70ef2fd0cc7e46f1079d50080fe07979e0509bc3..2544619dd4e9c553452c7095e557bc5d79f57883 100644
--- a/chrome/browser/ui/views/immersive_mode_controller.h
+++ b/chrome/browser/ui/views/immersive_mode_controller.h
@@ -9,9 +9,11 @@
#include "base/compiler_specific.h"
#include "base/timer.h"
#include "ui/base/events/event_handler.h"
+#include "ui/compositor/layer_animation_observer.h"
#include "ui/views/mouse_watcher.h"
class BrowserView;
+class RevealView;
namespace views {
class MouseWatcher;
@@ -21,6 +23,7 @@ class MouseWatcher;
// the top-of-window views are hidden until the mouse hits the top of the screen
// and the tab strip is painted in a rectangular "light-bar" style.
class ImmersiveModeController : public ui::EventHandler,
+ public ui::ImplicitAnimationObserver,
public views::MouseWatcherListener {
public:
explicit ImmersiveModeController(BrowserView* browser_view);
@@ -31,12 +34,9 @@ class ImmersiveModeController : public ui::EventHandler,
bool enabled() const { return enabled_; }
// True when we are hiding the top views due to immersive mode.
- bool ShouldHideTopViews() const { return enabled_ && hide_top_views_; }
+ bool ShouldHideTopViews() const { return enabled_ && !revealed_; }
- // Temporarily reveals the top-of-window views while in immersive mode,
- // hiding them when the cursor exits the area of the top views.
- // Visible for testing.
- void RevealTopViews();
+ bool IsRevealed() const { return enabled_ && revealed_; }
// ui::EventHandler overrides:
virtual ui::EventResult OnKeyEvent(ui::KeyEvent* event) OVERRIDE;
@@ -45,18 +45,47 @@ class ImmersiveModeController : public ui::EventHandler,
virtual ui::EventResult OnTouchEvent(ui::TouchEvent* event) OVERRIDE;
virtual ui::EventResult OnGestureEvent(ui::GestureEvent* event) OVERRIDE;
+ // ui::ImplicitAnimationObserver overrides:
+ virtual void OnImplicitAnimationsCompleted() OVERRIDE;
+
// views::MouseWatcherListener overrides:
virtual void MouseMovedOutOfHost() OVERRIDE;
+ // Testing interface.
+ void StartRevealForTest();
+ void EndRevealForTest();
+
private:
+ // Temporarily reveals the top-of-window views while in immersive mode,
+ // hiding them when the cursor exits the area of the top views.
+ void StartReveal();
+
+ // Slide in the reveal view.
+ void AnimateShowRevealView();
+
+ // Starts watching the mouse for when it leaves the RevealView.
+ void StartMouseWatcher();
+
+ // Hides the top-of-window views.
+ void EndReveal(bool animate);
+
+ // Slide out the reveal view. Deletes the view when complete.
+ void AnimateHideRevealView();
+
+ // Cleans up the reveal view when the slide-out completes.
+ void ResetRevealView();
+
// Browser view holding the views to be shown and hidden. Not owned.
BrowserView* browser_view_;
// True when in immersive mode.
bool enabled_;
- // True when the top-of-window views are being hidden by immersive mode.
- bool hide_top_views_;
+ // True when the top-of-window views are being shown in a temporary reveal.
+ bool revealed_;
+
+ // View holding the tabstrip and toolbar during a reveal.
+ scoped_ptr<RevealView> reveal_view_;
// Timer to track cursor being held at the top.
base::OneShotTimer<ImmersiveModeController> top_timer_;
« no previous file with comments | « chrome/browser/ui/views/frame/browser_view_layout.cc ('k') | chrome/browser/ui/views/immersive_mode_controller.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698