From a1dadc4e183780c0b4cbcbab8d745ef22960ac27 Mon Sep 17 00:00:00 2001 From: "aa@chromium.org" Date: Wed, 15 Apr 2009 21:26:54 +0000 Subject: Miscellaneous API sprucing. - Camel-case event names. - Rename chromium.self in content scripts to chromium.extension. - Move onConnect in extension process to chromium.self.onConnect. - Move definition of chromium.self to extension_process_bindings.js, so that it is near all the other extension process API. - Make toolstrips not wrap by default - Make toolstrips 21px high instead of 19, which was required to avoid an ugly white horizontal bar on my machine. This may be font dependent :(, which is another reason I need to finish making us paint the toolstrips background instead of using this CSS hack. Review URL: http://codereview.chromium.org/67162 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@13792 0039d316-1c4b-4281-b951-d872f2087c98 --- chrome/renderer/resources/extension_process_bindings.js | 8 ++++++++ chrome/renderer/resources/renderer_extension_bindings.js | 8 +++----- 2 files changed, 11 insertions(+), 5 deletions(-) (limited to 'chrome/renderer/resources') diff --git a/chrome/renderer/resources/extension_process_bindings.js b/chrome/renderer/resources/extension_process_bindings.js index ff7ac7e..454a9b0 100644 --- a/chrome/renderer/resources/extension_process_bindings.js +++ b/chrome/renderer/resources/extension_process_bindings.js @@ -66,6 +66,8 @@ var chromium; request(sargs, callbackId); } + //---------------------------------------------------------------------------- + // Tabs chromium.tabs = {}; // TODO(aa): This should eventually take an optional windowId param. @@ -127,4 +129,10 @@ var chromium; chromium.tabs.removeTab.params = [ chromium.types.pInt ]; + + //---------------------------------------------------------------------------- + + // Self + chromium.self = {}; + chromium.self.onConnect = new chromium.Event("channel-connect"); })(); diff --git a/chrome/renderer/resources/renderer_extension_bindings.js b/chrome/renderer/resources/renderer_extension_bindings.js index a392cf0..fafd491 100644 --- a/chrome/renderer/resources/renderer_extension_bindings.js +++ b/chrome/renderer/resources/renderer_extension_bindings.js @@ -10,10 +10,10 @@ var chromium = chromium || {}; throw new Error("Port '" + portId + "' already exists."); } this.portId_ = portId; // TODO(mpcomplete): readonly - this.onmessage = new chromium.Event(); + this.onMessage = new chromium.Event(); chromium.Port.ports_[portId] = this; // Note: this object will never get GCed. If we ever care, we could - // add an "ondetach" method to the onmessage Event that gets called + // add an "ondetach" method to the onMessage Event that gets called // when there are no more listeners. }; @@ -33,7 +33,7 @@ var chromium = chromium || {}; if (msg) { msg = goog.json.parse(msg); } - port.onmessage.dispatch(msg, port); + port.onMessage.dispatch(msg, port); } }; @@ -62,6 +62,4 @@ var chromium = chromium || {}; chromium.Extension.prototype.getURL = function(path) { return "chrome-extension://" + this.id_ + "/" + path; }; - - chromium.onconnect = new chromium.Event("channel-connect"); })(); -- cgit v1.1