| 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" | 
| (...skipping 243 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
|  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 | 
| OLD | NEW |