https://bugs.webkit.org/show_bug.cgi?id=86621
Reviewed by Pavel Feldman.
Source/WebCore:
* English.lproj/localizedStrings.js:
* inspector/front-end/InspectorFrontendHostStub.js:
(.WebInspector.InspectorFrontendHostStub):
(.WebInspector.InspectorFrontendHostStub.prototype.documentCopy):
(.WebInspector.InspectorFrontendHostStub.prototype.copyText):
(.WebInspector.clipboardAccessDeniedMessage):
(.WebInspector.ClipboardAccessDeniedScreen):
* inspector/front-end/inspector.html:
* inspector/front-end/inspector.js:
(WebInspector.documentCopy):
(WebInspector.documentCopyEventFired):
Source/WebKit/chromium:
* src/js/DevTools.js:
(WebInspector.clipboardAccessDeniedMessage):
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@117481
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
+2012-05-17 Mikhail Naganov <mnaganov@chromium.org>
+
+ Support Copy ... actions for the Web Inspector remote debugging mode.
+ https://bugs.webkit.org/show_bug.cgi?id=86621
+
+ Reviewed by Pavel Feldman.
+
+ * English.lproj/localizedStrings.js:
+ * inspector/front-end/InspectorFrontendHostStub.js:
+ (.WebInspector.InspectorFrontendHostStub):
+ (.WebInspector.InspectorFrontendHostStub.prototype.documentCopy):
+ (.WebInspector.InspectorFrontendHostStub.prototype.copyText):
+ (.WebInspector.clipboardAccessDeniedMessage):
+ (.WebInspector.ClipboardAccessDeniedScreen):
+ * inspector/front-end/inspector.html:
+ * inspector/front-end/inspector.js:
+ (WebInspector.documentCopy):
+ (WebInspector.documentCopyEventFired):
+
2012-05-02 Robert Hogan <robert@webkit.org>
CSS 2.1 failure: table-height-algorithm-023 and -024 fail
{
this._attachedWindowHeight = 0;
this.isStub = true;
+ WebInspector.documentCopyEventFired = this.documentCopy.bind(this);
}
WebInspector.InspectorFrontendHostStub.prototype = {
document.title = WebInspector.UIString(Preferences.applicationTitle, url);
},
- copyText: function()
+ documentCopy: function(event)
{
+ if (!this._textToCopy)
+ return;
+ event.clipboardData.setData("text", this._textToCopy);
+ event.preventDefault();
+ delete this._textToCopy;
+ },
+
+ copyText: function(text)
+ {
+ this._textToCopy = text;
+ if (!document.execCommand("copy")) {
+ var screen = new WebInspector.ClipboardAccessDeniedScreen();
+ screen.showModal();
+ }
},
openInNewTab: function(url)
var InspectorFrontendHost = new WebInspector.InspectorFrontendHostStub();
Preferences.localizeUI = false;
+// Default implementation; platforms will override.
+WebInspector.clipboardAccessDeniedMessage = function()
+{
+ return "";
+}
+
+/**
+ * @constructor
+ * @extends {WebInspector.HelpScreen}
+ */
+WebInspector.ClipboardAccessDeniedScreen = function()
+{
+ WebInspector.HelpScreen.call(this, WebInspector.UIString("Clipboard access is denied"));
+ var platformMessage = WebInspector.clipboardAccessDeniedMessage();
+ if (platformMessage) {
+ var p = this.contentElement.createChild("p");
+ p.addStyleClass("help-section");
+ p.textContent = platformMessage;
+ }
}
+WebInspector.ClipboardAccessDeniedScreen.prototype.__proto__ = WebInspector.HelpScreen.prototype;
+
+}
<script type="text/javascript" src="InspectorFrontendAPI.js"></script>
<script type="text/javascript" src="Object.js"></script>
<script type="text/javascript" src="Settings.js"></script>
+ <script type="text/javascript" src="View.js"></script>
+ <script type="text/javascript" src="HelpScreen.js"></script>
<script type="text/javascript" src="InspectorFrontendHostStub.js"></script>
<script type="text/javascript" src="FileManager.js"></script>
<script type="text/javascript" src="Checkbox.js"></script>
<script type="text/javascript" src="TextPrompt.js"></script>
<script type="text/javascript" src="Popover.js"></script>
<script type="text/javascript" src="Placard.js"></script>
- <script type="text/javascript" src="View.js"></script>
<script type="text/javascript" src="TabbedPane.js"></script>
<script type="text/javascript" src="Drawer.js"></script>
<script type="text/javascript" src="ConsoleModel.js"></script>
<script type="text/javascript" src="TimelineOverviewPane.js"></script>
<script type="text/javascript" src="TimelineFrameController.js"></script>
<script type="text/javascript" src="TestController.js"></script>
- <script type="text/javascript" src="HelpScreen.js"></script>
<script type="text/javascript" src="Dialog.js"></script>
<script type="text/javascript" src="GoToLineDialog.js"></script>
<script type="text/javascript" src="FilteredItemSelectionDialog.js"></script>
{
if (WebInspector.inspectorView.currentPanel() && WebInspector.inspectorView.currentPanel().handleCopyEvent)
WebInspector.inspectorView.currentPanel().handleCopyEvent(event);
+ WebInspector.documentCopyEventFired(event);
+}
+
+WebInspector.documentCopyEventFired = function(event)
+{
}
WebInspector.contextMenuEventFired = function(event)
+2012-05-17 Mikhail Naganov <mnaganov@chromium.org>
+
+ Support Copy ... actions for the Web Inspector remote debugging mode.
+ https://bugs.webkit.org/show_bug.cgi?id=86621
+
+ Reviewed by Pavel Feldman.
+
+ * src/js/DevTools.js:
+ (WebInspector.clipboardAccessDeniedMessage):
+
2012-05-17 Hironori Bono <hbono@chromium.org>
[Refactoring] Move platform-specific code in Editor::respondToChangedSelection to the WebKit layer
{
WebInspector._inspectedTabId = tabId;
}
+
+WebInspector.clipboardAccessDeniedMessage = function()
+{
+ return "You need to install a Chrome extension that grants clipboard access to Developer Tools.";
+}