OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 183 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
194 params.disposition = NEW_FOREGROUND_TAB; | 194 params.disposition = NEW_FOREGROUND_TAB; |
195 params.tabstrip_index = index; | 195 params.tabstrip_index = index; |
196 browser::Navigate(¶ms); | 196 browser::Navigate(¶ms); |
197 params.target_contents->tab_contents()->set_new_tab_start_time( | 197 params.target_contents->tab_contents()->set_new_tab_start_time( |
198 newTabStartTime); | 198 newTabStartTime); |
199 | 199 |
200 [aTab setTabContent:params.target_contents]; | 200 [aTab setTabContent:params.target_contents]; |
201 } | 201 } |
202 | 202 |
203 - (void)removeFromTabsAtIndex:(int)index { | 203 - (void)removeFromTabsAtIndex:(int)index { |
204 browser_->tabstrip_model()->DetachTabContentsAt(index); | 204 browser_->CloseTabContents(browser_->GetTabContentsAt(index)); |
205 } | 205 } |
206 | 206 |
207 - (NSNumber*)orderedIndex{ | 207 - (NSNumber*)orderedIndex { |
208 return [NSNumber numberWithInt:[[self nativeHandle] orderedIndex]]; | 208 return [NSNumber numberWithInt:[[self nativeHandle] orderedIndex]]; |
209 } | 209 } |
210 | 210 |
211 - (void)setOrderedIndex:(NSNumber*)anIndex { | 211 - (void)setOrderedIndex:(NSNumber*)anIndex { |
212 int index = [anIndex intValue] - 1; | 212 int index = [anIndex intValue] - 1; |
213 if (index < 0 || index >= (int)BrowserList::size()) { | 213 if (index < 0 || index >= (int)BrowserList::size()) { |
214 AppleScript::SetError(AppleScript::errWrongIndex); | 214 AppleScript::SetError(AppleScript::errWrongIndex); |
215 return; | 215 return; |
216 } | 216 } |
217 [[self nativeHandle] setOrderedIndex:index]; | 217 [[self nativeHandle] setOrderedIndex:index]; |
(...skipping 39 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 |