summaryrefslogtreecommitdiffstats
path: root/chrome/renderer/user_script_slave.cc
diff options
context:
space:
mode:
authormpcomplete@chromium.org <mpcomplete@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-07-09 19:26:35 +0000
committermpcomplete@chromium.org <mpcomplete@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-07-09 19:26:35 +0000
commit0f605396ab522e1f2f48824c42bb784e9784d479 (patch)
tree062f717563b296a520791bd29c25fd21038b2920 /chrome/renderer/user_script_slave.cc
parent609a1ec621cdcce03328b56e4b744ce9498b2177 (diff)
downloadchromium_src-0f605396ab522e1f2f48824c42bb784e9784d479.zip
chromium_src-0f605396ab522e1f2f48824c42bb784e9784d479.tar.gz
chromium_src-0f605396ab522e1f2f48824c42bb784e9784d479.tar.bz2
Make the API to open a message channel symmetric, so it works the same whether opening from a tab or extension.
Also, move the callback handling back to extension_process_bindings, since I didn't need it in event_bindings to implement this, and it didn't make sense there anyway. BUG=12461 TEST=no Review URL: http://codereview.chromium.org/149237 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@20296 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/renderer/user_script_slave.cc')
-rw-r--r--chrome/renderer/user_script_slave.cc5
1 files changed, 4 insertions, 1 deletions
diff --git a/chrome/renderer/user_script_slave.cc b/chrome/renderer/user_script_slave.cc
index fa4eb7d..afd065f 100644
--- a/chrome/renderer/user_script_slave.cc
+++ b/chrome/renderer/user_script_slave.cc
@@ -26,8 +26,11 @@ static const char kUserScriptHead[] = "(function (unsafeWindow) {\n";
static const char kUserScriptTail[] = "\n})(window);";
// Creates a convenient reference to a content script's parent extension.
+// TODO(mpcomplete): self.onConnect is deprecated. Remove it at 1.0.
+// http://code.google.com/p/chromium/issues/detail?id=16356
static const char kInitExtension[] =
- "chrome.extension = new chrome.Extension('%s')";
+ "chrome.extension = new chrome.Extension('%s');"
+ "chrome.self.onConnect = chrome.extension.onConnect;";
UserScriptSlave::UserScriptSlave()
: shared_memory_(NULL),