OLD | NEW |
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/string_number_conversions.h" | 7 #include "base/string_number_conversions.h" |
8 #include "base/string_util.h" | 8 #include "base/string_util.h" |
9 #include "base/utf_string_conversions.h" | 9 #include "base/utf_string_conversions.h" |
10 #include "chrome/browser/extensions/admin_policy.h" | 10 #include "chrome/browser/extensions/admin_policy.h" |
11 #include "chrome/browser/extensions/api/omnibox/omnibox_api.h" | 11 #include "chrome/browser/extensions/api/omnibox/omnibox_api.h" |
12 #include "chrome/browser/extensions/extension_menu_manager.h" | 12 #include "chrome/browser/extensions/extension_menu_manager.h" |
13 #include "chrome/browser/extensions/extension_pref_store.h" | 13 #include "chrome/browser/extensions/extension_pref_store.h" |
14 #include "chrome/browser/extensions/extension_sorting.h" | 14 #include "chrome/browser/extensions/extension_sorting.h" |
15 #include "chrome/browser/prefs/pref_notifier.h" | 15 #include "chrome/browser/prefs/pref_notifier.h" |
16 #include "chrome/browser/prefs/pref_service.h" | 16 #include "chrome/browser/prefs/pref_service.h" |
17 #include "chrome/browser/prefs/scoped_user_pref_update.h" | 17 #include "chrome/browser/prefs/scoped_user_pref_update.h" |
18 #include "chrome/common/chrome_notification_types.h" | 18 #include "chrome/common/chrome_notification_types.h" |
19 #include "chrome/common/extensions/extension_switch_utils.h" | 19 #include "chrome/common/extensions/extension_switch_utils.h" |
20 #include "chrome/common/extensions/manifest.h" | 20 #include "chrome/common/extensions/manifest.h" |
| 21 #include "chrome/common/extensions/permissions/permissions_info.h" |
21 #include "chrome/common/extensions/url_pattern.h" | 22 #include "chrome/common/extensions/url_pattern.h" |
22 #include "chrome/common/pref_names.h" | 23 #include "chrome/common/pref_names.h" |
23 #include "chrome/common/url_constants.h" | 24 #include "chrome/common/url_constants.h" |
24 #include "content/public/browser/notification_service.h" | 25 #include "content/public/browser/notification_service.h" |
25 #include "grit/generated_resources.h" | 26 #include "grit/generated_resources.h" |
26 #include "ui/base/l10n/l10n_util.h" | 27 #include "ui/base/l10n/l10n_util.h" |
27 | 28 |
| 29 using extensions::APIPermission; |
| 30 using extensions::APIPermissionSet; |
28 using extensions::Extension; | 31 using extensions::Extension; |
29 using extensions::ExtensionInfo; | 32 using extensions::ExtensionInfo; |
| 33 using extensions::OAuth2Scopes; |
| 34 using extensions::PermissionsInfo; |
| 35 using extensions::PermissionSet; |
30 | 36 |
31 namespace { | 37 namespace { |
32 | 38 |
33 // Additional preferences keys | 39 // Additional preferences keys |
34 | 40 |
35 // Where an extension was installed from. (see Extension::Location) | 41 // Where an extension was installed from. (see Extension::Location) |
36 const char kPrefLocation[] = "location"; | 42 const char kPrefLocation[] = "location"; |
37 | 43 |
38 // Enabled, disabled, killed, etc. (see Extension::State) | 44 // Enabled, disabled, killed, etc. (see Extension::State) |
39 const char kPrefState[] = "state"; | 45 const char kPrefState[] = "state"; |
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
125 const char kBrowserActionPinned[] = "browser_action_pinned"; | 131 const char kBrowserActionPinned[] = "browser_action_pinned"; |
126 | 132 |
127 // Preferences that hold which permissions the user has granted the extension. | 133 // Preferences that hold which permissions the user has granted the extension. |
128 // We explicitly keep track of these so that extensions can contain unknown | 134 // We explicitly keep track of these so that extensions can contain unknown |
129 // permissions, for backwards compatibility reasons, and we can still prompt | 135 // permissions, for backwards compatibility reasons, and we can still prompt |
130 // the user to accept them once recognized. We store the active permission | 136 // the user to accept them once recognized. We store the active permission |
131 // permissions because they may differ from those defined in the manifest. | 137 // permissions because they may differ from those defined in the manifest. |
132 const char kPrefActivePermissions[] = "active_permissions"; | 138 const char kPrefActivePermissions[] = "active_permissions"; |
133 const char kPrefGrantedPermissions[] = "granted_permissions"; | 139 const char kPrefGrantedPermissions[] = "granted_permissions"; |
134 | 140 |
135 // The preference names for ExtensionPermissionSet values. | 141 // The preference names for PermissionSet values. |
136 const char kPrefAPIs[] = "api"; | 142 const char kPrefAPIs[] = "api"; |
137 const char kPrefExplicitHosts[] = "explicit_host"; | 143 const char kPrefExplicitHosts[] = "explicit_host"; |
138 const char kPrefScriptableHosts[] = "scriptable_host"; | 144 const char kPrefScriptableHosts[] = "scriptable_host"; |
139 const char kPrefScopes[] = "scopes"; | 145 const char kPrefScopes[] = "scopes"; |
140 | 146 |
141 // The preference names for the old granted permissions scheme. | 147 // The preference names for the old granted permissions scheme. |
142 const char kPrefOldGrantedFullAccess[] = "granted_permissions.full"; | 148 const char kPrefOldGrantedFullAccess[] = "granted_permissions.full"; |
143 const char kPrefOldGrantedHosts[] = "granted_permissions.host"; | 149 const char kPrefOldGrantedHosts[] = "granted_permissions.host"; |
144 const char kPrefOldGrantedAPIs[] = "granted_permissions.api"; | 150 const char kPrefOldGrantedAPIs[] = "granted_permissions.api"; |
145 | 151 |
(...skipping 315 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
461 return result->Populate(*value, valid_schemes, allow_file_access, NULL); | 467 return result->Populate(*value, valid_schemes, allow_file_access, NULL); |
462 } | 468 } |
463 | 469 |
464 void ExtensionPrefs::SetExtensionPrefURLPatternSet( | 470 void ExtensionPrefs::SetExtensionPrefURLPatternSet( |
465 const std::string& extension_id, | 471 const std::string& extension_id, |
466 const std::string& pref_key, | 472 const std::string& pref_key, |
467 const URLPatternSet& new_value) { | 473 const URLPatternSet& new_value) { |
468 UpdateExtensionPref(extension_id, pref_key, new_value.ToValue().release()); | 474 UpdateExtensionPref(extension_id, pref_key, new_value.ToValue().release()); |
469 } | 475 } |
470 | 476 |
471 ExtensionPermissionSet* ExtensionPrefs::ReadExtensionPrefPermissionSet( | 477 PermissionSet* ExtensionPrefs::ReadExtensionPrefPermissionSet( |
472 const std::string& extension_id, | 478 const std::string& extension_id, |
473 const std::string& pref_key) { | 479 const std::string& pref_key) { |
474 if (!GetExtensionPref(extension_id)) | 480 if (!GetExtensionPref(extension_id)) |
475 return NULL; | 481 return NULL; |
476 | 482 |
477 // Retrieve the API permissions. | 483 // Retrieve the API permissions. |
478 ExtensionAPIPermissionSet apis; | 484 APIPermissionSet apis; |
479 const ListValue* api_values = NULL; | 485 const ListValue* api_values = NULL; |
480 std::string api_pref = JoinPrefs(pref_key, kPrefAPIs); | 486 std::string api_pref = JoinPrefs(pref_key, kPrefAPIs); |
481 if (ReadExtensionPrefList(extension_id, api_pref, &api_values)) { | 487 if (ReadExtensionPrefList(extension_id, api_pref, &api_values)) { |
482 ExtensionPermissionsInfo* info = ExtensionPermissionsInfo::GetInstance(); | 488 PermissionsInfo* info = PermissionsInfo::GetInstance(); |
483 for (size_t i = 0; i < api_values->GetSize(); ++i) { | 489 for (size_t i = 0; i < api_values->GetSize(); ++i) { |
484 std::string permission_name; | 490 std::string permission_name; |
485 if (api_values->GetString(i, &permission_name)) { | 491 if (api_values->GetString(i, &permission_name)) { |
486 ExtensionAPIPermission *permission = info->GetByName(permission_name); | 492 APIPermission *permission = info->GetByName(permission_name); |
487 if (permission) | 493 if (permission) |
488 apis.insert(permission->id()); | 494 apis.insert(permission->id()); |
489 } | 495 } |
490 } | 496 } |
491 } | 497 } |
492 | 498 |
493 // Retrieve the explicit host permissions. | 499 // Retrieve the explicit host permissions. |
494 URLPatternSet explicit_hosts; | 500 URLPatternSet explicit_hosts; |
495 ReadExtensionPrefURLPatternSet( | 501 ReadExtensionPrefURLPatternSet( |
496 extension_id, JoinPrefs(pref_key, kPrefExplicitHosts), | 502 extension_id, JoinPrefs(pref_key, kPrefExplicitHosts), |
497 &explicit_hosts, Extension::kValidHostPermissionSchemes); | 503 &explicit_hosts, Extension::kValidHostPermissionSchemes); |
498 | 504 |
499 // Retrieve the scriptable host permissions. | 505 // Retrieve the scriptable host permissions. |
500 URLPatternSet scriptable_hosts; | 506 URLPatternSet scriptable_hosts; |
501 ReadExtensionPrefURLPatternSet( | 507 ReadExtensionPrefURLPatternSet( |
502 extension_id, JoinPrefs(pref_key, kPrefScriptableHosts), | 508 extension_id, JoinPrefs(pref_key, kPrefScriptableHosts), |
503 &scriptable_hosts, UserScript::kValidUserScriptSchemes); | 509 &scriptable_hosts, UserScript::kValidUserScriptSchemes); |
504 | 510 |
505 // Retrieve the oauth2 scopes. | 511 // Retrieve the oauth2 scopes. |
506 ExtensionOAuth2Scopes scopes; | 512 OAuth2Scopes scopes; |
507 const ListValue* scope_values = NULL; | 513 const ListValue* scope_values = NULL; |
508 std::string scope_pref = JoinPrefs(pref_key, kPrefScopes); | 514 std::string scope_pref = JoinPrefs(pref_key, kPrefScopes); |
509 if (ReadExtensionPrefList(extension_id, scope_pref, &scope_values)) { | 515 if (ReadExtensionPrefList(extension_id, scope_pref, &scope_values)) { |
510 for (size_t i = 0; i < scope_values->GetSize(); ++i) { | 516 for (size_t i = 0; i < scope_values->GetSize(); ++i) { |
511 std::string scope; | 517 std::string scope; |
512 if (scope_values->GetString(i, &scope)) | 518 if (scope_values->GetString(i, &scope)) |
513 scopes.insert(scope); | 519 scopes.insert(scope); |
514 } | 520 } |
515 } | 521 } |
516 | 522 |
517 return new ExtensionPermissionSet( | 523 return new PermissionSet( |
518 apis, explicit_hosts, scriptable_hosts, scopes); | 524 apis, explicit_hosts, scriptable_hosts, scopes); |
519 } | 525 } |
520 | 526 |
521 void ExtensionPrefs::SetExtensionPrefPermissionSet( | 527 void ExtensionPrefs::SetExtensionPrefPermissionSet( |
522 const std::string& extension_id, | 528 const std::string& extension_id, |
523 const std::string& pref_key, | 529 const std::string& pref_key, |
524 const ExtensionPermissionSet* new_value) { | 530 const PermissionSet* new_value) { |
525 // Set the API permissions. | 531 // Set the API permissions. |
526 ListValue* api_values = new ListValue(); | 532 ListValue* api_values = new ListValue(); |
527 ExtensionAPIPermissionSet apis = new_value->apis(); | 533 APIPermissionSet apis = new_value->apis(); |
528 ExtensionPermissionsInfo* info = ExtensionPermissionsInfo::GetInstance(); | 534 PermissionsInfo* info = PermissionsInfo::GetInstance(); |
529 std::string api_pref = JoinPrefs(pref_key, kPrefAPIs); | 535 std::string api_pref = JoinPrefs(pref_key, kPrefAPIs); |
530 for (ExtensionAPIPermissionSet::const_iterator i = apis.begin(); | 536 for (APIPermissionSet::const_iterator i = apis.begin(); |
531 i != apis.end(); ++i) { | 537 i != apis.end(); ++i) { |
532 ExtensionAPIPermission* perm = info->GetByID(*i); | 538 APIPermission* perm = info->GetByID(*i); |
533 if (perm) | 539 if (perm) |
534 api_values->Append(Value::CreateStringValue(perm->name())); | 540 api_values->Append(Value::CreateStringValue(perm->name())); |
535 } | 541 } |
536 UpdateExtensionPref(extension_id, api_pref, api_values); | 542 UpdateExtensionPref(extension_id, api_pref, api_values); |
537 | 543 |
538 // Set the explicit host permissions. | 544 // Set the explicit host permissions. |
539 if (!new_value->explicit_hosts().is_empty()) { | 545 if (!new_value->explicit_hosts().is_empty()) { |
540 SetExtensionPrefURLPatternSet(extension_id, | 546 SetExtensionPrefURLPatternSet(extension_id, |
541 JoinPrefs(pref_key, kPrefExplicitHosts), | 547 JoinPrefs(pref_key, kPrefExplicitHosts), |
542 new_value->explicit_hosts()); | 548 new_value->explicit_hosts()); |
543 } | 549 } |
544 | 550 |
545 // Set the scriptable host permissions. | 551 // Set the scriptable host permissions. |
546 if (!new_value->scriptable_hosts().is_empty()) { | 552 if (!new_value->scriptable_hosts().is_empty()) { |
547 SetExtensionPrefURLPatternSet(extension_id, | 553 SetExtensionPrefURLPatternSet(extension_id, |
548 JoinPrefs(pref_key, kPrefScriptableHosts), | 554 JoinPrefs(pref_key, kPrefScriptableHosts), |
549 new_value->scriptable_hosts()); | 555 new_value->scriptable_hosts()); |
550 } | 556 } |
551 | 557 |
552 // Set the oauth2 scopes. | 558 // Set the oauth2 scopes. |
553 ExtensionOAuth2Scopes scopes = new_value->scopes(); | 559 OAuth2Scopes scopes = new_value->scopes(); |
554 if (!scopes.empty()) { | 560 if (!scopes.empty()) { |
555 ListValue* scope_values = new ListValue(); | 561 ListValue* scope_values = new ListValue(); |
556 for (ExtensionOAuth2Scopes::iterator i = scopes.begin(); | 562 for (OAuth2Scopes::iterator i = scopes.begin(); |
557 i != scopes.end(); ++i) { | 563 i != scopes.end(); ++i) { |
558 scope_values->Append(Value::CreateStringValue(*i)); | 564 scope_values->Append(Value::CreateStringValue(*i)); |
559 } | 565 } |
560 std::string scope_pref = JoinPrefs(pref_key, kPrefScopes); | 566 std::string scope_pref = JoinPrefs(pref_key, kPrefScopes); |
561 UpdateExtensionPref(extension_id, scope_pref, scope_values); | 567 UpdateExtensionPref(extension_id, scope_pref, scope_values); |
562 } | 568 } |
563 } | 569 } |
564 | 570 |
565 // static | 571 // static |
566 bool ExtensionPrefs::IsBlacklistBitSet(DictionaryValue* ext) { | 572 bool ExtensionPrefs::IsBlacklistBitSet(DictionaryValue* ext) { |
(...skipping 279 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
846 return false; | 852 return false; |
847 } | 853 } |
848 | 854 |
849 void ExtensionPrefs::SetActiveBit(const std::string& extension_id, | 855 void ExtensionPrefs::SetActiveBit(const std::string& extension_id, |
850 bool active) { | 856 bool active) { |
851 UpdateExtensionPref(extension_id, kActiveBit, | 857 UpdateExtensionPref(extension_id, kActiveBit, |
852 Value::CreateBooleanValue(active)); | 858 Value::CreateBooleanValue(active)); |
853 } | 859 } |
854 | 860 |
855 void ExtensionPrefs::MigratePermissions(const ExtensionIdSet& extension_ids) { | 861 void ExtensionPrefs::MigratePermissions(const ExtensionIdSet& extension_ids) { |
856 ExtensionPermissionsInfo* info = ExtensionPermissionsInfo::GetInstance(); | 862 PermissionsInfo* info = PermissionsInfo::GetInstance(); |
857 for (ExtensionIdSet::const_iterator ext_id = | 863 for (ExtensionIdSet::const_iterator ext_id = |
858 extension_ids.begin(); ext_id != extension_ids.end(); ++ext_id) { | 864 extension_ids.begin(); ext_id != extension_ids.end(); ++ext_id) { |
859 | 865 |
860 // An extension's granted permissions need to be migrated if the | 866 // An extension's granted permissions need to be migrated if the |
861 // full_access bit is present. This bit was always present in the previous | 867 // full_access bit is present. This bit was always present in the previous |
862 // scheme and is never present now. | 868 // scheme and is never present now. |
863 bool full_access; | 869 bool full_access; |
864 const DictionaryValue* ext = GetExtensionPref(*ext_id); | 870 const DictionaryValue* ext = GetExtensionPref(*ext_id); |
865 if (!ext || !ext->GetBoolean(kPrefOldGrantedFullAccess, &full_access)) | 871 if (!ext || !ext->GetBoolean(kPrefOldGrantedFullAccess, &full_access)) |
866 continue; | 872 continue; |
867 | 873 |
868 // Remove the full access bit (empty list will get trimmed). | 874 // Remove the full access bit (empty list will get trimmed). |
869 UpdateExtensionPref( | 875 UpdateExtensionPref( |
870 *ext_id, kPrefOldGrantedFullAccess, new ListValue()); | 876 *ext_id, kPrefOldGrantedFullAccess, new ListValue()); |
871 | 877 |
872 // Add the plugin permission if the full access bit was set. | 878 // Add the plugin permission if the full access bit was set. |
873 if (full_access) { | 879 if (full_access) { |
874 ListValue* apis = NULL; | 880 ListValue* apis = NULL; |
875 ListValue* new_apis = NULL; | 881 ListValue* new_apis = NULL; |
876 | 882 |
877 std::string granted_apis = | 883 std::string granted_apis = |
878 JoinPrefs(kPrefGrantedPermissions, kPrefAPIs); | 884 JoinPrefs(kPrefGrantedPermissions, kPrefAPIs); |
879 if (ext->GetList(kPrefOldGrantedAPIs, &apis)) | 885 if (ext->GetList(kPrefOldGrantedAPIs, &apis)) |
880 new_apis = apis->DeepCopy(); | 886 new_apis = apis->DeepCopy(); |
881 else | 887 else |
882 new_apis = new ListValue(); | 888 new_apis = new ListValue(); |
883 | 889 |
884 std::string plugin_name = info->GetByID( | 890 std::string plugin_name = info->GetByID( |
885 ExtensionAPIPermission::kPlugin)->name(); | 891 APIPermission::kPlugin)->name(); |
886 new_apis->Append(Value::CreateStringValue(plugin_name)); | 892 new_apis->Append(Value::CreateStringValue(plugin_name)); |
887 UpdateExtensionPref(*ext_id, granted_apis, new_apis); | 893 UpdateExtensionPref(*ext_id, granted_apis, new_apis); |
888 } | 894 } |
889 | 895 |
890 // The granted permissions originally only held the effective hosts, | 896 // The granted permissions originally only held the effective hosts, |
891 // which are a combination of host and user script host permissions. | 897 // which are a combination of host and user script host permissions. |
892 // We now maintain these lists separately. For migration purposes, it | 898 // We now maintain these lists separately. For migration purposes, it |
893 // does not matter how we treat the old effective hosts as long as the | 899 // does not matter how we treat the old effective hosts as long as the |
894 // new effective hosts will be the same, so we move them to explicit | 900 // new effective hosts will be the same, so we move them to explicit |
895 // host permissions. | 901 // host permissions. |
896 ListValue* hosts; | 902 ListValue* hosts; |
897 std::string explicit_hosts = | 903 std::string explicit_hosts = |
898 JoinPrefs(kPrefGrantedPermissions, kPrefExplicitHosts); | 904 JoinPrefs(kPrefGrantedPermissions, kPrefExplicitHosts); |
899 if (ext->GetList(kPrefOldGrantedHosts, &hosts)) { | 905 if (ext->GetList(kPrefOldGrantedHosts, &hosts)) { |
900 UpdateExtensionPref( | 906 UpdateExtensionPref( |
901 *ext_id, explicit_hosts, hosts->DeepCopy()); | 907 *ext_id, explicit_hosts, hosts->DeepCopy()); |
902 | 908 |
903 // We can get rid of the old one by setting it to an empty list. | 909 // We can get rid of the old one by setting it to an empty list. |
904 UpdateExtensionPref(*ext_id, kPrefOldGrantedHosts, new ListValue()); | 910 UpdateExtensionPref(*ext_id, kPrefOldGrantedHosts, new ListValue()); |
905 } | 911 } |
906 } | 912 } |
907 } | 913 } |
908 | 914 |
909 ExtensionPermissionSet* ExtensionPrefs::GetGrantedPermissions( | 915 PermissionSet* ExtensionPrefs::GetGrantedPermissions( |
910 const std::string& extension_id) { | 916 const std::string& extension_id) { |
911 CHECK(Extension::IdIsValid(extension_id)); | 917 CHECK(Extension::IdIsValid(extension_id)); |
912 return ReadExtensionPrefPermissionSet(extension_id, kPrefGrantedPermissions); | 918 return ReadExtensionPrefPermissionSet(extension_id, kPrefGrantedPermissions); |
913 } | 919 } |
914 | 920 |
915 void ExtensionPrefs::AddGrantedPermissions( | 921 void ExtensionPrefs::AddGrantedPermissions( |
916 const std::string& extension_id, | 922 const std::string& extension_id, |
917 const ExtensionPermissionSet* permissions) { | 923 const PermissionSet* permissions) { |
918 CHECK(Extension::IdIsValid(extension_id)); | 924 CHECK(Extension::IdIsValid(extension_id)); |
919 | 925 |
920 scoped_refptr<ExtensionPermissionSet> granted_permissions( | 926 scoped_refptr<PermissionSet> granted_permissions( |
921 GetGrantedPermissions(extension_id)); | 927 GetGrantedPermissions(extension_id)); |
922 | 928 |
923 // The new granted permissions are the union of the already granted | 929 // The new granted permissions are the union of the already granted |
924 // permissions and the newly granted permissions. | 930 // permissions and the newly granted permissions. |
925 scoped_refptr<ExtensionPermissionSet> new_perms( | 931 scoped_refptr<PermissionSet> new_perms( |
926 ExtensionPermissionSet::CreateUnion( | 932 PermissionSet::CreateUnion( |
927 permissions, granted_permissions.get())); | 933 permissions, granted_permissions.get())); |
928 | 934 |
929 SetExtensionPrefPermissionSet( | 935 SetExtensionPrefPermissionSet( |
930 extension_id, kPrefGrantedPermissions, new_perms.get()); | 936 extension_id, kPrefGrantedPermissions, new_perms.get()); |
931 } | 937 } |
932 | 938 |
933 ExtensionPermissionSet* ExtensionPrefs::GetActivePermissions( | 939 PermissionSet* ExtensionPrefs::GetActivePermissions( |
934 const std::string& extension_id) { | 940 const std::string& extension_id) { |
935 CHECK(Extension::IdIsValid(extension_id)); | 941 CHECK(Extension::IdIsValid(extension_id)); |
936 return ReadExtensionPrefPermissionSet(extension_id, kPrefActivePermissions); | 942 return ReadExtensionPrefPermissionSet(extension_id, kPrefActivePermissions); |
937 } | 943 } |
938 | 944 |
939 void ExtensionPrefs::SetActivePermissions( | 945 void ExtensionPrefs::SetActivePermissions( |
940 const std::string& extension_id, | 946 const std::string& extension_id, |
941 const ExtensionPermissionSet* permissions) { | 947 const PermissionSet* permissions) { |
942 SetExtensionPrefPermissionSet( | 948 SetExtensionPrefPermissionSet( |
943 extension_id, kPrefActivePermissions, permissions); | 949 extension_id, kPrefActivePermissions, permissions); |
944 } | 950 } |
945 | 951 |
946 std::set<std::string> ExtensionPrefs::GetRegisteredEvents( | 952 std::set<std::string> ExtensionPrefs::GetRegisteredEvents( |
947 const std::string& extension_id) { | 953 const std::string& extension_id) { |
948 std::set<std::string> events; | 954 std::set<std::string> events; |
949 const DictionaryValue* extension = GetExtensionPref(extension_id); | 955 const DictionaryValue* extension = GetExtensionPref(extension_id); |
950 if (!extension) | 956 if (!extension) |
951 return events; | 957 return events; |
(...skipping 932 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1884 PrefService::UNSYNCABLE_PREF); | 1890 PrefService::UNSYNCABLE_PREF); |
1885 prefs->RegisterInt64Pref(prefs::kLastExtensionsUpdateCheck, | 1891 prefs->RegisterInt64Pref(prefs::kLastExtensionsUpdateCheck, |
1886 0, // default value | 1892 0, // default value |
1887 PrefService::UNSYNCABLE_PREF); | 1893 PrefService::UNSYNCABLE_PREF); |
1888 prefs->RegisterInt64Pref(prefs::kNextExtensionsUpdateCheck, | 1894 prefs->RegisterInt64Pref(prefs::kNextExtensionsUpdateCheck, |
1889 0, // default value | 1895 0, // default value |
1890 PrefService::UNSYNCABLE_PREF); | 1896 PrefService::UNSYNCABLE_PREF); |
1891 prefs->RegisterListPref(prefs::kExtensionAllowedInstallSites, | 1897 prefs->RegisterListPref(prefs::kExtensionAllowedInstallSites, |
1892 PrefService::UNSYNCABLE_PREF); | 1898 PrefService::UNSYNCABLE_PREF); |
1893 } | 1899 } |
OLD | NEW |