Home | History | Annotate | Download | only in extensions

Lines Matching refs:extension

14 #include "chrome/common/extensions/extension.h"
25 // Where an extension was installed from. (see Extension::Location)
28 // Enabled, disabled, killed, etc. (see Extension::State)
34 // The dictionary containing the extension's manifest.
40 // Indicates if an extension is blacklisted:
51 // server's perspective) an extension last included a "ping" parameter during
71 // A preference that, if true, will allow this extension to run in incognito
75 // A preference to control whether an extension is allowed to inject script in
96 // A preference for storing extra data sent in update checks for an extension.
102 // Preferences that hold which permissions the user has granted the extension.
110 // A preference that indicates when an extension was installed.
113 // A preference that contains any extension-controlled preferences.
116 // Provider of write access to a dictionary storing extension prefs.
126 DictionaryValue* extension = NULL;
127 if (!dict->GetDictionary(extension_id_, &extension)) {
128 // Extension pref does not exist, create it.
129 extension = new DictionaryValue();
130 dict->Set(extension_id_, extension);
132 return extension;
141 // Provider of write access to a dictionary storing extension controlled prefs.
190 if (location != Extension::LOAD)
201 std::string computed_id = Extension::GenerateIdForPath(path);
288 location_value == Extension::LOAD) {
332 location_value == Extension::LOAD) {
370 // No such extension yet.
389 // No such extension yet.
507 const Extension* extension, bool did_escalate) {
508 UpdateExtensionPref(extension->id(), kExtensionDidEscalatePermissions,
524 NOTREACHED() << "Invalid pref for extension " << *extension_id;
530 // This extension is not in blacklist. And it was not blacklisted
547 // Keep the record if this extension is already processed.
596 DCHECK(Extension::IdIsValid(extension_id));
602 DCHECK(Extension::IdIsValid(extension_id));
618 DCHECK(Extension::IdIsValid(extension_id));
624 DCHECK(Extension::IdIsValid(extension_id));
648 CHECK(Extension::IdIsValid(extension_id));
668 Extension::kValidHostPermissionSchemes |
672 // fail on a pattern in an installed extension.
693 CHECK(Extension::IdIsValid(extension_id));
769 const Extension* extension,
772 extension->launch_container();
790 GetLaunchType(extension->id(), default_pref_value);
827 const DictionaryValue* extension = GetExtensionPref(id);
828 if (!extension)
831 return extension->GetInteger(kPrefState, &state) &&
832 state == static_cast<int>(Extension::EXTERNAL_EXTENSION_UNINSTALLED);
861 const Extension* extension, Extension::State initial_state,
863 const std::string& id = extension->id();
864 CHECK(Extension::IdIsValid(id));
872 Value::CreateIntegerValue(extension->location()));
879 extension->path());
883 if (extension->location() != Extension::LOAD) {
885 extension->manifest_value()->DeepCopy());
890 id, install_time, initial_state == Extension::ENABLED);
895 const Extension::Location& location,
898 // and install the extension anymore (except when |external_uninstall| is
900 // no longer lists the extension).
901 if (!external_uninstall && Extension::IsExternalLocation(location)) {
904 Extension::EXTERNAL_EXTENSION_UNINSTALLED));
912 Extension::State ExtensionPrefs::GetExtensionState(
914 const DictionaryValue* extension = GetExtensionPref(extension_id);
916 // If the extension doesn't have a pref, it's a --load-extension.
917 if (!extension)
918 return Extension::ENABLED;
921 if (!extension->GetInteger(kPrefState, &state) ||
922 state < 0 || state >= Extension::NUM_STATES) {
923 LOG(ERROR) << "Bad or missing pref 'state' for extension '"
925 return Extension::ENABLED;
927 return static_cast<Extension::State>(state);
930 void ExtensionPrefs::SetExtensionState(const Extension* extension,
931 Extension::State state) {
932 extension->id(), kPrefState,
936 bool enabled = (state == Extension::ENABLED);
937 extension_pref_value_map_->SetExtensionState(extension->id(), enabled);
940 bool ExtensionPrefs::GetBrowserActionVisibility(const Extension* extension) {
941 const DictionaryValue* extension_prefs = GetExtensionPref(extension->id());
951 void ExtensionPrefs::SetBrowserActionVisibility(const Extension* extension,
953 if (GetBrowserActionVisibility(extension) == visible)
956 UpdateExtensionPref(extension->id(), kBrowserActionVisible,
963 Details<const Extension>(extension));
967 const DictionaryValue* extension = GetExtensionPref(extension_id);
968 if (!extension)
972 if (!extension->GetString(kPrefVersion, &version)) {
973 LOG(ERROR) << "Bad or missing pref 'version' for extension '"
980 void ExtensionPrefs::UpdateManifest(const Extension* extension) {
981 if (extension->location() != Extension::LOAD) {
982 const DictionaryValue* extension_dict = GetExtensionPref(extension->id());
988 !extension->manifest_value()->Equals(old_manifest);
990 UpdateExtensionPref(extension->id(), kPrefManifest,
991 extension->manifest_value()->DeepCopy());
1012 if (!Extension::IdIsValid(extension_id)) {
1017 DictionaryValue* extension = update.Get();
1018 extension->Set(key, data_value);
1036 DictionaryValue* extension = NULL;
1037 dict->GetDictionary(extension_id, &extension);
1038 return extension;
1047 LOG(WARNING) << "Invalid pref for extension " << *extension_id;
1067 if (state_value == Extension::EXTERNAL_EXTENSION_UNINSTALLED) {
1068 LOG(WARNING) << "External extension with id " << *extension_id
1081 // Only the following extension types can be installed permanently in the
1083 Extension::Location location =
1084 static_cast<Extension::Location>(location_value);
1085 if (location != Extension::INTERNAL &&
1086 location != Extension::LOAD &&
1087 !Extension::IsExternalLocation(location)) {
1093 if (location != Extension::LOAD &&
1095 LOG(WARNING) << "Missing manifest for extension " << *extension_id;
1110 if (!Extension::IdIsValid(*extension_id))
1220 if (!Extension::IdIsValid(id)) {
1356 const DictionaryValue* extension = GetExtensionPref(extension_id);
1357 if (!extension) {
1362 if (!extension->GetString(kPrefInstallTime, &install_time_str))
1388 LOG(INFO) << "Could not parse installation time of extension "
1394 DictionaryValue* extension = update.Get();
1395 extension->Set(kPrefInstallTime,
1430 // Create empty preferences dictionary for each extension (these dictionaries
1444 // Store extension controlled preference values in the
1452 GetExtensionState(*ext_id) == Extension::ENABLED);
1476 DCHECK(pref) << "Extension controlled preference key " << pref_key
1479 << "Extension controlled preference " << pref_key << " has wrong type.";
1500 << "Extension controlled preference key " << pref_key
1520 << "Extension controlled preference key " << pref_key
1532 << "Extension controlled preference key " << pref_key