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

Unified Diff: chrome/browser/ui/cocoa/browser_window_controller.mm

Issue 1650483002: Refactor: Untangle Mac's ExclusiveAccessContext from BrowserWindow (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rename accessor Created 4 years, 11 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/browser_window_controller.mm
diff --git a/chrome/browser/ui/cocoa/browser_window_controller.mm b/chrome/browser/ui/cocoa/browser_window_controller.mm
index 0299daa460a9da3ffcd9f892ad1f19ccbdfe1ac3..a4b3f45f711cee7e9344c23746fff55d14e7caf5 100644
--- a/chrome/browser/ui/cocoa/browser_window_controller.mm
+++ b/chrome/browser/ui/cocoa/browser_window_controller.mm
@@ -42,6 +42,7 @@
#import "chrome/browser/ui/cocoa/bookmarks/bookmark_bar_controller.h"
#import "chrome/browser/ui/cocoa/bookmarks/bookmark_bubble_observer_cocoa.h"
#import "chrome/browser/ui/cocoa/bookmarks/bookmark_editor_controller.h"
+#import "chrome/browser/ui/cocoa/browser/exclusive_access_controller_views.h"
#import "chrome/browser/ui/cocoa/browser_window_cocoa.h"
#import "chrome/browser/ui/cocoa/browser_window_command_handler.h"
#import "chrome/browser/ui/cocoa/browser_window_controller_private.h"
@@ -300,6 +301,10 @@ void SetUpBrowserWindowCommandHandler(NSWindow* window) {
browser_->host_desktop_type()));
}
+ // Creates the manager for fullscreen and fullscreen bubbles.
+ exclusiveAccessController_.reset(
+ new ExclusiveAccessController(self, browser_.get()));
+
// Size and position the window. Note that it is not yet onscreen. Popup
// windows may get resized later on in this function, once the actual size
// of the toolbar/tabstrip is known.
@@ -1884,11 +1889,6 @@ willAnimateFromState:(BookmarkBar::State)oldState
}
// (Private/TestingAPI)
-- (ExclusiveAccessBubbleWindowController*)
- exclusiveAccessBubbleWindowController {
- return exclusiveAccessBubbleWindowController_.get();
-}
-
- (NSRect)omniboxPopupAnchorRect {
// Start with toolbar rect.
NSView* toolbarView = [toolbarController_ view];
@@ -1959,10 +1959,7 @@ willAnimateFromState:(BookmarkBar::State)oldState
: fullscreen_mac::OMNIBOX_TABS_HIDDEN];
}
-- (void)updateFullscreenExitBubbleURL:(const GURL&)url
- bubbleType:(ExclusiveAccessBubbleType)bubbleType {
- fullscreenUrl_ = url;
- exclusiveAccessBubbleType_ = bubbleType;
+- (void)updateFullscreenExitBubble {
[self layoutSubviews];
[self showFullscreenExitBubbleIfNecessary];
}
@@ -1989,21 +1986,17 @@ willAnimateFromState:(BookmarkBar::State)oldState
enteringAppKitFullscreen_);
}
-- (void)enterExtensionFullscreenForURL:(const GURL&)url
- bubbleType:(ExclusiveAccessBubbleType)bubbleType {
+- (void)enterExtensionFullscreen {
if (chrome::mac::SupportsSystemFullscreen()) {
- fullscreenUrl_ = url;
- exclusiveAccessBubbleType_ = bubbleType;
[self enterBrowserFullscreenWithToolbar:NO];
} else {
[self enterImmersiveFullscreen];
- DCHECK(!url.is_empty());
- [self updateFullscreenExitBubbleURL:url bubbleType:bubbleType];
+ DCHECK(!exclusiveAccessController_->url().is_empty());
+ [self updateFullscreenExitBubble];
}
}
-- (void)enterWebContentFullscreenForURL:(const GURL&)url
- bubbleType:(ExclusiveAccessBubbleType)bubbleType {
+- (void)enterWebContentFullscreen {
// HTML5 Fullscreen should only use AppKit fullscreen in 10.10+.
if (chrome::mac::SupportsSystemFullscreen() &&
base::mac::IsOSYosemiteOrLater())
@@ -2011,8 +2004,8 @@ willAnimateFromState:(BookmarkBar::State)oldState
else
[self enterImmersiveFullscreen];
- if (!url.is_empty())
- [self updateFullscreenExitBubbleURL:url bubbleType:bubbleType];
+ if (!exclusiveAccessController_->url().is_empty())
+ [self updateFullscreenExitBubble];
}
- (void)exitAnyFullscreen {
@@ -2085,6 +2078,10 @@ willAnimateFromState:(BookmarkBar::State)oldState
return [focused isKindOfClass:[AutocompleteTextFieldEditor class]];
}
+- (ExclusiveAccessController*)exclusiveAccessController {
+ return exclusiveAccessController_.get();
+}
+
@end // @implementation BrowserWindowController(Fullscreen)
« no previous file with comments | « chrome/browser/ui/cocoa/browser_window_controller.h ('k') | chrome/browser/ui/cocoa/browser_window_controller_private.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698