Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(52)

Side by Side Diff: chrome/browser/extensions/extension_gcm_app_handler.cc

Issue 2111973002: Add support for GCM subtypes to desktop Instance ID implementation (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@iid9push
Patch Set: Address review comments Created 4 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chrome/browser/extensions/extension_gcm_app_handler.h" 5 #include "chrome/browser/extensions/extension_gcm_app_handler.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/lazy_instance.h" 8 #include "base/lazy_instance.h"
9 #include "base/location.h" 9 #include "base/location.h"
10 #include "base/single_thread_task_runner.h" 10 #include "base/single_thread_task_runner.h"
(...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after
134 RemoveAppHandler(extension->id()); 134 RemoveAppHandler(extension->id());
135 } 135 }
136 136
137 void ExtensionGCMAppHandler::OnExtensionUninstalled( 137 void ExtensionGCMAppHandler::OnExtensionUninstalled(
138 content::BrowserContext* browser_context, 138 content::BrowserContext* browser_context,
139 const Extension* extension, 139 const Extension* extension,
140 extensions::UninstallReason reason) { 140 extensions::UninstallReason reason) {
141 if (IsGCMPermissionEnabled(extension)) { 141 if (IsGCMPermissionEnabled(extension)) {
142 // Let's first remove InstanceID data. GCM unregistration will be triggered 142 // Let's first remove InstanceID data. GCM unregistration will be triggered
143 // after the asynchronous call is returned in OnDeleteIDCompleted. 143 // after the asynchronous call is returned in OnDeleteIDCompleted.
144 GetInstanceIDDriver()->GetInstanceID(extension->id())->DeleteID( 144 GetInstanceIDDriver()
145 base::Bind(&ExtensionGCMAppHandler::OnDeleteIDCompleted, 145 ->GetInstanceIDForExtensions(extension->id())
146 weak_factory_.GetWeakPtr(), 146 ->DeleteID(base::Bind(&ExtensionGCMAppHandler::OnDeleteIDCompleted,
147 extension->id())); 147 weak_factory_.GetWeakPtr(), extension->id()));
148 } 148 }
149 } 149 }
150 150
151 void ExtensionGCMAppHandler::AddDummyAppHandler() { 151 void ExtensionGCMAppHandler::AddDummyAppHandler() {
152 AddAppHandler(kDummyAppId); 152 AddAppHandler(kDummyAppId);
153 } 153 }
154 154
155 void ExtensionGCMAppHandler::RemoveDummyAppHandler() { 155 void ExtensionGCMAppHandler::RemoveDummyAppHandler() {
156 RemoveAppHandler(kDummyAppId); 156 RemoveAppHandler(kDummyAppId);
157 } 157 }
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
193 193
194 void ExtensionGCMAppHandler::AddAppHandler(const std::string& app_id) { 194 void ExtensionGCMAppHandler::AddAppHandler(const std::string& app_id) {
195 GetGCMDriver()->AddAppHandler(app_id, this); 195 GetGCMDriver()->AddAppHandler(app_id, this);
196 } 196 }
197 197
198 void ExtensionGCMAppHandler::RemoveAppHandler(const std::string& app_id) { 198 void ExtensionGCMAppHandler::RemoveAppHandler(const std::string& app_id) {
199 GetGCMDriver()->RemoveAppHandler(app_id); 199 GetGCMDriver()->RemoveAppHandler(app_id);
200 } 200 }
201 201
202 } // namespace extensions 202 } // namespace extensions
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698