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

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

Issue 13866026: Adds functionality to anchor widgets to the top-of-window views in immersive mode (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Created 7 years, 8 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.h
diff --git a/chrome/browser/ui/views/frame/immersive_mode_controller.h b/chrome/browser/ui/views/frame/immersive_mode_controller.h
index 80d5725c1aa6f2bfab8e664952bf547ce0e5c8b4..84526b5a5c653ca314edd6981946bcec53850dac 100644
--- a/chrome/browser/ui/views/frame/immersive_mode_controller.h
+++ b/chrome/browser/ui/views/frame/immersive_mode_controller.h
@@ -9,6 +9,10 @@
class BrowserView;
+namespace views {
+class Widget;
+}
+
// Controller for an "immersive mode" similar to MacOS presentation mode where
// the top-of-window views are hidden until the mouse hits the top of the
// screen. The tab strip is optionally painted with miniature "tab indicator"
@@ -55,6 +59,27 @@ class ImmersiveModeController {
// enabled / disabled.
// The caller takes ownership of the returned lock.
virtual RevealedLock* GetRevealedLock() WARN_UNUSED_RESULT = 0;
+
+ // Anchor |widget| to the top-of-window views. This repositions |widget| such
+ // that it stays |y_offset| below the top-of-window views when the
+ // top-of-window views are animating (top-of-window views reveal / unreveal)
+ // or the top container's bounds change (eg the bookmark bar is shown).
+ // If the top-of-window views are revealed (or become revealed), |widget|
+ // will keep the top-of-window views revealed till either |widget| is hidden
+ // or UnanchorWidgetFromTopContainer() is called.
+ // It is legal for a widget to be anchored when immersive fullscreen is
+ // disabled, however it will have no effect till immersive fullscreen is
+ // enabled.
+ virtual void AnchorWidgetToTopContainer(views::Widget* widget,
+ int y_offset) = 0;
+
+ // Stops managing |widget|'s y position.
+ // Closes the top-of-window views if no locks or other anchored widgets are
+ // keeping the top-of-window views revealed.
+ virtual void UnanchorWidgetFromTopContainer(views::Widget* widget) = 0;
+
+ // Called by the TopContainerView to indicate that its bounds have changed.
+ virtual void OnTopContainerBoundsChanged() = 0;
};
namespace chrome {

Powered by Google App Engine
This is Rietveld 408576698