| Index: chrome/renderer/extensions/runtime_custom_bindings.cc
|
| diff --git a/chrome/renderer/extensions/runtime_custom_bindings.cc b/chrome/renderer/extensions/runtime_custom_bindings.cc
|
| index fd92526eb77f99d76d92c3425090a2366a41d10d..ac244b15a947e06744ebf986de45169c1a54a43d 100644
|
| --- a/chrome/renderer/extensions/runtime_custom_bindings.cc
|
| +++ b/chrome/renderer/extensions/runtime_custom_bindings.cc
|
| @@ -58,7 +58,13 @@ void RuntimeCustomBindings::OpenChannelToExtension(
|
| CHECK(args[0]->IsString() && args[1]->IsString() && args[2]->IsBoolean());
|
|
|
| ExtensionMsg_ExternalConnectionInfo info;
|
| - info.source_id = context()->GetExtensionID();
|
| +
|
| + // For messaging APIs, hosted apps should be considered a web page so hide
|
| + // its extension ID.
|
| + const Extension* extension = context()->extension();
|
| + if (extension && !extension->is_hosted_app())
|
| + info.source_id = extension->id();
|
| +
|
| info.target_id = *v8::String::Utf8Value(args[0]->ToString());
|
| info.source_url = context()->GetURL();
|
| std::string channel_name = *v8::String::Utf8Value(args[1]->ToString());
|
|
|