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

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

Issue 980353003: Extensions: Switch to new permission message system, part I (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: cleanup;rebase Created 5 years, 9 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) 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
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
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 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698