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/tab_applescript.h" | 5 #import "chrome/browser/ui/cocoa/applescript/tab_applescript.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/files/file_path.h" | 8 #include "base/files/file_path.h" |
9 #include "base/logging.h" | 9 #include "base/logging.h" |
10 #import "base/mac/scoped_nsobject.h" | 10 #import "base/mac/scoped_nsobject.h" |
(...skipping 203 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
214 AppleScript::AppleScriptCommand::TAB_GO_FORWARD); | 214 AppleScript::AppleScriptCommand::TAB_GO_FORWARD); |
215 NavigationController& navigationController = webContents_->GetController(); | 215 NavigationController& navigationController = webContents_->GetController(); |
216 if (navigationController.CanGoForward()) | 216 if (navigationController.CanGoForward()) |
217 navigationController.GoForward(); | 217 navigationController.GoForward(); |
218 } | 218 } |
219 | 219 |
220 - (void)handlesReloadScriptCommand:(NSScriptCommand*)command { | 220 - (void)handlesReloadScriptCommand:(NSScriptCommand*)command { |
221 AppleScript::LogAppleScriptUMA(AppleScript::AppleScriptCommand::TAB_RELOAD); | 221 AppleScript::LogAppleScriptUMA(AppleScript::AppleScriptCommand::TAB_RELOAD); |
222 NavigationController& navigationController = webContents_->GetController(); | 222 NavigationController& navigationController = webContents_->GetController(); |
223 const bool checkForRepost = true; | 223 const bool checkForRepost = true; |
224 navigationController.Reload(checkForRepost); | 224 navigationController.Reload(content::ReloadType::NORMAL, checkForRepost); |
225 } | 225 } |
226 | 226 |
227 - (void)handlesStopScriptCommand:(NSScriptCommand*)command { | 227 - (void)handlesStopScriptCommand:(NSScriptCommand*)command { |
228 AppleScript::LogAppleScriptUMA(AppleScript::AppleScriptCommand::TAB_STOP); | 228 AppleScript::LogAppleScriptUMA(AppleScript::AppleScriptCommand::TAB_STOP); |
229 webContents_->Stop(); | 229 webContents_->Stop(); |
230 } | 230 } |
231 | 231 |
232 - (void)handlesPrintScriptCommand:(NSScriptCommand*)command { | 232 - (void)handlesPrintScriptCommand:(NSScriptCommand*)command { |
233 AppleScript::LogAppleScriptUMA(AppleScript::AppleScriptCommand::TAB_PRINT); | 233 AppleScript::LogAppleScriptUMA(AppleScript::AppleScriptCommand::TAB_PRINT); |
234 bool initiated = printing::PrintViewManager::FromWebContents(webContents_) | 234 bool initiated = printing::PrintViewManager::FromWebContents(webContents_) |
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
315 | 315 |
316 base::string16 script = base::SysNSStringToUTF16( | 316 base::string16 script = base::SysNSStringToUTF16( |
317 [[command evaluatedArguments] objectForKey:@"javascript"]); | 317 [[command evaluatedArguments] objectForKey:@"javascript"]); |
318 frame->ExecuteJavaScriptInIsolatedWorld( | 318 frame->ExecuteJavaScriptInIsolatedWorld( |
319 script, callback, chrome::ISOLATED_WORLD_ID_APPLESCRIPT); | 319 script, callback, chrome::ISOLATED_WORLD_ID_APPLESCRIPT); |
320 | 320 |
321 return nil; | 321 return nil; |
322 } | 322 } |
323 | 323 |
324 @end | 324 @end |
OLD | NEW |