summaryrefslogtreecommitdiffstats
path: root/chrome/browser/extensions/extension_info_map.cc
diff options
context:
space:
mode:
Diffstat (limited to 'chrome/browser/extensions/extension_info_map.cc')
-rw-r--r--chrome/browser/extensions/extension_info_map.cc27
1 files changed, 14 insertions, 13 deletions
diff --git a/chrome/browser/extensions/extension_info_map.cc b/chrome/browser/extensions/extension_info_map.cc
index f9f90aa..313e573 100644
--- a/chrome/browser/extensions/extension_info_map.cc
+++ b/chrome/browser/extensions/extension_info_map.cc
@@ -5,6 +5,7 @@
#include "chrome/browser/extensions/extension_info_map.h"
#include "chrome/browser/browser_thread.h"
+#include "chrome/common/extensions/extension.h"
#include "chrome/common/url_constants.h"
namespace {
@@ -21,13 +22,13 @@ ExtensionInfoMap::ExtensionInfoMap() {
ExtensionInfoMap::~ExtensionInfoMap() {
}
-void ExtensionInfoMap::AddExtension(const Extension::StaticData* data) {
+void ExtensionInfoMap::AddExtension(const Extension* extension) {
CheckOnValidThread();
- extension_info_[data->id] = data;
+ extension_info_[extension->id()] = extension;
// Our map has already added a reference. Balance the reference given at the
// call-site.
- data->Release();
+ extension->Release();
}
void ExtensionInfoMap::RemoveExtension(const std::string& id) {
@@ -48,7 +49,7 @@ void ExtensionInfoMap::RemoveExtension(const std::string& id) {
std::string ExtensionInfoMap::GetNameForExtension(const std::string& id) const {
Map::const_iterator iter = extension_info_.find(id);
if (iter != extension_info_.end())
- return iter->second->name;
+ return iter->second->name();
else
return std::string();
}
@@ -56,21 +57,22 @@ std::string ExtensionInfoMap::GetNameForExtension(const std::string& id) const {
FilePath ExtensionInfoMap::GetPathForExtension(const std::string& id) const {
Map::const_iterator iter = extension_info_.find(id);
if (iter != extension_info_.end())
- return iter->second->path;
+ return iter->second->path();
else
return FilePath();
}
bool ExtensionInfoMap::ExtensionHasWebExtent(const std::string& id) const {
Map::const_iterator iter = extension_info_.find(id);
- return iter != extension_info_.end() && !iter->second->extent.is_empty();
+ return iter != extension_info_.end() &&
+ !iter->second->web_extent().is_empty();
}
bool ExtensionInfoMap::ExtensionCanLoadInIncognito(
const std::string& id) const {
Map::const_iterator iter = extension_info_.find(id);
// Only split-mode extensions can load in incognito profiles.
- return iter != extension_info_.end() && iter->second->incognito_split_mode;
+ return iter != extension_info_.end() && iter->second->incognito_split_mode();
}
std::string ExtensionInfoMap::GetDefaultLocaleForExtension(
@@ -78,7 +80,7 @@ std::string ExtensionInfoMap::GetDefaultLocaleForExtension(
Map::const_iterator iter = extension_info_.find(id);
std::string result;
if (iter != extension_info_.end())
- result = iter->second->default_locale;
+ result = iter->second->default_locale();
return result;
}
@@ -88,7 +90,7 @@ ExtensionExtent ExtensionInfoMap::GetEffectiveHostPermissionsForExtension(
Map::const_iterator iter = extension_info_.find(id);
ExtensionExtent result;
if (iter != extension_info_.end())
- result = iter->second->effective_host_permissions;
+ result = iter->second->GetEffectiveHostPermissions();
return result;
}
@@ -106,15 +108,14 @@ bool ExtensionInfoMap::CheckURLAccessToExtensionPermission(
// disallowed, so only one will match.
info = extension_info_.begin();
while (info != extension_info_.end() &&
- !info->second->extent.ContainsURL(url))
+ !info->second->web_extent().ContainsURL(url))
++info;
}
if (info == extension_info_.end())
return false;
- const std::set<std::string>& api_permissions = info->second->api_permissions;
- return api_permissions.count(permission_name) != 0;
+ return info->second->api_permissions().count(permission_name) != 0;
}
bool ExtensionInfoMap::URLIsForExtensionIcon(const GURL& url) const {
@@ -127,5 +128,5 @@ bool ExtensionInfoMap::URLIsForExtensionIcon(const GURL& url) const {
std::string path = url.path();
DCHECK(path.length() > 0 && path[0] == '/');
path = path.substr(1);
- return iter->second->icons.ContainsPath(path);
+ return iter->second->icons().ContainsPath(path);
}