| Index: chrome/browser/extensions/extension_tab_helper.cc
|
| diff --git a/chrome/browser/extensions/extension_tab_helper.cc b/chrome/browser/extensions/extension_tab_helper.cc
|
| index 1d1aa08fe0cc5773b4b056b836df1a6e041b24c4..25fe032a20ae6febb746252ab650236ef2ad4e9b 100644
|
| --- a/chrome/browser/extensions/extension_tab_helper.cc
|
| +++ b/chrome/browser/extensions/extension_tab_helper.cc
|
| @@ -179,8 +179,8 @@ void ExtensionTabHelper::OnGetAppNotifyChannel(
|
| ExtensionAPIPermission::kExperimental) &&
|
| process_map->Contains(extension->id(), process->GetID());
|
| if (!allowed) {
|
| - AppNotifyChannelSetupComplete("", "permission_error", return_route_id,
|
| - callback_id);
|
| + Send(new ExtensionMsg_GetAppNotifyChannelResponse(
|
| + return_route_id, "", "permission_error", callback_id));
|
| return;
|
| }
|
|
|
| @@ -201,10 +201,23 @@ void ExtensionTabHelper::OnGetAppNotifyChannel(
|
| }
|
|
|
| void ExtensionTabHelper::AppNotifyChannelSetupComplete(
|
| - const std::string& client_id, const std::string& error, int return_route_id,
|
| - int callback_id) {
|
| + const std::string& channel_id,
|
| + const std::string& error,
|
| + const AppNotifyChannelSetup* setup) {
|
| + CHECK(setup);
|
| +
|
| + // If the setup was successful, record that fact in ExtensionService.
|
| + if (!channel_id.empty() && error.empty()) {
|
| + Profile* profile =
|
| + Profile::FromBrowserContext(tab_contents()->browser_context());
|
| + ExtensionService* service = profile->GetExtensionService();
|
| + if (service->GetExtensionById(setup->extension_id(), true))
|
| + service->SetAppNotificationSetupDone(setup->extension_id(),
|
| + setup->client_id());
|
| + }
|
| +
|
| Send(new ExtensionMsg_GetAppNotifyChannelResponse(
|
| - return_route_id, client_id, error, callback_id));
|
| + setup->return_route_id(), channel_id, error, setup->callback_id()));
|
| }
|
|
|
| void ExtensionTabHelper::OnRequest(
|
|
|