path = it->second;
} else {
base::FilePath default_path(base::FilePath::FromUTF8Unsafe(url));
- if (!file_dialog::ShowSaveDialog(this, url, default_path, &path))
+ if (!file_dialog::ShowSaveDialog(this, url, default_path, &path)) {
+ base::StringValue url_value(url);
+ CallDevToolsFunction("InspectorFrontendAPI.canceledSaveURL", &url_value);
return;
+ }
}
saved_files_[url] = path;
// Notify devtools.
base::StringValue url_value(url);
CallDevToolsFunction("InspectorFrontendAPI.savedURL", &url_value);
-
- // TODO(zcbenz): In later Chrome we need to call canceledSaveURL when the save
- // failed.
}
void NativeWindow::DevToolsAppendToFile(const std::string& url,
}
}
}
- GetDevToolsWebContents()->GetRenderViewHost()->ExecuteJavascriptInWebFrame(
- base::string16(), base::UTF8ToUTF16(function_name + "(" + params + ");"));
+ base::string16 javascript =
+ base::UTF8ToUTF16(function_name + "(" + params + ");");
+ GetDevToolsWebContents()->GetMainFrame()->ExecuteJavaScript(javascript);
}
} // namespace atom
window.onload = ->
# Use menu API to show context menu.
- WebInspector.ContextMenu.prototype.show = ->
- menuObject = @_buildDescriptor()
- if menuObject.length
- WebInspector._contextMenu = this
- createMenu(menuObject, @_event)
- @_event.consume()
+ InspectorFrontendHost.showContextMenu = (event, items) ->
+ createMenu items, event
# Use dialog API to override file chooser dialog.
WebInspector.createFileSelectorElement = (callback) ->