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

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

Issue 10694056: CPM Extension Uninstall Watching (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Latest master for cq Created 8 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 (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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/state_store.h" 5 #include "chrome/browser/extensions/state_store.h"
6 6
7 #include "chrome/common/chrome_notification_types.h" 7 #include "chrome/common/chrome_notification_types.h"
8 #include "chrome/common/extensions/extension.h" 8 #include "chrome/common/extensions/extension.h"
9 #include "content/public/browser/notification_service.h" 9 #include "content/public/browser/notification_service.h"
10 #include "content/public/browser/notification_types.h" 10 #include "content/public/browser/notification_types.h"
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
56 store_.Set(GetFullKey(extension_id, key), value.Pass()); 56 store_.Set(GetFullKey(extension_id, key), value.Pass());
57 } 57 }
58 58
59 void StateStore::Observe(int type, 59 void StateStore::Observe(int type,
60 const content::NotificationSource& source, 60 const content::NotificationSource& source,
61 const content::NotificationDetails& details) { 61 const content::NotificationDetails& details) {
62 std::string extension_id; 62 std::string extension_id;
63 63
64 switch (type) { 64 switch (type) {
65 case chrome::NOTIFICATION_EXTENSION_INSTALLED: 65 case chrome::NOTIFICATION_EXTENSION_INSTALLED:
66 case chrome::NOTIFICATION_EXTENSION_UNINSTALLED:
66 extension_id = content::Details<const Extension>(details).ptr()->id(); 67 extension_id = content::Details<const Extension>(details).ptr()->id();
67 break; 68 break;
68 case chrome::NOTIFICATION_EXTENSION_UNINSTALLED:
69 extension_id =
70 *content::Details<const std::string>(details).ptr();
71 break;
72 default: 69 default:
73 NOTREACHED(); 70 NOTREACHED();
74 return; 71 return;
75 } 72 }
76 73
77 for (std::set<std::string>::iterator key = registered_keys_.begin(); 74 for (std::set<std::string>::iterator key = registered_keys_.begin();
78 key != registered_keys_.end(); ++key) { 75 key != registered_keys_.end(); ++key) {
79 store_.Remove(GetFullKey(extension_id, *key)); 76 store_.Remove(GetFullKey(extension_id, *key));
80 } 77 }
81 } 78 }
82 79
83 } // namespace extensions 80 } // namespace extensions
OLDNEW
« no previous file with comments | « chrome/browser/extensions/extension_service.cc ('k') | chrome/browser/performance_monitor/performance_monitor.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698