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

Side by Side Diff: chrome/browser/metrics/extensions_metrics_provider.cc

Issue 1127133006: Extract InstallVerifier from ExtensionSystem. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 7 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
« no previous file with comments | « chrome/browser/extensions/webstore_installer.cc ('k') | chrome/chrome_browser_extensions.gypi » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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/metrics/extensions_metrics_provider.h" 5 #include "chrome/browser/metrics/extensions_metrics_provider.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <set> 8 #include <set>
9 #include <vector> 9 #include <vector>
10 10
(...skipping 173 matching lines...) Expand 10 before | Expand all | Expand 10 after
184 if (!profile_manager) 184 if (!profile_manager)
185 return; 185 return;
186 186
187 ExtensionState state = NO_EXTENSIONS; 187 ExtensionState state = NO_EXTENSIONS;
188 188
189 // The off-store metric includes information from all loaded profiles at the 189 // The off-store metric includes information from all loaded profiles at the
190 // time when this metric is generated. 190 // time when this metric is generated.
191 std::vector<Profile*> profiles = profile_manager->GetLoadedProfiles(); 191 std::vector<Profile*> profiles = profile_manager->GetLoadedProfiles();
192 for (size_t i = 0u; i < profiles.size() && state < OFF_STORE; ++i) { 192 for (size_t i = 0u; i < profiles.size() && state < OFF_STORE; ++i) {
193 extensions::InstallVerifier* verifier = 193 extensions::InstallVerifier* verifier =
194 extensions::ExtensionSystem::Get(profiles[i])->install_verifier(); 194 extensions::InstallVerifier::Get(profiles[i]);
195 195
196 scoped_ptr<extensions::ExtensionSet> extensions( 196 scoped_ptr<extensions::ExtensionSet> extensions(
197 GetInstalledExtensions(profiles[i])); 197 GetInstalledExtensions(profiles[i]));
198 if (!extensions) 198 if (!extensions)
199 continue; 199 continue;
200 200
201 // Combine the state from each profile, always favoring the higher state as 201 // Combine the state from each profile, always favoring the higher state as
202 // defined by the order of ExtensionState. 202 // defined by the order of ExtensionState.
203 state = std::max(state, CheckForOffStore(*extensions.get(), *verifier)); 203 state = std::max(state, CheckForOffStore(*extensions.get(), *verifier));
204 } 204 }
(...skipping 21 matching lines...) Expand all
226 it != extensions->end(); 226 it != extensions->end();
227 ++it) { 227 ++it) {
228 buckets.insert(HashExtension((*it)->id(), client_key)); 228 buckets.insert(HashExtension((*it)->id(), client_key));
229 } 229 }
230 230
231 for (std::set<int>::const_iterator it = buckets.begin(); it != buckets.end(); 231 for (std::set<int>::const_iterator it = buckets.begin(); it != buckets.end();
232 ++it) { 232 ++it) {
233 system_profile->add_occupied_extension_bucket(*it); 233 system_profile->add_occupied_extension_bucket(*it);
234 } 234 }
235 } 235 }
OLDNEW
« no previous file with comments | « chrome/browser/extensions/webstore_installer.cc ('k') | chrome/chrome_browser_extensions.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698