Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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_service.h" | 5 #include "chrome/browser/extensions/extension_service.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <iterator> | 8 #include <iterator> |
| 9 #include <set> | 9 #include <set> |
| 10 | 10 |
| (...skipping 1000 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1011 // Since this is called from multiple sources, and since the histogram macros | 1011 // Since this is called from multiple sources, and since the histogram macros |
| 1012 // use statics, we need to manually lookup the histogram ourselves. | 1012 // use statics, we need to manually lookup the histogram ourselves. |
| 1013 base::HistogramBase* counter = base::LinearHistogram::FactoryGet( | 1013 base::HistogramBase* counter = base::LinearHistogram::FactoryGet( |
| 1014 histogram, | 1014 histogram, |
| 1015 1, | 1015 1, |
| 1016 PermissionMessage::kEnumBoundary, | 1016 PermissionMessage::kEnumBoundary, |
| 1017 PermissionMessage::kEnumBoundary + 1, | 1017 PermissionMessage::kEnumBoundary + 1, |
| 1018 base::HistogramBase::kUmaTargetedHistogramFlag); | 1018 base::HistogramBase::kUmaTargetedHistogramFlag); |
| 1019 | 1019 |
| 1020 PermissionMessages permissions = | 1020 PermissionMessages permissions = |
| 1021 extension->permissions_data()->GetPermissionMessages(); | 1021 extension->permissions_data()->GetLegacyPermissionMessages(); |
|
Marc Treib
2015/03/09 14:08:02
Unfortunately, we can't just switch to the new sys
Yoyo Zhou
2015/03/11 01:33:23
Can we introduce a new histogram? I imagine we are
Marc Treib
2015/03/11 13:08:52
Yes, I think we'll introduce a new histogram to (e
| |
| 1022 if (permissions.empty()) { | 1022 if (permissions.empty()) { |
| 1023 counter->Add(PermissionMessage::kNone); | 1023 counter->Add(PermissionMessage::kNone); |
| 1024 } else { | 1024 } else { |
| 1025 for (PermissionMessages::iterator it = permissions.begin(); | 1025 for (PermissionMessages::iterator it = permissions.begin(); |
| 1026 it != permissions.end(); ++it) | 1026 it != permissions.end(); ++it) |
| 1027 counter->Add(it->id()); | 1027 counter->Add(it->id()); |
| 1028 } | 1028 } |
| 1029 } | 1029 } |
| 1030 | 1030 |
| 1031 void ExtensionService::NotifyExtensionLoaded(const Extension* extension) { | 1031 void ExtensionService::NotifyExtensionLoaded(const Extension* extension) { |
| (...skipping 1550 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 2582 } | 2582 } |
| 2583 | 2583 |
| 2584 void ExtensionService::OnProfileDestructionStarted() { | 2584 void ExtensionService::OnProfileDestructionStarted() { |
| 2585 ExtensionIdSet ids_to_unload = registry_->enabled_extensions().GetIDs(); | 2585 ExtensionIdSet ids_to_unload = registry_->enabled_extensions().GetIDs(); |
| 2586 for (ExtensionIdSet::iterator it = ids_to_unload.begin(); | 2586 for (ExtensionIdSet::iterator it = ids_to_unload.begin(); |
| 2587 it != ids_to_unload.end(); | 2587 it != ids_to_unload.end(); |
| 2588 ++it) { | 2588 ++it) { |
| 2589 UnloadExtension(*it, UnloadedExtensionInfo::REASON_PROFILE_SHUTDOWN); | 2589 UnloadExtension(*it, UnloadedExtensionInfo::REASON_PROFILE_SHUTDOWN); |
| 2590 } | 2590 } |
| 2591 } | 2591 } |
| OLD | NEW |