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

Side by Side Diff: chrome/browser/ui/cocoa/applescript/window_applescript.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, 10 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 unified diff | Download patch
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #import "chrome/browser/ui/cocoa/applescript/window_applescript.h" 5 #import "chrome/browser/ui/cocoa/applescript/window_applescript.h"
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 #import "base/mac/scoped_nsobject.h" 8 #import "base/mac/scoped_nsobject.h"
9 #include "base/memory/scoped_ptr.h" 9 #include "base/memory/scoped_ptr.h"
10 #include "base/time/time.h" 10 #include "base/time/time.h"
(...skipping 243 matching lines...) Expand 10 before | Expand all | Expand 10 after
254 AppleScript::LogAppleScriptUMA(AppleScript::AppleScriptCommand::WINDOW_CLOSE); 254 AppleScript::LogAppleScriptUMA(AppleScript::AppleScriptCommand::WINDOW_CLOSE);
255 255
256 // window() can be NULL during startup. 256 // window() can be NULL during startup.
257 if (browser_->window()) 257 if (browser_->window())
258 browser_->window()->Close(); 258 browser_->window()->Close();
259 } 259 }
260 260
261 - (NSNumber*)presenting { 261 - (NSNumber*)presenting {
262 BOOL presentingValue = browser_->window() && 262 BOOL presentingValue = browser_->window() &&
263 browser_->window()->IsFullscreen() && 263 browser_->window()->IsFullscreen() &&
264 !browser_->window()->IsFullscreenWithToolbar(); 264 !browser_->window()
265 ->GetExclusiveAccessContext()
266 ->IsFullscreenWithToolbar();
265 return [NSNumber numberWithBool:presentingValue]; 267 return [NSNumber numberWithBool:presentingValue];
266 } 268 }
267 269
268 - (void)handlesEnterPresentationMode:(NSScriptCommand*)command { 270 - (void)handlesEnterPresentationMode:(NSScriptCommand*)command {
269 AppleScript::LogAppleScriptUMA( 271 AppleScript::LogAppleScriptUMA(
270 AppleScript::AppleScriptCommand::WINDOW_ENTER_PRESENTATION_MODE); 272 AppleScript::AppleScriptCommand::WINDOW_ENTER_PRESENTATION_MODE);
271 browser_->exclusive_access_manager()->context()->EnterFullscreen( 273 browser_->exclusive_access_manager()->context()->EnterFullscreen(
272 GURL(), EXCLUSIVE_ACCESS_BUBBLE_TYPE_FULLSCREEN_EXIT_INSTRUCTION, false); 274 GURL(), EXCLUSIVE_ACCESS_BUBBLE_TYPE_FULLSCREEN_EXIT_INSTRUCTION, false);
273 } 275 }
274 276
275 - (void)handlesExitPresentationMode:(NSScriptCommand*)command { 277 - (void)handlesExitPresentationMode:(NSScriptCommand*)command {
276 AppleScript::LogAppleScriptUMA( 278 AppleScript::LogAppleScriptUMA(
277 AppleScript::AppleScriptCommand::WINDOW_EXIT_PRESENTATION_MODE); 279 AppleScript::AppleScriptCommand::WINDOW_EXIT_PRESENTATION_MODE);
278 browser_->exclusive_access_manager()->context()->ExitFullscreen(); 280 browser_->exclusive_access_manager()->context()->ExitFullscreen();
279 } 281 }
280 282
281 @end 283 @end
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698