| 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 <stddef.h> | 7 #include <stddef.h> |
| 8 #include <memory> | 8 #include <memory> |
| 9 #include <string> | 9 #include <string> |
| 10 #include <vector> | 10 #include <vector> |
| (...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 125 return BACKGROUND_PAGE_PERSISTENT; | 125 return BACKGROUND_PAGE_PERSISTENT; |
| 126 return EVENT_PAGE; | 126 return EVENT_PAGE; |
| 127 } | 127 } |
| 128 | 128 |
| 129 // Records the creation flags of an extension grouped by | 129 // Records the creation flags of an extension grouped by |
| 130 // Extension::InitFromValueFlags. | 130 // Extension::InitFromValueFlags. |
| 131 void RecordCreationFlags(const Extension* extension) { | 131 void RecordCreationFlags(const Extension* extension) { |
| 132 for (int i = 0; i < Extension::kInitFromValueFlagBits; ++i) { | 132 for (int i = 0; i < Extension::kInitFromValueFlagBits; ++i) { |
| 133 int flag = 1 << i; | 133 int flag = 1 << i; |
| 134 if (extension->creation_flags() & flag) { | 134 if (extension->creation_flags() & flag) { |
| 135 UMA_HISTOGRAM_ENUMERATION( | 135 UMA_HISTOGRAM_EXACT_LINEAR("Extensions.LoadCreationFlags", i, |
| 136 "Extensions.LoadCreationFlags", i, Extension::kInitFromValueFlagBits); | 136 Extension::kInitFromValueFlagBits); |
| 137 } | 137 } |
| 138 } | 138 } |
| 139 } | 139 } |
| 140 | 140 |
| 141 // Helper to record a single disable reason histogram value (see | 141 // Helper to record a single disable reason histogram value (see |
| 142 // RecordDisableReasons below). | 142 // RecordDisableReasons below). |
| 143 void RecordDisbleReasonHistogram(int reason) { | 143 void RecordDisbleReasonHistogram(int reason) { |
| 144 UMA_HISTOGRAM_SPARSE_SLOWLY("Extensions.DisableReason", reason); | 144 UMA_HISTOGRAM_SPARSE_SLOWLY("Extensions.DisableReason", reason); |
| 145 } | 145 } |
| 146 | 146 |
| (...skipping 477 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 624 int InstalledLoader::GetCreationFlags(const ExtensionInfo* info) { | 624 int InstalledLoader::GetCreationFlags(const ExtensionInfo* info) { |
| 625 int flags = extension_prefs_->GetCreationFlags(info->extension_id); | 625 int flags = extension_prefs_->GetCreationFlags(info->extension_id); |
| 626 if (!Manifest::IsUnpackedLocation(info->extension_location)) | 626 if (!Manifest::IsUnpackedLocation(info->extension_location)) |
| 627 flags |= Extension::REQUIRE_KEY; | 627 flags |= Extension::REQUIRE_KEY; |
| 628 if (extension_prefs_->AllowFileAccess(info->extension_id)) | 628 if (extension_prefs_->AllowFileAccess(info->extension_id)) |
| 629 flags |= Extension::ALLOW_FILE_ACCESS; | 629 flags |= Extension::ALLOW_FILE_ACCESS; |
| 630 return flags; | 630 return flags; |
| 631 } | 631 } |
| 632 | 632 |
| 633 } // namespace extensions | 633 } // namespace extensions |
| OLD | NEW |