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

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

Issue 398083002: Add "UninstallReason" parameter to ExtensionRegistryObserver::OnExtensionUninstalled. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix header file. Created 6 years, 5 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 "chrome/browser/chrome_notification_types.h" 10 #include "chrome/browser/chrome_notification_types.h"
(...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after
124 FROM_HERE, 124 FROM_HERE,
125 base::Bind(&ExtensionGCMAppHandler::RemoveDummyAppHandler, 125 base::Bind(&ExtensionGCMAppHandler::RemoveDummyAppHandler,
126 weak_factory_.GetWeakPtr())); 126 weak_factory_.GetWeakPtr()));
127 } 127 }
128 128
129 RemoveAppHandler(extension->id()); 129 RemoveAppHandler(extension->id());
130 } 130 }
131 131
132 void ExtensionGCMAppHandler::OnExtensionUninstalled( 132 void ExtensionGCMAppHandler::OnExtensionUninstalled(
133 content::BrowserContext* browser_context, 133 content::BrowserContext* browser_context,
134 const Extension* extension) { 134 const Extension* extension,
135 extensions::UninstallReason reason) {
135 if (IsGCMPermissionEnabled(extension)) { 136 if (IsGCMPermissionEnabled(extension)) {
136 GetGCMDriver()->Unregister( 137 GetGCMDriver()->Unregister(
137 extension->id(), 138 extension->id(),
138 base::Bind(&ExtensionGCMAppHandler::OnUnregisterCompleted, 139 base::Bind(&ExtensionGCMAppHandler::OnUnregisterCompleted,
139 weak_factory_.GetWeakPtr(), 140 weak_factory_.GetWeakPtr(),
140 extension->id())); 141 extension->id()));
141 RemoveAppHandler(extension->id()); 142 RemoveAppHandler(extension->id());
142 } 143 }
143 } 144 }
144 145
(...skipping 16 matching lines...) Expand all
161 162
162 void ExtensionGCMAppHandler::AddAppHandler(const std::string& app_id) { 163 void ExtensionGCMAppHandler::AddAppHandler(const std::string& app_id) {
163 GetGCMDriver()->AddAppHandler(app_id, this); 164 GetGCMDriver()->AddAppHandler(app_id, this);
164 } 165 }
165 166
166 void ExtensionGCMAppHandler::RemoveAppHandler(const std::string& app_id) { 167 void ExtensionGCMAppHandler::RemoveAppHandler(const std::string& app_id) {
167 GetGCMDriver()->RemoveAppHandler(app_id); 168 GetGCMDriver()->RemoveAppHandler(app_id);
168 } 169 }
169 170
170 } // namespace extensions 171 } // namespace extensions
OLDNEW
« no previous file with comments | « chrome/browser/extensions/extension_gcm_app_handler.h ('k') | chrome/browser/extensions/extension_gcm_app_handler_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698