Chromium Code Reviews| OLD | NEW |
|---|---|
| 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 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 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 extension_id = content::Details<const Extension>(details).ptr()->id(); | 66 extension_id = content::Details<const Extension>(details).ptr()->id(); |
| 67 break; | 67 break; |
| 68 case chrome::NOTIFICATION_EXTENSION_UNINSTALLED: | 68 case chrome::NOTIFICATION_EXTENSION_UNINSTALLED: |
|
Yoyo Zhou
2012/07/09 17:06:37
Should collapse this with the previous case.
Devlin
2012/07/09 20:48:26
Done.
| |
| 69 extension_id = | 69 extension_id = |
| 70 *content::Details<const std::string>(details).ptr(); | 70 content::Details<const Extension>(details).ptr()->id(); |
| 71 break; | 71 break; |
| 72 default: | 72 default: |
| 73 NOTREACHED(); | 73 NOTREACHED(); |
| 74 return; | 74 return; |
| 75 } | 75 } |
| 76 | 76 |
| 77 for (std::set<std::string>::iterator key = registered_keys_.begin(); | 77 for (std::set<std::string>::iterator key = registered_keys_.begin(); |
| 78 key != registered_keys_.end(); ++key) { | 78 key != registered_keys_.end(); ++key) { |
| 79 store_.Remove(GetFullKey(extension_id, *key)); | 79 store_.Remove(GetFullKey(extension_id, *key)); |
| 80 } | 80 } |
| 81 } | 81 } |
| 82 | 82 |
| 83 } // namespace extensions | 83 } // namespace extensions |
| OLD | NEW |