| Index: chrome/browser/cocoa/applescript/tab_applescript.mm
|
| ===================================================================
|
| --- chrome/browser/cocoa/applescript/tab_applescript.mm (revision 56204)
|
| +++ chrome/browser/cocoa/applescript/tab_applescript.mm (working copy)
|
| @@ -29,6 +29,13 @@
|
|
|
| - (id)init {
|
| if ((self = [super init])) {
|
| + SessionID session;
|
| + SessionID::id_type futureSessionIDOfTab = session.id() + 1;
|
| + // Holds the SessionID that the new tab is going to get.
|
| + scoped_nsobject<NSNumber> numID(
|
| + [[NSNumber alloc]
|
| + initWithInt:futureSessionIDOfTab]);
|
| + [self setUniqueID:numID];
|
| [self setTempURL:@""];
|
| }
|
| return self;
|
| @@ -271,4 +278,19 @@
|
| }
|
| }
|
|
|
| +- (id)handlesExecuteJavascriptScriptCommand:(NSScriptCommand*)command {
|
| + RenderViewHost* view = tabContents_->render_view_host();
|
| + if (!view) {
|
| + NOTREACHED();
|
| + return nil;
|
| + }
|
| +
|
| + std::wstring script = base::SysNSStringToWide(
|
| + [[command evaluatedArguments] objectForKey:@"javascript"]);
|
| + view->ExecuteJavascriptInWebFrame(L"", script);
|
| +
|
| + // TODO(Shreyas): Figure out a way to get the response back.
|
| + return nil;
|
| +}
|
| +
|
| @end
|
|
|