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

Unified Diff: Source/devtools/front_end/components/ExtensionServerProxy.js

Issue 667623002: DevTools: make extension server a part of core, panels' code should depend on it. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: for review Created 6 years, 2 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: Source/devtools/front_end/components/ExtensionServerProxy.js
diff --git a/Source/devtools/front_end/components/ExtensionServerProxy.js b/Source/devtools/front_end/components/ExtensionServerProxy.js
deleted file mode 100644
index 02c557c59b841c6ba4f311d9a09c4fbefbdb5e2c..0000000000000000000000000000000000000000
--- a/Source/devtools/front_end/components/ExtensionServerProxy.js
+++ /dev/null
@@ -1,77 +0,0 @@
-/*
- * Copyright 2014 The Chromium Authors. All rights reserved.
- * Use of this source code is governed by a BSD-style license that can be
- * found in the LICENSE file.
- */
-
-/**
- * @interface
- */
-WebInspector.ExtensionServerAPI = function() { }
-
-WebInspector.ExtensionServerAPI.prototype = {
- /**
- * @param {!Array.<!ExtensionDescriptor>} descriptors
- */
- addExtensions: function(descriptors) { }
-}
-
-/**
- * @constructor
- */
-WebInspector.ExtensionServerProxy = function()
-{
-}
-
-WebInspector.ExtensionServerProxy.prototype = {
- setFrontendReady: function()
- {
- this._frontendReady = true;
- this._pushExtensionsToServer();
- },
-
- _addExtensions: function(extensions)
- {
- if (extensions.length === 0)
- return;
-
- console.assert(!this._pendingExtensions);
- this._pendingExtensions = extensions;
- this._pushExtensionsToServer();
- },
-
- _pushExtensionsToServer: function()
- {
- if (!this._frontendReady || !this._pendingExtensions)
- return;
-
- self.runtime.instancePromise(WebInspector.ExtensionServerAPI).then(pushExtensions.bind(this)).done();
-
- /**
- * @param {!Object} object
- * @this {WebInspector.ExtensionServerProxy}
- */
- function pushExtensions(object)
- {
- this._extensionServer = /** @type {!WebInspector.ExtensionServerAPI} */ (object);
-
- if (WebInspector.extensionServerProxy._overridePlatformExtensionAPIForTest)
- window.buildPlatformExtensionAPI = WebInspector.extensionServerProxy._overridePlatformExtensionAPIForTest;
-
- this._extensionServer.addExtensions(this._pendingExtensions);
- delete this._pendingExtensions;
- }
- }
-}
-
-WebInspector.extensionServerProxy = new WebInspector.ExtensionServerProxy();
-
-WebInspector.addExtensions = function(extensions)
-{
- WebInspector.extensionServerProxy._addExtensions(extensions);
-}
-
-WebInspector.setInspectedTabId = function(tabId)
-{
- WebInspector._inspectedTabId = tabId;
-}

Powered by Google App Engine
This is Rietveld 408576698