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

Unified Diff: chrome/browser/ui/cocoa/browser_window_controller_private.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_private.mm
diff --git a/chrome/browser/ui/cocoa/browser_window_controller_private.mm b/chrome/browser/ui/cocoa/browser_window_controller_private.mm
index 5676d0a454d5cdb95a8035696a9394e431d2f2cf..2da1397c4b109ecc7d78a98a2e83ad3cca9bc4f3 100644
--- a/chrome/browser/ui/cocoa/browser_window_controller_private.mm
+++ b/chrome/browser/ui/cocoa/browser_window_controller_private.mm
@@ -25,6 +25,7 @@
#include "chrome/browser/ui/browser_window_state.h"
#import "chrome/browser/ui/cocoa/browser_window_fullscreen_transition.h"
#import "chrome/browser/ui/cocoa/browser_window_layout.h"
+#import "chrome/browser/ui/cocoa/browser/exclusive_access_controller_views.h"
#import "chrome/browser/ui/cocoa/constrained_window/constrained_window_sheet_controller.h"
#import "chrome/browser/ui/cocoa/custom_frame_view.h"
#import "chrome/browser/ui/cocoa/dev_tools_controller.h"
@@ -630,27 +631,16 @@ willPositionSheet:(NSWindow*)sheet
[self hideOverlayIfPossibleWithAnimation:NO delay:NO];
- if (exclusiveAccessBubbleType_ == EXCLUSIVE_ACCESS_BUBBLE_TYPE_NONE ||
- exclusiveAccessBubbleType_ ==
- EXCLUSIVE_ACCESS_BUBBLE_TYPE_BROWSER_FULLSCREEN_EXIT_INSTRUCTION) {
- // Show no exit instruction bubble on Mac when in Browser Fullscreen.
- [self destroyFullscreenExitBubbleIfNecessary];
- } else {
- [exclusiveAccessBubbleWindowController_ closeImmediately];
- exclusiveAccessBubbleWindowController_.reset(
- [[ExclusiveAccessBubbleWindowController alloc]
- initWithOwner:self
- exclusive_access_manager:browser_.get()->exclusive_access_manager()
- profile:browser_.get()->profile()
- url:fullscreenUrl_
- bubbleType:exclusiveAccessBubbleType_]);
- [exclusiveAccessBubbleWindowController_ showWindow];
- }
-}
+ switch (exclusiveAccessController_->bubble_type()) {
+ case EXCLUSIVE_ACCESS_BUBBLE_TYPE_NONE:
+ case EXCLUSIVE_ACCESS_BUBBLE_TYPE_BROWSER_FULLSCREEN_EXIT_INSTRUCTION:
+ // Show no exit instruction bubble on Mac when in Browser Fullscreen.
+ exclusiveAccessController_->Destroy();
+ break;
-- (void)destroyFullscreenExitBubbleIfNecessary {
- [exclusiveAccessBubbleWindowController_ closeImmediately];
- exclusiveAccessBubbleWindowController_.reset();
+ default:
+ exclusiveAccessController_->Show();
+ }
}
- (void)contentViewDidResize:(NSNotification*)notification {
@@ -856,7 +846,7 @@ willPositionSheet:(NSWindow*)sheet
}
- (void)adjustUIForExitingFullscreen {
- [self destroyFullscreenExitBubbleIfNecessary];
+ exclusiveAccessController_->Destroy();
[self adjustUIForExitingFullscreenAndStopOmniboxSliding];
}
@@ -1051,9 +1041,7 @@ willPositionSheet:(NSWindow*)sheet
positionFindBarViewAtMaxY:output.findBarMaxY
maxWidth:NSWidth(output.contentAreaFrame)];
- [exclusiveAccessBubbleWindowController_
- positionInWindowAtTop:output.fullscreenExitButtonMaxY
- width:NSWidth(output.contentAreaFrame)];
+ exclusiveAccessController_->Layout(output.fullscreenExitButtonMaxY);
}
- (void)updateSubviewZOrder {

Powered by Google App Engine
This is Rietveld 408576698