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 319 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
465 return result->Populate(*value, valid_schemes, allow_file_access, NULL); | 471 return result->Populate(*value, valid_schemes, allow_file_access, NULL); |
466 } | 472 } |
467 | 473 |
468 void ExtensionPrefs::SetExtensionPrefURLPatternSet( | 474 void ExtensionPrefs::SetExtensionPrefURLPatternSet( |
469 const std::string& extension_id, | 475 const std::string& extension_id, |
470 const std::string& pref_key, | 476 const std::string& pref_key, |
471 const URLPatternSet& new_value) { | 477 const URLPatternSet& new_value) { |
472 UpdateExtensionPref(extension_id, pref_key, new_value.ToValue().release()); | 478 UpdateExtensionPref(extension_id, pref_key, new_value.ToValue().release()); |
473 } | 479 } |
474 | 480 |
475 ExtensionPermissionSet* ExtensionPrefs::ReadExtensionPrefPermissionSet( | 481 PermissionSet* ExtensionPrefs::ReadExtensionPrefPermissionSet( |
476 const std::string& extension_id, | 482 const std::string& extension_id, |
477 const std::string& pref_key) { | 483 const std::string& pref_key) { |
478 if (!GetExtensionPref(extension_id)) | 484 if (!GetExtensionPref(extension_id)) |
479 return NULL; | 485 return NULL; |
480 | 486 |
481 // Retrieve the API permissions. | 487 // Retrieve the API permissions. |
482 ExtensionAPIPermissionSet apis; | 488 APIPermissionSet apis; |
483 const ListValue* api_values = NULL; | 489 const ListValue* api_values = NULL; |
484 std::string api_pref = JoinPrefs(pref_key, kPrefAPIs); | 490 std::string api_pref = JoinPrefs(pref_key, kPrefAPIs); |
485 if (ReadExtensionPrefList(extension_id, api_pref, &api_values)) { | 491 if (ReadExtensionPrefList(extension_id, api_pref, &api_values)) { |
486 ExtensionPermissionsInfo* info = ExtensionPermissionsInfo::GetInstance(); | 492 PermissionsInfo* info = PermissionsInfo::GetInstance(); |
487 for (size_t i = 0; i < api_values->GetSize(); ++i) { | 493 for (size_t i = 0; i < api_values->GetSize(); ++i) { |
488 std::string permission_name; | 494 std::string permission_name; |
489 if (api_values->GetString(i, &permission_name)) { | 495 if (api_values->GetString(i, &permission_name)) { |
490 ExtensionAPIPermission *permission = info->GetByName(permission_name); | 496 APIPermission *permission = info->GetByName(permission_name); |
491 if (permission) | 497 if (permission) |
492 apis.insert(permission->id()); | 498 apis.insert(permission->id()); |
493 } | 499 } |
494 } | 500 } |
495 } | 501 } |
496 | 502 |
497 // Retrieve the explicit host permissions. | 503 // Retrieve the explicit host permissions. |
498 URLPatternSet explicit_hosts; | 504 URLPatternSet explicit_hosts; |
499 ReadExtensionPrefURLPatternSet( | 505 ReadExtensionPrefURLPatternSet( |
500 extension_id, JoinPrefs(pref_key, kPrefExplicitHosts), | 506 extension_id, JoinPrefs(pref_key, kPrefExplicitHosts), |
501 &explicit_hosts, Extension::kValidHostPermissionSchemes); | 507 &explicit_hosts, Extension::kValidHostPermissionSchemes); |
502 | 508 |
503 // Retrieve the scriptable host permissions. | 509 // Retrieve the scriptable host permissions. |
504 URLPatternSet scriptable_hosts; | 510 URLPatternSet scriptable_hosts; |
505 ReadExtensionPrefURLPatternSet( | 511 ReadExtensionPrefURLPatternSet( |
506 extension_id, JoinPrefs(pref_key, kPrefScriptableHosts), | 512 extension_id, JoinPrefs(pref_key, kPrefScriptableHosts), |
507 &scriptable_hosts, UserScript::kValidUserScriptSchemes); | 513 &scriptable_hosts, UserScript::kValidUserScriptSchemes); |
508 | 514 |
509 // Retrieve the oauth2 scopes. | 515 // Retrieve the oauth2 scopes. |
510 ExtensionOAuth2Scopes scopes; | 516 OAuth2Scopes scopes; |
511 const ListValue* scope_values = NULL; | 517 const ListValue* scope_values = NULL; |
512 std::string scope_pref = JoinPrefs(pref_key, kPrefScopes); | 518 std::string scope_pref = JoinPrefs(pref_key, kPrefScopes); |
513 if (ReadExtensionPrefList(extension_id, scope_pref, &scope_values)) { | 519 if (ReadExtensionPrefList(extension_id, scope_pref, &scope_values)) { |
514 for (size_t i = 0; i < scope_values->GetSize(); ++i) { | 520 for (size_t i = 0; i < scope_values->GetSize(); ++i) { |
515 std::string scope; | 521 std::string scope; |
516 if (scope_values->GetString(i, &scope)) | 522 if (scope_values->GetString(i, &scope)) |
517 scopes.insert(scope); | 523 scopes.insert(scope); |
518 } | 524 } |
519 } | 525 } |
520 | 526 |
521 return new ExtensionPermissionSet( | 527 return new PermissionSet( |
522 apis, explicit_hosts, scriptable_hosts, scopes); | 528 apis, explicit_hosts, scriptable_hosts, scopes); |
523 } | 529 } |
524 | 530 |
525 void ExtensionPrefs::SetExtensionPrefPermissionSet( | 531 void ExtensionPrefs::SetExtensionPrefPermissionSet( |
526 const std::string& extension_id, | 532 const std::string& extension_id, |
527 const std::string& pref_key, | 533 const std::string& pref_key, |
528 const ExtensionPermissionSet* new_value) { | 534 const PermissionSet* new_value) { |
529 // Set the API permissions. | 535 // Set the API permissions. |
530 ListValue* api_values = new ListValue(); | 536 ListValue* api_values = new ListValue(); |
531 ExtensionAPIPermissionSet apis = new_value->apis(); | 537 APIPermissionSet apis = new_value->apis(); |
532 ExtensionPermissionsInfo* info = ExtensionPermissionsInfo::GetInstance(); | 538 PermissionsInfo* info = PermissionsInfo::GetInstance(); |
533 std::string api_pref = JoinPrefs(pref_key, kPrefAPIs); | 539 std::string api_pref = JoinPrefs(pref_key, kPrefAPIs); |
534 for (ExtensionAPIPermissionSet::const_iterator i = apis.begin(); | 540 for (APIPermissionSet::const_iterator i = apis.begin(); |
535 i != apis.end(); ++i) { | 541 i != apis.end(); ++i) { |
536 ExtensionAPIPermission* perm = info->GetByID(*i); | 542 APIPermission* perm = info->GetByID(*i); |
537 if (perm) | 543 if (perm) |
538 api_values->Append(Value::CreateStringValue(perm->name())); | 544 api_values->Append(Value::CreateStringValue(perm->name())); |
539 } | 545 } |
540 UpdateExtensionPref(extension_id, api_pref, api_values); | 546 UpdateExtensionPref(extension_id, api_pref, api_values); |
541 | 547 |
542 // Set the explicit host permissions. | 548 // Set the explicit host permissions. |
543 if (!new_value->explicit_hosts().is_empty()) { | 549 if (!new_value->explicit_hosts().is_empty()) { |
544 SetExtensionPrefURLPatternSet(extension_id, | 550 SetExtensionPrefURLPatternSet(extension_id, |
545 JoinPrefs(pref_key, kPrefExplicitHosts), | 551 JoinPrefs(pref_key, kPrefExplicitHosts), |
546 new_value->explicit_hosts()); | 552 new_value->explicit_hosts()); |
547 } | 553 } |
548 | 554 |
549 // Set the scriptable host permissions. | 555 // Set the scriptable host permissions. |
550 if (!new_value->scriptable_hosts().is_empty()) { | 556 if (!new_value->scriptable_hosts().is_empty()) { |
551 SetExtensionPrefURLPatternSet(extension_id, | 557 SetExtensionPrefURLPatternSet(extension_id, |
552 JoinPrefs(pref_key, kPrefScriptableHosts), | 558 JoinPrefs(pref_key, kPrefScriptableHosts), |
553 new_value->scriptable_hosts()); | 559 new_value->scriptable_hosts()); |
554 } | 560 } |
555 | 561 |
556 // Set the oauth2 scopes. | 562 // Set the oauth2 scopes. |
557 ExtensionOAuth2Scopes scopes = new_value->scopes(); | 563 OAuth2Scopes scopes = new_value->scopes(); |
558 if (!scopes.empty()) { | 564 if (!scopes.empty()) { |
559 ListValue* scope_values = new ListValue(); | 565 ListValue* scope_values = new ListValue(); |
560 for (ExtensionOAuth2Scopes::iterator i = scopes.begin(); | 566 for (OAuth2Scopes::iterator i = scopes.begin(); |
561 i != scopes.end(); ++i) { | 567 i != scopes.end(); ++i) { |
562 scope_values->Append(Value::CreateStringValue(*i)); | 568 scope_values->Append(Value::CreateStringValue(*i)); |
563 } | 569 } |
564 std::string scope_pref = JoinPrefs(pref_key, kPrefScopes); | 570 std::string scope_pref = JoinPrefs(pref_key, kPrefScopes); |
565 UpdateExtensionPref(extension_id, scope_pref, scope_values); | 571 UpdateExtensionPref(extension_id, scope_pref, scope_values); |
566 } | 572 } |
567 } | 573 } |
568 | 574 |
569 // static | 575 // static |
570 bool ExtensionPrefs::IsBlacklistBitSet(DictionaryValue* ext) { | 576 bool ExtensionPrefs::IsBlacklistBitSet(DictionaryValue* ext) { |
(...skipping 279 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
850 return false; | 856 return false; |
851 } | 857 } |
852 | 858 |
853 void ExtensionPrefs::SetActiveBit(const std::string& extension_id, | 859 void ExtensionPrefs::SetActiveBit(const std::string& extension_id, |
854 bool active) { | 860 bool active) { |
855 UpdateExtensionPref(extension_id, kActiveBit, | 861 UpdateExtensionPref(extension_id, kActiveBit, |
856 Value::CreateBooleanValue(active)); | 862 Value::CreateBooleanValue(active)); |
857 } | 863 } |
858 | 864 |
859 void ExtensionPrefs::MigratePermissions(const ExtensionIdSet& extension_ids) { | 865 void ExtensionPrefs::MigratePermissions(const ExtensionIdSet& extension_ids) { |
860 ExtensionPermissionsInfo* info = ExtensionPermissionsInfo::GetInstance(); | 866 PermissionsInfo* info = PermissionsInfo::GetInstance(); |
861 for (ExtensionIdSet::const_iterator ext_id = | 867 for (ExtensionIdSet::const_iterator ext_id = |
862 extension_ids.begin(); ext_id != extension_ids.end(); ++ext_id) { | 868 extension_ids.begin(); ext_id != extension_ids.end(); ++ext_id) { |
863 | 869 |
864 // An extension's granted permissions need to be migrated if the | 870 // An extension's granted permissions need to be migrated if the |
865 // full_access bit is present. This bit was always present in the previous | 871 // full_access bit is present. This bit was always present in the previous |
866 // scheme and is never present now. | 872 // scheme and is never present now. |
867 bool full_access; | 873 bool full_access; |
868 const DictionaryValue* ext = GetExtensionPref(*ext_id); | 874 const DictionaryValue* ext = GetExtensionPref(*ext_id); |
869 if (!ext || !ext->GetBoolean(kPrefOldGrantedFullAccess, &full_access)) | 875 if (!ext || !ext->GetBoolean(kPrefOldGrantedFullAccess, &full_access)) |
870 continue; | 876 continue; |
871 | 877 |
872 // Remove the full access bit (empty list will get trimmed). | 878 // Remove the full access bit (empty list will get trimmed). |
873 UpdateExtensionPref( | 879 UpdateExtensionPref( |
874 *ext_id, kPrefOldGrantedFullAccess, new ListValue()); | 880 *ext_id, kPrefOldGrantedFullAccess, new ListValue()); |
875 | 881 |
876 // Add the plugin permission if the full access bit was set. | 882 // Add the plugin permission if the full access bit was set. |
877 if (full_access) { | 883 if (full_access) { |
878 ListValue* apis = NULL; | 884 ListValue* apis = NULL; |
879 ListValue* new_apis = NULL; | 885 ListValue* new_apis = NULL; |
880 | 886 |
881 std::string granted_apis = | 887 std::string granted_apis = |
882 JoinPrefs(kPrefGrantedPermissions, kPrefAPIs); | 888 JoinPrefs(kPrefGrantedPermissions, kPrefAPIs); |
883 if (ext->GetList(kPrefOldGrantedAPIs, &apis)) | 889 if (ext->GetList(kPrefOldGrantedAPIs, &apis)) |
884 new_apis = apis->DeepCopy(); | 890 new_apis = apis->DeepCopy(); |
885 else | 891 else |
886 new_apis = new ListValue(); | 892 new_apis = new ListValue(); |
887 | 893 |
888 std::string plugin_name = info->GetByID( | 894 std::string plugin_name = info->GetByID( |
889 ExtensionAPIPermission::kPlugin)->name(); | 895 APIPermission::kPlugin)->name(); |
890 new_apis->Append(Value::CreateStringValue(plugin_name)); | 896 new_apis->Append(Value::CreateStringValue(plugin_name)); |
891 UpdateExtensionPref(*ext_id, granted_apis, new_apis); | 897 UpdateExtensionPref(*ext_id, granted_apis, new_apis); |
892 } | 898 } |
893 | 899 |
894 // The granted permissions originally only held the effective hosts, | 900 // The granted permissions originally only held the effective hosts, |
895 // which are a combination of host and user script host permissions. | 901 // which are a combination of host and user script host permissions. |
896 // We now maintain these lists separately. For migration purposes, it | 902 // We now maintain these lists separately. For migration purposes, it |
897 // does not matter how we treat the old effective hosts as long as the | 903 // does not matter how we treat the old effective hosts as long as the |
898 // new effective hosts will be the same, so we move them to explicit | 904 // new effective hosts will be the same, so we move them to explicit |
899 // host permissions. | 905 // host permissions. |
900 ListValue* hosts; | 906 ListValue* hosts; |
901 std::string explicit_hosts = | 907 std::string explicit_hosts = |
902 JoinPrefs(kPrefGrantedPermissions, kPrefExplicitHosts); | 908 JoinPrefs(kPrefGrantedPermissions, kPrefExplicitHosts); |
903 if (ext->GetList(kPrefOldGrantedHosts, &hosts)) { | 909 if (ext->GetList(kPrefOldGrantedHosts, &hosts)) { |
904 UpdateExtensionPref( | 910 UpdateExtensionPref( |
905 *ext_id, explicit_hosts, hosts->DeepCopy()); | 911 *ext_id, explicit_hosts, hosts->DeepCopy()); |
906 | 912 |
907 // We can get rid of the old one by setting it to an empty list. | 913 // We can get rid of the old one by setting it to an empty list. |
908 UpdateExtensionPref(*ext_id, kPrefOldGrantedHosts, new ListValue()); | 914 UpdateExtensionPref(*ext_id, kPrefOldGrantedHosts, new ListValue()); |
909 } | 915 } |
910 } | 916 } |
911 } | 917 } |
912 | 918 |
913 ExtensionPermissionSet* ExtensionPrefs::GetGrantedPermissions( | 919 PermissionSet* ExtensionPrefs::GetGrantedPermissions( |
914 const std::string& extension_id) { | 920 const std::string& extension_id) { |
915 CHECK(Extension::IdIsValid(extension_id)); | 921 CHECK(Extension::IdIsValid(extension_id)); |
916 return ReadExtensionPrefPermissionSet(extension_id, kPrefGrantedPermissions); | 922 return ReadExtensionPrefPermissionSet(extension_id, kPrefGrantedPermissions); |
917 } | 923 } |
918 | 924 |
919 void ExtensionPrefs::AddGrantedPermissions( | 925 void ExtensionPrefs::AddGrantedPermissions( |
920 const std::string& extension_id, | 926 const std::string& extension_id, |
921 const ExtensionPermissionSet* permissions) { | 927 const PermissionSet* permissions) { |
922 CHECK(Extension::IdIsValid(extension_id)); | 928 CHECK(Extension::IdIsValid(extension_id)); |
923 | 929 |
924 scoped_refptr<ExtensionPermissionSet> granted_permissions( | 930 scoped_refptr<PermissionSet> granted_permissions( |
925 GetGrantedPermissions(extension_id)); | 931 GetGrantedPermissions(extension_id)); |
926 | 932 |
927 // The new granted permissions are the union of the already granted | 933 // The new granted permissions are the union of the already granted |
928 // permissions and the newly granted permissions. | 934 // permissions and the newly granted permissions. |
929 scoped_refptr<ExtensionPermissionSet> new_perms( | 935 scoped_refptr<PermissionSet> new_perms( |
930 ExtensionPermissionSet::CreateUnion( | 936 PermissionSet::CreateUnion( |
931 permissions, granted_permissions.get())); | 937 permissions, granted_permissions.get())); |
932 | 938 |
933 SetExtensionPrefPermissionSet( | 939 SetExtensionPrefPermissionSet( |
934 extension_id, kPrefGrantedPermissions, new_perms.get()); | 940 extension_id, kPrefGrantedPermissions, new_perms.get()); |
935 } | 941 } |
936 | 942 |
937 ExtensionPermissionSet* ExtensionPrefs::GetActivePermissions( | 943 PermissionSet* ExtensionPrefs::GetActivePermissions( |
938 const std::string& extension_id) { | 944 const std::string& extension_id) { |
939 CHECK(Extension::IdIsValid(extension_id)); | 945 CHECK(Extension::IdIsValid(extension_id)); |
940 return ReadExtensionPrefPermissionSet(extension_id, kPrefActivePermissions); | 946 return ReadExtensionPrefPermissionSet(extension_id, kPrefActivePermissions); |
941 } | 947 } |
942 | 948 |
943 void ExtensionPrefs::SetActivePermissions( | 949 void ExtensionPrefs::SetActivePermissions( |
944 const std::string& extension_id, | 950 const std::string& extension_id, |
945 const ExtensionPermissionSet* permissions) { | 951 const PermissionSet* permissions) { |
946 SetExtensionPrefPermissionSet( | 952 SetExtensionPrefPermissionSet( |
947 extension_id, kPrefActivePermissions, permissions); | 953 extension_id, kPrefActivePermissions, permissions); |
948 } | 954 } |
949 | 955 |
950 std::set<std::string> ExtensionPrefs::GetRegisteredEvents( | 956 std::set<std::string> ExtensionPrefs::GetRegisteredEvents( |
951 const std::string& extension_id) { | 957 const std::string& extension_id) { |
952 std::set<std::string> events; | 958 std::set<std::string> events; |
953 const DictionaryValue* extension = GetExtensionPref(extension_id); | 959 const DictionaryValue* extension = GetExtensionPref(extension_id); |
954 if (!extension) | 960 if (!extension) |
955 return events; | 961 return events; |
(...skipping 985 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1941 PrefService::UNSYNCABLE_PREF); | 1947 PrefService::UNSYNCABLE_PREF); |
1942 prefs->RegisterInt64Pref(prefs::kLastExtensionsUpdateCheck, | 1948 prefs->RegisterInt64Pref(prefs::kLastExtensionsUpdateCheck, |
1943 0, // default value | 1949 0, // default value |
1944 PrefService::UNSYNCABLE_PREF); | 1950 PrefService::UNSYNCABLE_PREF); |
1945 prefs->RegisterInt64Pref(prefs::kNextExtensionsUpdateCheck, | 1951 prefs->RegisterInt64Pref(prefs::kNextExtensionsUpdateCheck, |
1946 0, // default value | 1952 0, // default value |
1947 PrefService::UNSYNCABLE_PREF); | 1953 PrefService::UNSYNCABLE_PREF); |
1948 prefs->RegisterListPref(prefs::kExtensionAllowedInstallSites, | 1954 prefs->RegisterListPref(prefs::kExtensionAllowedInstallSites, |
1949 PrefService::UNSYNCABLE_PREF); | 1955 PrefService::UNSYNCABLE_PREF); |
1950 } | 1956 } |
OLD | NEW |