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 485 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
496 ++page_action_count; | 496 ++page_action_count; |
497 | 497 |
498 if (extension_action_manager->GetBrowserAction(*extension)) | 498 if (extension_action_manager->GetBrowserAction(*extension)) |
499 ++browser_action_count; | 499 ++browser_action_count; |
500 | 500 |
501 if (SupervisedUserInfo::IsContentPack(extension)) | 501 if (SupervisedUserInfo::IsContentPack(extension)) |
502 ++content_pack_count; | 502 ++content_pack_count; |
503 | 503 |
504 RecordCreationFlags(extension); | 504 RecordCreationFlags(extension); |
505 | 505 |
506 ExtensionService::RecordPermissionMessagesHistogram( | 506 ExtensionService::RecordPermissionMessagesHistogram(extension, "Load"); |
507 extension, "Extensions.Permissions_Load2"); | |
508 | 507 |
509 // For incognito and file access, skip anything that doesn't appear in | 508 // For incognito and file access, skip anything that doesn't appear in |
510 // settings. Also, policy-installed (and unpacked of course, checked above) | 509 // settings. Also, policy-installed (and unpacked of course, checked above) |
511 // extensions are boring. | 510 // extensions are boring. |
512 if (extension->ShouldDisplayInExtensionSettings() && | 511 if (extension->ShouldDisplayInExtensionSettings() && |
513 !Manifest::IsPolicyLocation(extension->location())) { | 512 !Manifest::IsPolicyLocation(extension->location())) { |
514 if (extension->can_be_incognito_enabled()) { | 513 if (extension->can_be_incognito_enabled()) { |
515 if (util::IsIncognitoEnabled(extension->id(), profile)) | 514 if (util::IsIncognitoEnabled(extension->id(), profile)) |
516 ++incognito_allowed_count; | 515 ++incognito_allowed_count; |
517 else | 516 else |
(...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
616 int InstalledLoader::GetCreationFlags(const ExtensionInfo* info) { | 615 int InstalledLoader::GetCreationFlags(const ExtensionInfo* info) { |
617 int flags = extension_prefs_->GetCreationFlags(info->extension_id); | 616 int flags = extension_prefs_->GetCreationFlags(info->extension_id); |
618 if (!Manifest::IsUnpackedLocation(info->extension_location)) | 617 if (!Manifest::IsUnpackedLocation(info->extension_location)) |
619 flags |= Extension::REQUIRE_KEY; | 618 flags |= Extension::REQUIRE_KEY; |
620 if (extension_prefs_->AllowFileAccess(info->extension_id)) | 619 if (extension_prefs_->AllowFileAccess(info->extension_id)) |
621 flags |= Extension::ALLOW_FILE_ACCESS; | 620 flags |= Extension::ALLOW_FILE_ACCESS; |
622 return flags; | 621 return flags; |
623 } | 622 } |
624 | 623 |
625 } // namespace extensions | 624 } // namespace extensions |
OLD | NEW |