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

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

Issue 1650483002: Refactor: Untangle Mac's ExclusiveAccessContext from BrowserWindow (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: self nits, More robust interface, fix other random stuff 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_cocoa.mm
diff --git a/chrome/browser/ui/cocoa/browser_window_cocoa.mm b/chrome/browser/ui/cocoa/browser_window_cocoa.mm
index 64b2829fbf0dd63c6b1eca2d27093a702be20f77..1868a6917760153430f6180b5558a00a0147707e 100644
--- a/chrome/browser/ui/cocoa/browser_window_cocoa.mm
+++ b/chrome/browser/ui/cocoa/browser_window_cocoa.mm
@@ -17,7 +17,6 @@
#include "chrome/browser/download/download_shelf.h"
#include "chrome/browser/extensions/extension_util.h"
#include "chrome/browser/extensions/tab_helper.h"
-#include "chrome/browser/fullscreen.h"
#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/shell_integration.h"
#include "chrome/browser/signin/chrome_signin_helper.h"
@@ -48,7 +47,6 @@
#import "chrome/browser/ui/cocoa/toolbar/toolbar_controller.h"
#import "chrome/browser/ui/cocoa/web_dialog_window_controller.h"
#import "chrome/browser/ui/cocoa/website_settings/website_settings_bubble_controller.h"
-#include "chrome/browser/ui/exclusive_access/fullscreen_controller.h"
#include "chrome/browser/ui/search/search_model.h"
#include "chrome/browser/ui/tabs/tab_strip_model.h"
#include "chrome/browser/web_applications/web_app.h"
@@ -208,7 +206,7 @@ void BrowserWindowCocoa::Hide() {
void BrowserWindowCocoa::SetBounds(const gfx::Rect& bounds) {
gfx::Rect real_bounds = [controller_ enforceMinWindowSize:bounds];
- ExitFullscreen();
+ [controller_ exitAnyFullscreen];
spqchan 2016/02/01 19:55:04 It's probably safer to just use [controller_ exclu
tapted 2016/02/02 11:57:06 Yah, good idea. Done.
tapted 2016/02/02 21:58:43 (note with this change I also needed to move the i
NSRect cocoa_bounds = NSMakeRect(real_bounds.x(), 0,
real_bounds.width(),
real_bounds.height());
@@ -410,35 +408,6 @@ void BrowserWindowCocoa::Restore() {
[window() deminiaturize:controller_];
}
-// See browser_window_controller.h for a detailed explanation of the logic in
-// this method.
-void BrowserWindowCocoa::EnterFullscreen(const GURL& url,
- ExclusiveAccessBubbleType bubble_type,
- bool with_toolbar) {
- if (browser_->exclusive_access_manager()
- ->fullscreen_controller()
- ->IsWindowFullscreenForTabOrPending())
- [controller_ enterWebContentFullscreenForURL:url bubbleType:bubble_type];
- else if (!url.is_empty())
- [controller_ enterExtensionFullscreenForURL:url bubbleType:bubble_type];
- else
- [controller_ enterBrowserFullscreenWithToolbar:with_toolbar];
-}
-
-void BrowserWindowCocoa::ExitFullscreen() {
- [controller_ exitAnyFullscreen];
-}
-
-void BrowserWindowCocoa::UpdateExclusiveAccessExitBubbleContent(
- const GURL& url,
- ExclusiveAccessBubbleType bubble_type) {
- [controller_ updateFullscreenExitBubbleURL:url bubbleType:bubble_type];
-}
-
-void BrowserWindowCocoa::OnExclusiveAccessUserInput() {
- // TODO(mgiuca): Route this signal to the exclusive access bubble on Mac.
-}
-
bool BrowserWindowCocoa::ShouldHideUIForFullscreen() const {
// On Mac, fullscreen mode has most normal things (in a slide-down panel).
return false;
@@ -449,27 +418,7 @@ bool BrowserWindowCocoa::IsFullscreen() const {
}
bool BrowserWindowCocoa::IsFullscreenBubbleVisible() const {
- return false;
-}
-
-bool BrowserWindowCocoa::SupportsFullscreenWithToolbar() const {
- return chrome::mac::SupportsSystemFullscreen();
-}
-
-void BrowserWindowCocoa::UpdateFullscreenWithToolbar(bool with_toolbar) {
- [controller_ updateFullscreenWithToolbar:with_toolbar];
-}
-
-void BrowserWindowCocoa::ToggleFullscreenToolbar() {
- [controller_ toggleFullscreenToolbar];
-}
-
-bool BrowserWindowCocoa::IsFullscreenWithToolbar() const {
- return IsFullscreen() && ![controller_ inPresentationMode];
-}
-
-bool BrowserWindowCocoa::ShouldHideFullscreenToolbar() const {
- return [controller_ shouldHideFullscreenToolbar];
+ return false; // Currently only called from toolkit-views website_settings.
}
void BrowserWindowCocoa::ConfirmAddSearchProvider(
@@ -880,24 +829,5 @@ void BrowserWindowCocoa::ExecuteExtensionCommand(
}
ExclusiveAccessContext* BrowserWindowCocoa::GetExclusiveAccessContext() {
- return this;
-}
-
-Profile* BrowserWindowCocoa::GetProfile() {
- return browser_->profile();
-}
-
-WebContents* BrowserWindowCocoa::GetActiveWebContents() {
- return browser_->tab_strip_model()->GetActiveWebContents();
-}
-
-void BrowserWindowCocoa::UnhideDownloadShelf() {
- GetDownloadShelf()->Unhide();
-}
-
-void BrowserWindowCocoa::HideDownloadShelf() {
- GetDownloadShelf()->Hide();
- StatusBubble* statusBubble = GetStatusBubble();
- if (statusBubble)
- statusBubble->Hide();
+ return [controller_ exclusiveAccessContext];
}

Powered by Google App Engine
This is Rietveld 408576698