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

Side by Side Diff: Source/devtools/front_end/InspectorFrontendHostStub.js

Issue 298333003: DevTools: Implement console message logging through an extension (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Remove duplicate logging Created 6 years, 6 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « Source/devtools/devtools.gypi ('k') | Source/devtools/front_end/common/MessageSink.js » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2009 Google Inc. All rights reserved. 2 * Copyright (C) 2009 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after
120 { 120 {
121 }, 121 },
122 122
123 inspectedURLChanged: function(url) 123 inspectedURLChanged: function(url)
124 { 124 {
125 document.title = WebInspector.UIString("Developer Tools - %s", url); 125 document.title = WebInspector.UIString("Developer Tools - %s", url);
126 }, 126 },
127 127
128 copyText: function(text) 128 copyText: function(text)
129 { 129 {
130 WebInspector.console.log("Clipboard is not enabled in hosted mode. Pleas e inspect using chrome://inspect", WebInspector.ConsoleMessage.MessageLevel.Erro r, true); 130 WebInspector.messageSink.addErrorMessage("Clipboard is not enabled in ho sted mode. Please inspect using chrome://inspect", true);
131 }, 131 },
132 132
133 openInNewTab: function(url) 133 openInNewTab: function(url)
134 { 134 {
135 window.open(url, "_blank"); 135 window.open(url, "_blank");
136 }, 136 },
137 137
138 save: function(url, content, forceSaveAs) 138 save: function(url, content, forceSaveAs)
139 { 139 {
140 WebInspector.console.log("Saving files is not enabled in hosted mode. Pl ease inspect using chrome://inspect", WebInspector.ConsoleMessage.MessageLevel.E rror, true); 140 WebInspector.messageSink.addErrorMessage("Saving files is not enabled in hosted mode. Please inspect using chrome://inspect", true);
141 WebInspector.fileManager.canceledSaveURL(url); 141 WebInspector.fileManager.canceledSaveURL(url);
142 }, 142 },
143 143
144 append: function(url, content) 144 append: function(url, content)
145 { 145 {
146 WebInspector.console.log("Saving files is not enabled in hosted mode. Pl ease inspect using chrome://inspect", WebInspector.ConsoleMessage.MessageLevel.E rror, true); 146 WebInspector.messageSink.addErrorMessage("Saving files is not enabled in hosted mode. Please inspect using chrome://inspect", true);
147 }, 147 },
148 148
149 sendMessageToBackend: function(message) 149 sendMessageToBackend: function(message)
150 { 150 {
151 }, 151 },
152 152
153 sendMessageToEmbedder: function(message) 153 sendMessageToEmbedder: function(message)
154 { 154 {
155 }, 155 },
156 156
(...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after
267 if (!window.InspectorFrontendHost) { 267 if (!window.InspectorFrontendHost) {
268 InspectorFrontendHost = new WebInspector.InspectorFrontendHostStub(); 268 InspectorFrontendHost = new WebInspector.InspectorFrontendHostStub();
269 } else { 269 } else {
270 var proto = WebInspector.InspectorFrontendHostStub.prototype; 270 var proto = WebInspector.InspectorFrontendHostStub.prototype;
271 for (var name in proto) { 271 for (var name in proto) {
272 var value = proto[name]; 272 var value = proto[name];
273 if (typeof value !== "function" || InspectorFrontendHost[name]) 273 if (typeof value !== "function" || InspectorFrontendHost[name])
274 continue; 274 continue;
275 InspectorFrontendHost[name] = function(name) { 275 InspectorFrontendHost[name] = function(name) {
276 var message = "Incompatible embedder: method InspectorFrontendHost." + name + " is missing. Using stub instead."; 276 var message = "Incompatible embedder: method InspectorFrontendHost." + name + " is missing. Using stub instead.";
277 if (WebInspector.console) 277 WebInspector.messageSink.addErrorMessage(message, true);
278 WebInspector.console.showErrorMessage(message);
279 else
280 console.error(message);
281 var args = Array.prototype.slice.call(arguments, 1); 278 var args = Array.prototype.slice.call(arguments, 1);
282 return proto[name].apply(InspectorFrontendHost, args); 279 return proto[name].apply(InspectorFrontendHost, args);
283 }.bind(null, name); 280 }.bind(null, name);
284 } 281 }
285 } 282 }
OLDNEW
« no previous file with comments | « Source/devtools/devtools.gypi ('k') | Source/devtools/front_end/common/MessageSink.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698