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.h" | 8 #include "base/metrics/histogram.h" |
9 #include "base/stringprintf.h" | 9 #include "base/stringprintf.h" |
10 #include "base/threading/thread_restrictions.h" | 10 #include "base/threading/thread_restrictions.h" |
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
48 NUM_MANIFEST_RELOAD_REASONS | 48 NUM_MANIFEST_RELOAD_REASONS |
49 }; | 49 }; |
50 | 50 |
51 ManifestReloadReason ShouldReloadExtensionManifest(const ExtensionInfo& info) { | 51 ManifestReloadReason ShouldReloadExtensionManifest(const ExtensionInfo& info) { |
52 // Always reload manifests of unpacked extensions, because they can change | 52 // Always reload manifests of unpacked extensions, because they can change |
53 // on disk independent of the manifest in our prefs. | 53 // on disk independent of the manifest in our prefs. |
54 if (Manifest::IsUnpackedLocation(info.extension_location)) | 54 if (Manifest::IsUnpackedLocation(info.extension_location)) |
55 return UNPACKED_DIR; | 55 return UNPACKED_DIR; |
56 | 56 |
57 // Reload the manifest if it needs to be relocalized. | 57 // Reload the manifest if it needs to be relocalized. |
58 if (extension_l10n_util::ShouldRelocalizeManifest(info)) | 58 if (extension_l10n_util::ShouldRelocalizeManifest( |
| 59 info.extension_manifest.get())) |
59 return NEEDS_RELOCALIZATION; | 60 return NEEDS_RELOCALIZATION; |
60 | 61 |
61 return NOT_NEEDED; | 62 return NOT_NEEDED; |
62 } | 63 } |
63 | 64 |
64 void DispatchOnInstalledEvent( | 65 void DispatchOnInstalledEvent( |
65 Profile* profile, | 66 Profile* profile, |
66 const std::string& extension_id, | 67 const std::string& extension_id, |
67 const Version& old_version, | 68 const Version& old_version, |
68 bool chrome_updated) { | 69 bool chrome_updated) { |
(...skipping 309 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
378 int InstalledLoader::GetCreationFlags(const ExtensionInfo* info) { | 379 int InstalledLoader::GetCreationFlags(const ExtensionInfo* info) { |
379 int flags = extension_prefs_->GetCreationFlags(info->extension_id); | 380 int flags = extension_prefs_->GetCreationFlags(info->extension_id); |
380 if (!Manifest::IsUnpackedLocation(info->extension_location)) | 381 if (!Manifest::IsUnpackedLocation(info->extension_location)) |
381 flags |= Extension::REQUIRE_KEY; | 382 flags |= Extension::REQUIRE_KEY; |
382 if (extension_prefs_->AllowFileAccess(info->extension_id)) | 383 if (extension_prefs_->AllowFileAccess(info->extension_id)) |
383 flags |= Extension::ALLOW_FILE_ACCESS; | 384 flags |= Extension::ALLOW_FILE_ACCESS; |
384 return flags; | 385 return flags; |
385 } | 386 } |
386 | 387 |
387 } // namespace extensions | 388 } // namespace extensions |
OLD | NEW |