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

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

Issue 156843004: Remove ExtensionService::extension_prefs() (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix UserScriptListenerTests.MultiProfile Created 6 years, 10 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/strings/stringprintf.h" 9 #include "base/strings/stringprintf.h"
10 #include "base/strings/utf_string_conversions.h" 10 #include "base/strings/utf_string_conversions.h"
(...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after
112 if (BackgroundInfo::HasPersistentBackgroundPage(extension)) 112 if (BackgroundInfo::HasPersistentBackgroundPage(extension))
113 return BACKGROUND_PAGE_PERSISTENT; 113 return BACKGROUND_PAGE_PERSISTENT;
114 return EVENT_PAGE; 114 return EVENT_PAGE;
115 } 115 }
116 116
117 } // namespace 117 } // namespace
118 118
119 InstalledLoader::InstalledLoader(ExtensionService* extension_service) 119 InstalledLoader::InstalledLoader(ExtensionService* extension_service)
120 : extension_service_(extension_service), 120 : extension_service_(extension_service),
121 extension_registry_(ExtensionRegistry::Get(extension_service->profile())), 121 extension_registry_(ExtensionRegistry::Get(extension_service->profile())),
122 extension_prefs_(extension_service->extension_prefs()) {} 122 extension_prefs_(ExtensionPrefs::Get(extension_service->profile())) {}
123 123
124 InstalledLoader::~InstalledLoader() { 124 InstalledLoader::~InstalledLoader() {
125 } 125 }
126 126
127 void InstalledLoader::Load(const ExtensionInfo& info, bool write_to_prefs) { 127 void InstalledLoader::Load(const ExtensionInfo& info, bool write_to_prefs) {
128 std::string error; 128 std::string error;
129 scoped_refptr<const Extension> extension(NULL); 129 scoped_refptr<const Extension> extension(NULL);
130 if (info.extension_manifest) { 130 if (info.extension_manifest) {
131 extension = Extension::Create( 131 extension = Extension::Create(
132 info.extension_path, 132 info.extension_path,
(...skipping 272 matching lines...) Expand 10 before | Expand all | Expand 10 after
405 ++content_pack_count; 405 ++content_pack_count;
406 406
407 extension_service_->RecordPermissionMessagesHistogram( 407 extension_service_->RecordPermissionMessagesHistogram(
408 ex->get(), "Extensions.Permissions_Load"); 408 ex->get(), "Extensions.Permissions_Load");
409 } 409 }
410 410
411 const ExtensionSet& disabled_extensions = 411 const ExtensionSet& disabled_extensions =
412 extension_registry_->disabled_extensions(); 412 extension_registry_->disabled_extensions();
413 for (ex = disabled_extensions.begin(); ex != disabled_extensions.end(); 413 for (ex = disabled_extensions.begin(); ex != disabled_extensions.end();
414 ++ex) { 414 ++ex) {
415 if (extension_service_->extension_prefs()-> 415 if (extension_prefs_->DidExtensionEscalatePermissions((*ex)->id())) {
416 DidExtensionEscalatePermissions((*ex)->id())) {
417 ++disabled_for_permissions_count; 416 ++disabled_for_permissions_count;
418 } 417 }
419 if (Manifest::IsExternalLocation((*ex)->location())) { 418 if (Manifest::IsExternalLocation((*ex)->location())) {
420 // See loop above for ENABLED. 419 // See loop above for ENABLED.
421 if (ManifestURL::UpdatesFromGallery(*ex)) { 420 if (ManifestURL::UpdatesFromGallery(*ex)) {
422 UMA_HISTOGRAM_ENUMERATION("Extensions.ExternalItemState", 421 UMA_HISTOGRAM_ENUMERATION("Extensions.ExternalItemState",
423 EXTERNAL_ITEM_WEBSTORE_DISABLED, 422 EXTERNAL_ITEM_WEBSTORE_DISABLED,
424 EXTERNAL_ITEM_MAX_ITEMS); 423 EXTERNAL_ITEM_MAX_ITEMS);
425 } else { 424 } else {
426 UMA_HISTOGRAM_ENUMERATION("Extensions.ExternalItemState", 425 UMA_HISTOGRAM_ENUMERATION("Extensions.ExternalItemState",
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after
479 int InstalledLoader::GetCreationFlags(const ExtensionInfo* info) { 478 int InstalledLoader::GetCreationFlags(const ExtensionInfo* info) {
480 int flags = extension_prefs_->GetCreationFlags(info->extension_id); 479 int flags = extension_prefs_->GetCreationFlags(info->extension_id);
481 if (!Manifest::IsUnpackedLocation(info->extension_location)) 480 if (!Manifest::IsUnpackedLocation(info->extension_location))
482 flags |= Extension::REQUIRE_KEY; 481 flags |= Extension::REQUIRE_KEY;
483 if (extension_prefs_->AllowFileAccess(info->extension_id)) 482 if (extension_prefs_->AllowFileAccess(info->extension_id))
484 flags |= Extension::ALLOW_FILE_ACCESS; 483 flags |= Extension::ALLOW_FILE_ACCESS;
485 return flags; 484 return flags;
486 } 485 }
487 486
488 } // namespace extensions 487 } // namespace extensions
OLDNEW
« no previous file with comments | « chrome/browser/extensions/install_tracker_factory.cc ('k') | chrome/browser/extensions/launch_util.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698