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