Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(612)

Unified Diff: chrome/browser/cocoa/applescript/tab_applescript.mm

Issue 3180006: Cleaned up the SDEF... (Closed) Base URL: http://src.chromium.org/svn/trunk/src/
Patch Set: '' Created 10 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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
« no previous file with comments | « chrome/browser/cocoa/applescript/tab_applescript.h ('k') | chrome/browser/cocoa/applescript/window_applescript_test.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698