summaryrefslogtreecommitdiffstats
path: root/chrome
diff options
context:
space:
mode:
authoraa@chromium.org <aa@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-04-15 21:48:10 +0000
committeraa@chromium.org <aa@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-04-15 21:48:10 +0000
commit51bcfbee3c3bd6509e3a8123db739d2f5b09fcd1 (patch)
treee93e38c0c421e627c711b59486654c0743a3184f /chrome
parent5f86281ede483c8ba68d80055e48c3fd718ed5ca (diff)
downloadchromium_src-51bcfbee3c3bd6509e3a8123db739d2f5b09fcd1.zip
chromium_src-51bcfbee3c3bd6509e3a8123db739d2f5b09fcd1.tar.gz
chromium_src-51bcfbee3c3bd6509e3a8123db739d2f5b09fcd1.tar.bz2
TBR: Revert "Miscellaneous API sprucing."
This reverts commit 052b8f424d1550deebf3dc562d7c47dde72d7f76. Review URL: http://codereview.chromium.org/78001 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@13796 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome')
-rw-r--r--chrome/browser/extensions/extension_messages_unittest.cc6
-rwxr-xr-xchrome/browser/resources/extensions_toolstrip.css5
-rw-r--r--chrome/renderer/extensions/extension_process_bindings.cc4
-rwxr-xr-xchrome/renderer/extensions/renderer_extension_bindings.cc6
-rwxr-xr-xchrome/renderer/extensions/renderer_extension_bindings.h4
-rwxr-xr-xchrome/renderer/renderer_resources.grd4
-rw-r--r--chrome/renderer/resources/extension_process_bindings.js8
-rw-r--r--chrome/renderer/resources/renderer_extension_bindings.js8
-rw-r--r--chrome/renderer/user_script_slave.cc6
9 files changed, 16 insertions, 35 deletions
diff --git a/chrome/browser/extensions/extension_messages_unittest.cc b/chrome/browser/extensions/extension_messages_unittest.cc
index 009d574..565f664 100644
--- a/chrome/browser/extensions/extension_messages_unittest.cc
+++ b/chrome/browser/extensions/extension_messages_unittest.cc
@@ -15,7 +15,7 @@ TEST_F(RenderViewTest, ExtensionMessagesOpenChannel) {
ExecuteJavaScript(
"var e = new chromium.Extension('foobar');"
"var port = e.connect();"
- "port.onMessage.addListener(doOnMessage);"
+ "port.onmessage.addListener(doOnMessage);"
"port.postMessage({message: 'content ready'});"
"function doOnMessage(msg, port) {"
" alert('content got: ' + msg.val);"
@@ -56,8 +56,8 @@ TEST_F(RenderViewTest, ExtensionMessagesOpenChannel) {
TEST_F(RenderViewTest, ExtensionMessagesOnConnect) {
LoadHTML("<body></body>");
ExecuteJavaScript(
- "chromium.self.onConnect.addListener(function (port) {"
- " port.onMessage.addListener(doOnMessage);"
+ "chromium.onconnect.addListener(function (port) {"
+ " port.onmessage.addListener(doOnMessage);"
" port.postMessage({message: 'onconnect'});"
"});"
"function doOnMessage(msg, port) {"
diff --git a/chrome/browser/resources/extensions_toolstrip.css b/chrome/browser/resources/extensions_toolstrip.css
index 921f97f..a8a332d 100755
--- a/chrome/browser/resources/extensions_toolstrip.css
+++ b/chrome/browser/resources/extensions_toolstrip.css
@@ -10,7 +10,6 @@ body {
#main {
background: -webkit-gradient(linear, left top, left bottom, from(rgb(222, 234, 248)), to(rgb(237, 244, 252)));
padding-top: 3px;
- height: 21px;
- overflow: hidden;
- white-space: nowrap;
+ height:19px;
+ overflow:hidden;
}
diff --git a/chrome/renderer/extensions/extension_process_bindings.cc b/chrome/renderer/extensions/extension_process_bindings.cc
index 3f53898..0e47b23 100644
--- a/chrome/renderer/extensions/extension_process_bindings.cc
+++ b/chrome/renderer/extensions/extension_process_bindings.cc
@@ -6,7 +6,6 @@
#include "chrome/common/render_messages.h"
#include "chrome/renderer/extensions/bindings_utils.h"
-#include "chrome/renderer/extensions/renderer_extension_bindings.h"
#include "chrome/renderer/js_only_v8_extensions.h"
#include "chrome/renderer/render_view.h"
#include "grit/renderer_resources.h"
@@ -22,8 +21,7 @@ const char kExtensionName[] = "chrome/ExtensionProcessBindings";
const char* kExtensionDeps[] = {
BaseJsV8Extension::kName,
JsonJsV8Extension::kName,
- JsonSchemaJsV8Extension::kName,
- RendererExtensionBindings::kName,
+ JsonSchemaJsV8Extension::kName
};
class ExtensionImpl : public v8::Extension {
diff --git a/chrome/renderer/extensions/renderer_extension_bindings.cc b/chrome/renderer/extensions/renderer_extension_bindings.cc
index 8035422..d9a73e6 100755
--- a/chrome/renderer/extensions/renderer_extension_bindings.cc
+++ b/chrome/renderer/extensions/renderer_extension_bindings.cc
@@ -27,12 +27,13 @@ namespace {
// We use the generic interface so that unit tests can inject a mock.
RenderThreadBase* render_thread_ = NULL;
+const char* kExtensionName = "chrome/RendererExtensionBindings";
const char* kExtensionDeps[] = { EventBindings::kName };
class ExtensionImpl : public v8::Extension {
public:
ExtensionImpl()
- : v8::Extension(RendererExtensionBindings::kName,
+ : v8::Extension(kExtensionName,
GetStringResource<IDR_RENDERER_EXTENSION_BINDINGS_JS>(),
arraysize(kExtensionDeps), kExtensionDeps) {
}
@@ -75,9 +76,6 @@ class ExtensionImpl : public v8::Extension {
} // namespace
-const char* RendererExtensionBindings::kName =
- "chrome/RendererExtensionBindings";
-
v8::Extension* RendererExtensionBindings::Get(RenderThreadBase* render_thread) {
render_thread_ = render_thread;
return new ExtensionImpl();
diff --git a/chrome/renderer/extensions/renderer_extension_bindings.h b/chrome/renderer/extensions/renderer_extension_bindings.h
index 3fc1fb4..5ff474e 100755
--- a/chrome/renderer/extensions/renderer_extension_bindings.h
+++ b/chrome/renderer/extensions/renderer_extension_bindings.h
@@ -15,10 +15,6 @@ class RenderThreadBase;
// used by both web renderers and extension processes.
class RendererExtensionBindings {
public:
- // Name of extension, for dependencies.
- static const char* kName;
-
- // Creates an instance of the extension.
static v8::Extension* Get(RenderThreadBase* render_thread);
// Notify any listeners that a message channel has been opened to this
diff --git a/chrome/renderer/renderer_resources.grd b/chrome/renderer/renderer_resources.grd
index cda253b..e7084d5 100755
--- a/chrome/renderer/renderer_resources.grd
+++ b/chrome/renderer/renderer_resources.grd
@@ -1,6 +1,4 @@
<?xml version="1.0" encoding="UTF-8"?>
-<!-- This comment is only here because changes to resources are not picked up
-without changes to the corresponding grd file. -->
<grit latest_public_release="0" current_release="1">
<outputs>
<output filename="grit/renderer_resources.h" type="rc_header">
@@ -21,4 +19,4 @@ without changes to the corresponding grd file. -->
<include name="IDR_RENDERER_EXTENSION_BINDINGS_JS" file="resources\renderer_extension_bindings.js" type="BINDATA" />
</includes>
</release>
-</grit>
+</grit> \ No newline at end of file
diff --git a/chrome/renderer/resources/extension_process_bindings.js b/chrome/renderer/resources/extension_process_bindings.js
index 454a9b0..ff7ac7e 100644
--- a/chrome/renderer/resources/extension_process_bindings.js
+++ b/chrome/renderer/resources/extension_process_bindings.js
@@ -66,8 +66,6 @@ var chromium;
request(sargs, callbackId);
}
- //----------------------------------------------------------------------------
-
// Tabs
chromium.tabs = {};
// TODO(aa): This should eventually take an optional windowId param.
@@ -129,10 +127,4 @@ 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 fafd491..a392cf0 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,4 +62,6 @@ var chromium = chromium || {};
chromium.Extension.prototype.getURL = function(path) {
return "chrome-extension://" + this.id_ + "/" + path;
};
+
+ chromium.onconnect = new chromium.Event("channel-connect");
})();
diff --git a/chrome/renderer/user_script_slave.cc b/chrome/renderer/user_script_slave.cc
index 651e9ad..bd5a988 100644
--- a/chrome/renderer/user_script_slave.cc
+++ b/chrome/renderer/user_script_slave.cc
@@ -25,9 +25,7 @@ using WebKit::WebString;
static const char kUserScriptHead[] = "(function (unsafeWindow) {\n";
static const char kUserScriptTail[] = "\n})(window);";
-// Creates a convenient reference to a content script's parent extension.
-static const char kInitExtension[] =
- "chromium.extension = new chromium.Extension('%s')";
+static const char kInitSelf[] = "chromium.self = new chromium.Extension('%s')";
UserScriptSlave::UserScriptSlave()
: shared_memory_(NULL),
@@ -155,7 +153,7 @@ bool UserScriptSlave::InjectScripts(WebFrame* frame,
// ID.
sources.insert(sources.begin(),
WebScriptSource(WebString::fromUTF8(
- StringPrintf(kInitExtension, script->extension_id().c_str()))));
+ StringPrintf(kInitSelf, script->extension_id().c_str()))));
}
frame->ExecuteScriptInNewContext(&sources.front(), sources.size());