| OLD | NEW |
| 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" |
| 11 #import "chrome/browser/app_controller_mac.h" | 11 #import "chrome/browser/app_controller_mac.h" |
| 12 #import "chrome/browser/chrome_browser_application_mac.h" | 12 #import "chrome/browser/chrome_browser_application_mac.h" |
| 13 #include "chrome/browser/profiles/profile.h" | 13 #include "chrome/browser/profiles/profile.h" |
| 14 #include "chrome/browser/ui/browser.h" | 14 #include "chrome/browser/ui/browser.h" |
| 15 #include "chrome/browser/ui/browser_commands.h" | 15 #include "chrome/browser/ui/browser_commands.h" |
| 16 #include "chrome/browser/ui/browser_finder.h" | 16 #include "chrome/browser/ui/browser_finder.h" |
| 17 #include "chrome/browser/ui/browser_navigator.h" | 17 #include "chrome/browser/ui/browser_navigator.h" |
| 18 #include "chrome/browser/ui/browser_navigator_params.h" | 18 #include "chrome/browser/ui/browser_navigator_params.h" |
| 19 #include "chrome/browser/ui/browser_tabstrip.h" | 19 #include "chrome/browser/ui/browser_tabstrip.h" |
| 20 #include "chrome/browser/ui/browser_window.h" | 20 #include "chrome/browser/ui/browser_window.h" |
| 21 #include "chrome/browser/ui/cocoa/applescript/constants_applescript.h" | 21 #include "chrome/browser/ui/cocoa/applescript/constants_applescript.h" |
| 22 #include "chrome/browser/ui/cocoa/applescript/error_applescript.h" | 22 #include "chrome/browser/ui/cocoa/applescript/error_applescript.h" |
| 23 #include "chrome/browser/ui/cocoa/applescript/metrics_applescript.h" | 23 #include "chrome/browser/ui/cocoa/applescript/metrics_applescript.h" |
| 24 #import "chrome/browser/ui/cocoa/applescript/tab_applescript.h" | 24 #import "chrome/browser/ui/cocoa/applescript/tab_applescript.h" |
| 25 #include "chrome/browser/ui/exclusive_access/exclusive_access_context.h" |
| 26 #include "chrome/browser/ui/exclusive_access/exclusive_access_manager.h" |
| 25 #include "chrome/browser/ui/host_desktop.h" | 27 #include "chrome/browser/ui/host_desktop.h" |
| 26 #include "chrome/browser/ui/tab_contents/core_tab_helper.h" | 28 #include "chrome/browser/ui/tab_contents/core_tab_helper.h" |
| 27 #include "chrome/browser/ui/tabs/tab_strip_model.h" | 29 #include "chrome/browser/ui/tabs/tab_strip_model.h" |
| 28 #include "chrome/common/url_constants.h" | 30 #include "chrome/common/url_constants.h" |
| 29 #include "content/public/browser/web_contents.h" | 31 #include "content/public/browser/web_contents.h" |
| 30 | 32 |
| 31 @interface WindowAppleScript(WindowAppleScriptPrivateMethods) | 33 @interface WindowAppleScript(WindowAppleScriptPrivateMethods) |
| 32 // The NSWindow that corresponds to this window. | 34 // The NSWindow that corresponds to this window. |
| 33 - (NSWindow*)nativeHandle; | 35 - (NSWindow*)nativeHandle; |
| 34 @end | 36 @end |
| (...skipping 224 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 259 - (NSNumber*)presenting { | 261 - (NSNumber*)presenting { |
| 260 BOOL presentingValue = browser_->window() && | 262 BOOL presentingValue = browser_->window() && |
| 261 browser_->window()->IsFullscreen() && | 263 browser_->window()->IsFullscreen() && |
| 262 !browser_->window()->IsFullscreenWithToolbar(); | 264 !browser_->window()->IsFullscreenWithToolbar(); |
| 263 return [NSNumber numberWithBool:presentingValue]; | 265 return [NSNumber numberWithBool:presentingValue]; |
| 264 } | 266 } |
| 265 | 267 |
| 266 - (void)handlesEnterPresentationMode:(NSScriptCommand*)command { | 268 - (void)handlesEnterPresentationMode:(NSScriptCommand*)command { |
| 267 AppleScript::LogAppleScriptUMA( | 269 AppleScript::LogAppleScriptUMA( |
| 268 AppleScript::AppleScriptCommand::WINDOW_ENTER_PRESENTATION_MODE); | 270 AppleScript::AppleScriptCommand::WINDOW_ENTER_PRESENTATION_MODE); |
| 269 if (browser_->window()) { | 271 browser_->exclusive_access_manager()->context()->EnterFullscreen( |
| 270 browser_->window()->EnterFullscreen( | 272 GURL(), EXCLUSIVE_ACCESS_BUBBLE_TYPE_FULLSCREEN_EXIT_INSTRUCTION, false); |
| 271 GURL(), EXCLUSIVE_ACCESS_BUBBLE_TYPE_FULLSCREEN_EXIT_INSTRUCTION, | |
| 272 false); | |
| 273 } | |
| 274 } | 273 } |
| 275 | 274 |
| 276 - (void)handlesExitPresentationMode:(NSScriptCommand*)command { | 275 - (void)handlesExitPresentationMode:(NSScriptCommand*)command { |
| 277 AppleScript::LogAppleScriptUMA( | 276 AppleScript::LogAppleScriptUMA( |
| 278 AppleScript::AppleScriptCommand::WINDOW_EXIT_PRESENTATION_MODE); | 277 AppleScript::AppleScriptCommand::WINDOW_EXIT_PRESENTATION_MODE); |
| 279 if (browser_->window()) | 278 browser_->exclusive_access_manager()->context()->ExitFullscreen(); |
| 280 browser_->window()->ExitFullscreen(); | |
| 281 } | 279 } |
| 282 | 280 |
| 283 @end | 281 @end |
| OLD | NEW |