diff options
author | aa@chromium.org <aa@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-04-16 00:05:52 +0000 |
---|---|---|
committer | aa@chromium.org <aa@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-04-16 00:05:52 +0000 |
commit | 17bc2fda0ad39f2d3599de486ee065986a33c00c (patch) | |
tree | 99349656ead85591e448b7be62c932fb4682c53a /chrome/renderer/user_script_slave.cc | |
parent | 66f4409a9cd01bf8f622e62fd4403bd9c541967f (diff) | |
download | chromium_src-17bc2fda0ad39f2d3599de486ee065986a33c00c.zip chromium_src-17bc2fda0ad39f2d3599de486ee065986a33c00c.tar.gz chromium_src-17bc2fda0ad39f2d3599de486ee065986a33c00c.tar.bz2 |
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@13816 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/renderer/user_script_slave.cc')
-rw-r--r-- | chrome/renderer/user_script_slave.cc | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/chrome/renderer/user_script_slave.cc b/chrome/renderer/user_script_slave.cc index bd5a988..651e9ad 100644 --- a/chrome/renderer/user_script_slave.cc +++ b/chrome/renderer/user_script_slave.cc @@ -25,7 +25,9 @@ using WebKit::WebString; static const char kUserScriptHead[] = "(function (unsafeWindow) {\n"; static const char kUserScriptTail[] = "\n})(window);"; -static const char kInitSelf[] = "chromium.self = new chromium.Extension('%s')"; +// Creates a convenient reference to a content script's parent extension. +static const char kInitExtension[] = + "chromium.extension = new chromium.Extension('%s')"; UserScriptSlave::UserScriptSlave() : shared_memory_(NULL), @@ -153,7 +155,7 @@ bool UserScriptSlave::InjectScripts(WebFrame* frame, // ID. sources.insert(sources.begin(), WebScriptSource(WebString::fromUTF8( - StringPrintf(kInitSelf, script->extension_id().c_str())))); + StringPrintf(kInitExtension, script->extension_id().c_str())))); } frame->ExecuteScriptInNewContext(&sources.front(), sources.size()); |