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

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

Issue 7574017: Make extension file URL access opt-in. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: keep LOAD the same Created 9 years, 4 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) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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/extension_service.h" 5 #include "chrome/browser/extensions/extension_service.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <set> 8 #include <set>
9 9
10 #include "base/basictypes.h" 10 #include "base/basictypes.h"
(...skipping 2189 matching lines...) Expand 10 before | Expand all | Expand 10 after
2200 } 2200 }
2201 2201
2202 ShownSectionsHandler::OnExtensionInstalled(profile_->GetPrefs(), extension); 2202 ShownSectionsHandler::OnExtensionInstalled(profile_->GetPrefs(), extension);
2203 extension_prefs_->OnExtensionInstalled( 2203 extension_prefs_->OnExtensionInstalled(
2204 extension, 2204 extension,
2205 initial_enable ? Extension::ENABLED : Extension::DISABLED, 2205 initial_enable ? Extension::ENABLED : Extension::DISABLED,
2206 from_webstore); 2206 from_webstore);
2207 2207
2208 // Unpacked extensions default to allowing file access, but if that has been 2208 // Unpacked extensions default to allowing file access, but if that has been
2209 // overridden, don't reset the value. 2209 // overridden, don't reset the value.
2210 if (Extension::ShouldAlwaysAllowFileAccess(Extension::LOAD) && 2210 if (Extension::ShouldAlwaysAllowFileAccess(extension->location()) &&
2211 !extension_prefs_->HasAllowFileAccessSetting(id)) { 2211 !extension_prefs_->HasAllowFileAccessSetting(id)) {
2212 extension_prefs_->SetAllowFileAccess(id, true); 2212 extension_prefs_->SetAllowFileAccess(id, true);
2213 } 2213 }
2214 2214
2215 NotificationService::current()->Notify( 2215 NotificationService::current()->Notify(
2216 chrome::NOTIFICATION_EXTENSION_INSTALLED, 2216 chrome::NOTIFICATION_EXTENSION_INSTALLED,
2217 Source<Profile>(profile_), 2217 Source<Profile>(profile_),
2218 Details<const Extension>(extension)); 2218 Details<const Extension>(extension));
2219 2219
2220 // Transfer ownership of |extension| to AddExtension. 2220 // Transfer ownership of |extension| to AddExtension.
(...skipping 360 matching lines...) Expand 10 before | Expand all | Expand 10 after
2581 2581
2582 ExtensionService::NaClModuleInfoList::iterator 2582 ExtensionService::NaClModuleInfoList::iterator
2583 ExtensionService::FindNaClModule(const GURL& url) { 2583 ExtensionService::FindNaClModule(const GURL& url) {
2584 for (NaClModuleInfoList::iterator iter = nacl_module_list_.begin(); 2584 for (NaClModuleInfoList::iterator iter = nacl_module_list_.begin();
2585 iter != nacl_module_list_.end(); ++iter) { 2585 iter != nacl_module_list_.end(); ++iter) {
2586 if (iter->url == url) 2586 if (iter->url == url)
2587 return iter; 2587 return iter;
2588 } 2588 }
2589 return nacl_module_list_.end(); 2589 return nacl_module_list_.end();
2590 } 2590 }
OLDNEW
« no previous file with comments | « chrome/browser/extensions/extension_prefs.cc ('k') | chrome/browser/extensions/extension_service_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698