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

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

Issue 12792005: Allow extensions on chrome:// URLs, when flag is set and permission is explicitly requested (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Reinstate original pickle order; add scripts clause to content_script_chrome_url_invalid.json to av… 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/extension_prefs.h" 5 #include "chrome/browser/extensions/extension_prefs.h"
6 6
7 #include "base/command_line.h" 7 #include "base/command_line.h"
8 #include "base/prefs/pref_notifier.h" 8 #include "base/prefs/pref_notifier.h"
9 #include "base/prefs/pref_service.h" 9 #include "base/prefs/pref_service.h"
10 #include "base/string_util.h" 10 #include "base/string_util.h"
(...skipping 540 matching lines...) Expand 10 before | Expand all | Expand 10 after
551 // Retrieve the explicit host permissions. 551 // Retrieve the explicit host permissions.
552 URLPatternSet explicit_hosts; 552 URLPatternSet explicit_hosts;
553 ReadExtensionPrefURLPatternSet( 553 ReadExtensionPrefURLPatternSet(
554 extension_id, JoinPrefs(pref_key, kPrefExplicitHosts), 554 extension_id, JoinPrefs(pref_key, kPrefExplicitHosts),
555 &explicit_hosts, Extension::kValidHostPermissionSchemes); 555 &explicit_hosts, Extension::kValidHostPermissionSchemes);
556 556
557 // Retrieve the scriptable host permissions. 557 // Retrieve the scriptable host permissions.
558 URLPatternSet scriptable_hosts; 558 URLPatternSet scriptable_hosts;
559 ReadExtensionPrefURLPatternSet( 559 ReadExtensionPrefURLPatternSet(
560 extension_id, JoinPrefs(pref_key, kPrefScriptableHosts), 560 extension_id, JoinPrefs(pref_key, kPrefScriptableHosts),
561 &scriptable_hosts, UserScript::kValidUserScriptSchemes); 561 &scriptable_hosts, UserScript::ValidUserScriptSchemes());
562 562
563 return new PermissionSet(apis, explicit_hosts, scriptable_hosts); 563 return new PermissionSet(apis, explicit_hosts, scriptable_hosts);
564 } 564 }
565 565
566 void ExtensionPrefs::SetExtensionPrefPermissionSet( 566 void ExtensionPrefs::SetExtensionPrefPermissionSet(
567 const std::string& extension_id, 567 const std::string& extension_id,
568 const std::string& pref_key, 568 const std::string& pref_key,
569 const PermissionSet* new_value) { 569 const PermissionSet* new_value) {
570 // Set the API permissions. 570 // Set the API permissions.
571 // The format of api_values is: 571 // The format of api_values is:
(...skipping 1824 matching lines...) Expand 10 before | Expand all | Expand 10 after
2396 is_enabled = initial_state == Extension::ENABLED; 2396 is_enabled = initial_state == Extension::ENABLED;
2397 } 2397 }
2398 2398
2399 extension_pref_value_map_->RegisterExtension(extension_id, install_time, 2399 extension_pref_value_map_->RegisterExtension(extension_id, install_time,
2400 is_enabled); 2400 is_enabled);
2401 content_settings_store_->RegisterExtension(extension_id, install_time, 2401 content_settings_store_->RegisterExtension(extension_id, install_time,
2402 is_enabled); 2402 is_enabled);
2403 } 2403 }
2404 2404
2405 } // namespace extensions 2405 } // namespace extensions
OLDNEW
« no previous file with comments | « chrome/browser/extensions/crx_installer.cc ('k') | chrome/browser/extensions/user_script_master.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698