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

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

Issue 10626007: Move ExtensionSystem into extensions namespace (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Created 8 years, 5 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
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/file_path.h" 7 #include "base/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/utf_string_conversions.h" 10 #include "base/utf_string_conversions.h"
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after
86 if (extension && 86 if (extension &&
87 extension->location() != Extension::LOAD && 87 extension->location() != Extension::LOAD &&
88 info.extension_id != extension->id()) { 88 info.extension_id != extension->id()) {
89 error = errors::kCannotChangeExtensionID; 89 error = errors::kCannotChangeExtensionID;
90 extension = NULL; 90 extension = NULL;
91 content::RecordAction(UserMetricsAction("Extensions.IDChangedError")); 91 content::RecordAction(UserMetricsAction("Extensions.IDChangedError"));
92 } 92 }
93 93
94 // Check policy on every load in case an extension was blacklisted while 94 // Check policy on every load in case an extension was blacklisted while
95 // Chrome was not running. 95 // Chrome was not running.
96 const ManagementPolicy* policy = ExtensionSystem::Get( 96 const ManagementPolicy* policy = extensions::ExtensionSystem::Get(
97 extension_service_->profile())->management_policy(); 97 extension_service_->profile())->management_policy();
98 if (extension && 98 if (extension &&
99 !policy->UserMayLoad(extension, NULL)) { 99 !policy->UserMayLoad(extension, NULL)) {
100 // The error message from UserMayInstall() often contains the extension ID 100 // The error message from UserMayInstall() often contains the extension ID
101 // and is therefore not well suited to this UI. 101 // and is therefore not well suited to this UI.
102 error = errors::kDisabledByPolicy; 102 error = errors::kDisabledByPolicy;
103 extension = NULL; 103 extension = NULL;
104 } 104 }
105 105
106 if (!extension) { 106 if (!extension) {
(...skipping 195 matching lines...) Expand 10 before | Expand all | Expand 10 after
302 if (extension_prefs_->AllowFileAccess(info->extension_id)) 302 if (extension_prefs_->AllowFileAccess(info->extension_id))
303 flags |= Extension::ALLOW_FILE_ACCESS; 303 flags |= Extension::ALLOW_FILE_ACCESS;
304 if (extension_prefs_->IsFromWebStore(info->extension_id)) 304 if (extension_prefs_->IsFromWebStore(info->extension_id))
305 flags |= Extension::FROM_WEBSTORE; 305 flags |= Extension::FROM_WEBSTORE;
306 if (extension_prefs_->IsFromBookmark(info->extension_id)) 306 if (extension_prefs_->IsFromBookmark(info->extension_id))
307 flags |= Extension::FROM_BOOKMARK; 307 flags |= Extension::FROM_BOOKMARK;
308 return flags; 308 return flags;
309 } 309 }
310 310
311 } // namespace extensions 311 } // namespace extensions
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698