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/installed_loader.h" | 5 #include "chrome/browser/extensions/installed_loader.h" |
6 | 6 |
7 #include "base/files/file_path.h" | 7 #include "base/files/file_path.h" |
8 #include "base/metrics/histogram_macros.h" | 8 #include "base/metrics/histogram_macros.h" |
9 #include "base/metrics/sparse_histogram.h" | 9 #include "base/metrics/sparse_histogram.h" |
10 #include "base/strings/stringprintf.h" | 10 #include "base/strings/stringprintf.h" |
(...skipping 371 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
382 } else { | 382 } else { |
383 UMA_HISTOGRAM_ENUMERATION("Extensions.ExternalItemState", | 383 UMA_HISTOGRAM_ENUMERATION("Extensions.ExternalItemState", |
384 EXTERNAL_ITEM_NONWEBSTORE_ENABLED, | 384 EXTERNAL_ITEM_NONWEBSTORE_ENABLED, |
385 EXTERNAL_ITEM_MAX_ITEMS); | 385 EXTERNAL_ITEM_MAX_ITEMS); |
386 } | 386 } |
387 } | 387 } |
388 | 388 |
389 // From now on, don't count component extensions, since they are only | 389 // From now on, don't count component extensions, since they are only |
390 // extensions as an implementation detail. Continue to count unpacked | 390 // extensions as an implementation detail. Continue to count unpacked |
391 // extensions for a few metrics. | 391 // extensions for a few metrics. |
392 if (location == Manifest::COMPONENT) | 392 if (Manifest::IsComponentLocation(location)) |
393 continue; | 393 continue; |
394 | 394 |
395 // Histogram for non-webstore extensions overriding new tab page should | 395 // Histogram for non-webstore extensions overriding new tab page should |
396 // include unpacked extensions. | 396 // include unpacked extensions. |
397 if (!extension->from_webstore() && | 397 if (!extension->from_webstore() && |
398 URLOverrides::GetChromeURLOverrides(extension).count("newtab")) { | 398 URLOverrides::GetChromeURLOverrides(extension).count("newtab")) { |
399 ++non_webstore_ntp_override_count; | 399 ++non_webstore_ntp_override_count; |
400 } | 400 } |
401 | 401 |
402 // Don't count unpacked extensions anymore, either. | 402 // Don't count unpacked extensions anymore, either. |
(...skipping 207 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
610 int InstalledLoader::GetCreationFlags(const ExtensionInfo* info) { | 610 int InstalledLoader::GetCreationFlags(const ExtensionInfo* info) { |
611 int flags = extension_prefs_->GetCreationFlags(info->extension_id); | 611 int flags = extension_prefs_->GetCreationFlags(info->extension_id); |
612 if (!Manifest::IsUnpackedLocation(info->extension_location)) | 612 if (!Manifest::IsUnpackedLocation(info->extension_location)) |
613 flags |= Extension::REQUIRE_KEY; | 613 flags |= Extension::REQUIRE_KEY; |
614 if (extension_prefs_->AllowFileAccess(info->extension_id)) | 614 if (extension_prefs_->AllowFileAccess(info->extension_id)) |
615 flags |= Extension::ALLOW_FILE_ACCESS; | 615 flags |= Extension::ALLOW_FILE_ACCESS; |
616 return flags; | 616 return flags; |
617 } | 617 } |
618 | 618 |
619 } // namespace extensions | 619 } // namespace extensions |
OLD | NEW |