| 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/memory/scoped_nsobject.h" | 8 #import "base/memory/scoped_nsobject.h" |
| 9 #include "base/memory/scoped_ptr.h" | 9 #include "base/memory/scoped_ptr.h" |
| 10 #include "base/time.h" | 10 #include "base/time.h" |
| (...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 92 scoped_nsobject<NSNumber> numID( | 92 scoped_nsobject<NSNumber> numID( |
| 93 [[NSNumber alloc] initWithInt:browser_->session_id().id()]); | 93 [[NSNumber alloc] initWithInt:browser_->session_id().id()]); |
| 94 [self setUniqueID:numID]; | 94 [self setUniqueID:numID]; |
| 95 } | 95 } |
| 96 return self; | 96 return self; |
| 97 } | 97 } |
| 98 | 98 |
| 99 - (NSWindow*)nativeHandle { | 99 - (NSWindow*)nativeHandle { |
| 100 // window() can be NULL during startup. | 100 // window() can be NULL during startup. |
| 101 if (browser_->window()) | 101 if (browser_->window()) |
| 102 return browser_->window()->GetNativeHandle(); | 102 return browser_->window()->GetNativeWindow(); |
| 103 return nil; | 103 return nil; |
| 104 } | 104 } |
| 105 | 105 |
| 106 - (NSNumber*)activeTabIndex { | 106 - (NSNumber*)activeTabIndex { |
| 107 // Note: applescript is 1-based, that is lists begin with index 1. | 107 // Note: applescript is 1-based, that is lists begin with index 1. |
| 108 int activeTabIndex = browser_->active_index() + 1; | 108 int activeTabIndex = browser_->active_index() + 1; |
| 109 if (!activeTabIndex) { | 109 if (!activeTabIndex) { |
| 110 return nil; | 110 return nil; |
| 111 } | 111 } |
| 112 return [NSNumber numberWithInt:activeTabIndex]; | 112 return [NSNumber numberWithInt:activeTabIndex]; |
| (...skipping 144 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 257 GURL(), FEB_TYPE_FULLSCREEN_EXIT_INSTRUCTION); | 257 GURL(), FEB_TYPE_FULLSCREEN_EXIT_INSTRUCTION); |
| 258 } | 258 } |
| 259 } | 259 } |
| 260 | 260 |
| 261 - (void)handlesExitPresentationMode:(NSScriptCommand*)command { | 261 - (void)handlesExitPresentationMode:(NSScriptCommand*)command { |
| 262 if (browser_->window()) | 262 if (browser_->window()) |
| 263 browser_->window()->ExitPresentationMode(); | 263 browser_->window()->ExitPresentationMode(); |
| 264 } | 264 } |
| 265 | 265 |
| 266 @end | 266 @end |
| OLD | NEW |