Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(826)

Side by Side Diff: chrome/browser/extensions/installed_loader.cc

Issue 12578008: Move CrxFile, FileReader, ExtensionResource to src/extensions. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 7 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « chrome/browser/extensions/image_loader_unittest.cc ('k') | chrome/browser/extensions/sandboxed_unpacker.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698