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

Unified Diff: chrome/browser/ui/cocoa/fullscreen_toolbar_controller.h

Issue 2446313005: [Mac] Refactor the fullscreen toolbar mouse tracker (Closed)
Patch Set: Fix for rsesek Created 4 years, 2 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/cocoa/fullscreen_toolbar_controller.h
diff --git a/chrome/browser/ui/cocoa/fullscreen_toolbar_controller.h b/chrome/browser/ui/cocoa/fullscreen_toolbar_controller.h
index 74a1674df595b2e572e17ac876ac0a824fff1461..292d9dec63937e3fcc1a3fc4798c734240199242 100644
--- a/chrome/browser/ui/cocoa/fullscreen_toolbar_controller.h
+++ b/chrome/browser/ui/cocoa/fullscreen_toolbar_controller.h
@@ -12,9 +12,9 @@
#include "chrome/browser/ui/cocoa/location_bar/location_bar_view_mac.h"
@class BrowserWindowController;
-@class CrTrackingArea;
@class FullscreenMenubarTracker;
class FullscreenToolbarAnimationController;
+@class FullscreenToolbarMouseTracker;
enum class FullscreenSlidingStyle {
OMNIBOX_TABS_PRESENT, // Tab strip and omnibox both visible.
@@ -39,18 +39,6 @@ enum class FullscreenSlidingStyle {
// Whether or not we are in fullscreen mode.
BOOL inFullscreenMode_;
- // The content view for the window. This is nil when not in fullscreen mode.
- NSView* contentView_; // weak
-
- // The frame for the tracking area. The value is the toolbar overlay's frame
- // with additional height added at the bottom.
- NSRect trackingAreaFrame_;
-
- // The tracking area associated with the toolbar overlay bar. This tracking
- // area is used to keep the toolbar active if the menubar had animated out
- // but the mouse is still on the toolbar.
- base::scoped_nsobject<CrTrackingArea> trackingArea_;
-
// Updates the fullscreen toolbar layout for changes in the menubar. This
// object is only set when the browser is in fullscreen mode.
base::scoped_nsobject<FullscreenMenubarTracker> menubarTracker_;
@@ -58,6 +46,10 @@ enum class FullscreenSlidingStyle {
// Manages the toolbar animations for the OMNIBOX_TABS_HIDDEN style.
std::unique_ptr<FullscreenToolbarAnimationController> animationController_;
+ // Mouse tracker to track the user's interactions with the toolbar. This
+ // object is only set when the browser is in fullscreen mode.
+ base::scoped_nsobject<FullscreenToolbarMouseTracker> mouseTracker_;
+
// Tracks the currently requested system fullscreen mode, used to show or
// hide the menubar. This should be |kFullScreenModeNormal| when the window
// is not main or not fullscreen, |kFullScreenModeHideAll| while the overlay
@@ -86,7 +78,7 @@ enum class FullscreenSlidingStyle {
// window. If |-setupFullscreenToolbarForContentView:showDropdown:| is called,
// it must be balanced with a call to |-exitFullscreenMode| before the
// controller is released.
-- (void)setupFullscreenToolbarForContentView:(NSView*)contentView;
+- (void)enterFullscreenMode;
- (void)exitFullscreenMode;
// Informs the controller that the overlay should be shown/hidden, possibly
@@ -119,8 +111,8 @@ enum class FullscreenSlidingStyle {
// only be revealed if the mouse is there.
- (BOOL)isMouseOnScreen;
-// Sets |trackingAreaFrame_| from the given overlay frame.
-- (void)setTrackingAreaFromOverlayFrame:(NSRect)frame;
+// Called by the BrowserWindowController to update toolbar frame.
+- (void)updateToolbarFrame:(NSRect)frame;
// Returns YES if the browser is in the process of entering/exiting
// fullscreen.

Powered by Google App Engine
This is Rietveld 408576698