| 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 173 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 184 } | 184 } |
| 185 | 185 |
| 186 - (void)insertInTabs:(TabAppleScript*)aTab atIndex:(int)index { | 186 - (void)insertInTabs:(TabAppleScript*)aTab atIndex:(int)index { |
| 187 // This method gets called when a new tab is created so | 187 // This method gets called when a new tab is created so |
| 188 // the container and property are set here. | 188 // the container and property are set here. |
| 189 [aTab setContainer:self | 189 [aTab setContainer:self |
| 190 property:AppleScript::kTabsProperty]; | 190 property:AppleScript::kTabsProperty]; |
| 191 | 191 |
| 192 // Set how long it takes a tab to be created. | 192 // Set how long it takes a tab to be created. |
| 193 base::TimeTicks newTabStartTime = base::TimeTicks::Now(); | 193 base::TimeTicks newTabStartTime = base::TimeTicks::Now(); |
| 194 browser::NavigateParams params(browser_, | 194 chrome::NavigateParams params(browser_, GURL(chrome::kChromeUINewTabURL), |
| 195 GURL(chrome::kChromeUINewTabURL), | 195 content::PAGE_TRANSITION_TYPED); |
| 196 content::PAGE_TRANSITION_TYPED); | |
| 197 params.disposition = NEW_FOREGROUND_TAB; | 196 params.disposition = NEW_FOREGROUND_TAB; |
| 198 params.tabstrip_index = index; | 197 params.tabstrip_index = index; |
| 199 browser::Navigate(¶ms); | 198 chrome::Navigate(¶ms); |
| 200 params.target_contents->web_contents()->SetNewTabStartTime( | 199 params.target_contents->web_contents()->SetNewTabStartTime( |
| 201 newTabStartTime); | 200 newTabStartTime); |
| 202 | 201 |
| 203 [aTab setTabContent:params.target_contents]; | 202 [aTab setTabContent:params.target_contents]; |
| 204 } | 203 } |
| 205 | 204 |
| 206 - (void)removeFromTabsAtIndex:(int)index { | 205 - (void)removeFromTabsAtIndex:(int)index { |
| 207 chrome::CloseWebContents(browser_, chrome::GetWebContentsAt(browser_, index)); | 206 chrome::CloseWebContents(browser_, chrome::GetWebContentsAt(browser_, index)); |
| 208 } | 207 } |
| 209 | 208 |
| (...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 260 GURL(), FEB_TYPE_FULLSCREEN_EXIT_INSTRUCTION); | 259 GURL(), FEB_TYPE_FULLSCREEN_EXIT_INSTRUCTION); |
| 261 } | 260 } |
| 262 } | 261 } |
| 263 | 262 |
| 264 - (void)handlesExitPresentationMode:(NSScriptCommand*)command { | 263 - (void)handlesExitPresentationMode:(NSScriptCommand*)command { |
| 265 if (browser_->window()) | 264 if (browser_->window()) |
| 266 browser_->window()->ExitPresentationMode(); | 265 browser_->window()->ExitPresentationMode(); |
| 267 } | 266 } |
| 268 | 267 |
| 269 @end | 268 @end |
| OLD | NEW |