| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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/cocoa/applescript/window_applescript.h" | 5 #import "chrome/browser/cocoa/applescript/window_applescript.h" |
| 6 | 6 |
| 7 #include "base/logging.h" | 7 #include "base/logging.h" |
| 8 #import "base/scoped_nsobject.h" | 8 #import "base/scoped_nsobject.h" |
| 9 #include "base/scoped_ptr.h" | 9 #include "base/scoped_ptr.h" |
| 10 #include "base/time.h" | 10 #include "base/time.h" |
| 11 #import "chrome/browser/app_controller_mac.h" | 11 #import "chrome/browser/app_controller_mac.h" |
| 12 #include "chrome/browser/browser.h" | 12 #include "chrome/browser/browser.h" |
| 13 #include "chrome/browser/browser_list.h" | 13 #include "chrome/browser/browser_list.h" |
| 14 #include "chrome/browser/browser_navigator.h" | |
| 15 #include "chrome/browser/browser_window.h" | 14 #include "chrome/browser/browser_window.h" |
| 16 #import "chrome/browser/chrome_browser_application_mac.h" | 15 #import "chrome/browser/chrome_browser_application_mac.h" |
| 17 #include "chrome/browser/cocoa/applescript/constants_applescript.h" | 16 #include "chrome/browser/cocoa/applescript/constants_applescript.h" |
| 18 #include "chrome/browser/cocoa/applescript/error_applescript.h" | 17 #include "chrome/browser/cocoa/applescript/error_applescript.h" |
| 19 #import "chrome/browser/cocoa/applescript/tab_applescript.h" | 18 #import "chrome/browser/cocoa/applescript/tab_applescript.h" |
| 20 #include "chrome/browser/profile.h" | 19 #include "chrome/browser/profile.h" |
| 21 #include "chrome/browser/tab_contents/tab_contents.h" | 20 #include "chrome/browser/tab_contents/tab_contents.h" |
| 22 #include "chrome/browser/tabs/tab_strip_model.h" | 21 #include "chrome/browser/tabs/tab_strip_model.h" |
| 22 #include "chrome/browser/ui/browser_navigator.h" |
| 23 #include "chrome/common/url_constants.h" | 23 #include "chrome/common/url_constants.h" |
| 24 | 24 |
| 25 @interface WindowAppleScript(WindowAppleScriptPrivateMethods) | 25 @interface WindowAppleScript(WindowAppleScriptPrivateMethods) |
| 26 // The NSWindow that corresponds to this window. | 26 // The NSWindow that corresponds to this window. |
| 27 - (NSWindow*)nativeHandle; | 27 - (NSWindow*)nativeHandle; |
| 28 @end | 28 @end |
| 29 | 29 |
| 30 @implementation WindowAppleScript | 30 @implementation WindowAppleScript |
| 31 | 31 |
| 32 - (id)init { | 32 - (id)init { |
| (...skipping 202 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 235 [[self nativeHandle] setValue:(id)value forKey:key]; | 235 [[self nativeHandle] setValue:(id)value forKey:key]; |
| 236 } | 236 } |
| 237 | 237 |
| 238 - (void)handlesCloseScriptCommand:(NSCloseCommand*)command { | 238 - (void)handlesCloseScriptCommand:(NSCloseCommand*)command { |
| 239 // window() can be NULL during startup. | 239 // window() can be NULL during startup. |
| 240 if (browser_->window()) | 240 if (browser_->window()) |
| 241 browser_->window()->Close(); | 241 browser_->window()->Close(); |
| 242 } | 242 } |
| 243 | 243 |
| 244 @end | 244 @end |
| OLD | NEW |