summaryrefslogtreecommitdiffstats
path: root/extensions/common/features
diff options
context:
space:
mode:
authorkalman <kalman@chromium.org>2015-03-10 14:29:31 -0700
committerCommit bot <commit-bot@chromium.org>2015-03-10 21:30:55 +0000
commit9b8643f37bd4d9193a5cb764c757c0581d166e82 (patch)
tree05467aa871f0a3f83019aedbe77296231f20c55f /extensions/common/features
parent3d5823f1b9b8220cacd112aaa9f97793e0b8317e (diff)
downloadchromium_src-9b8643f37bd4d9193a5cb764c757c0581d166e82.zip
chromium_src-9b8643f37bd4d9193a5cb764c757c0581d166e82.tar.gz
chromium_src-9b8643f37bd4d9193a5cb764c757c0581d166e82.tar.bz2
[Extensions] Remove ChromeV8Context and DispatcherDelegate::CreateScriptContext.
ChromeV8Context was a vacuous override, it's just a ScriptContext, and by replacing instances of ScriptContext the delegate method can be deleted. It also led me to deleting Feature::CreateAvailability which referenced ChromeV8Context for some reason. R=rockot@chromium.org Review URL: https://codereview.chromium.org/995913002 Cr-Commit-Position: refs/heads/master@{#319976}
Diffstat (limited to 'extensions/common/features')
-rw-r--r--extensions/common/features/feature.cc6
-rw-r--r--extensions/common/features/feature.h13
-rw-r--r--extensions/common/features/simple_feature.h1
-rw-r--r--extensions/common/features/simple_feature_filter.cc4
4 files changed, 6 insertions, 18 deletions
diff --git a/extensions/common/features/feature.cc b/extensions/common/features/feature.cc
index 8fadf4f..21aa289 100644
--- a/extensions/common/features/feature.cc
+++ b/extensions/common/features/feature.cc
@@ -30,12 +30,6 @@ Feature::Platform Feature::GetCurrentPlatform() {
#endif
}
-// static
-Feature::Availability Feature::CreateAvailability(AvailabilityResult result,
- const std::string& message) {
- return Availability(result, message);
-}
-
Feature::Availability Feature::IsAvailableToExtension(
const Extension* extension) const {
return IsAvailableToManifest(extension->id(),
diff --git a/extensions/common/features/feature.h b/extensions/common/features/feature.h
index 1e476c8..304f6cb 100644
--- a/extensions/common/features/feature.h
+++ b/extensions/common/features/feature.h
@@ -80,6 +80,9 @@ class Feature {
// message in cases where the feature is not available.
class Availability {
public:
+ Availability(AvailabilityResult result, const std::string& message)
+ : result_(result), message_(message) {}
+
AvailabilityResult result() const { return result_; }
bool is_available() const { return result_ == IS_AVAILABLE; }
const std::string& message() const { return message_; }
@@ -88,10 +91,6 @@ class Feature {
friend class SimpleFeature;
friend class Feature;
- // Instances should be created via Feature::CreateAvailability.
- Availability(AvailabilityResult result, const std::string& message)
- : result_(result), message_(message) { }
-
const AvailabilityResult result_;
const std::string message_;
};
@@ -99,12 +98,6 @@ class Feature {
Feature();
virtual ~Feature();
- // Used by ChromeV8Context until the feature system is fully functional.
- // TODO(kalman): This is no longer used by ChromeV8Context, so what is the
- // comment trying to say?
- static Availability CreateAvailability(AvailabilityResult result,
- const std::string& message);
-
const std::string& name() const { return name_; }
void set_name(const std::string& name) { name_ = name; }
bool no_parent() const { return no_parent_; }
diff --git a/extensions/common/features/simple_feature.h b/extensions/common/features/simple_feature.h
index 395a26c..a5bc270 100644
--- a/extensions/common/features/simple_feature.h
+++ b/extensions/common/features/simple_feature.h
@@ -124,6 +124,7 @@ class SimpleFeature : public Feature {
const std::set<std::string>& list);
protected:
+ // Handy utilities which construct the correct availability message.
Availability CreateAvailability(AvailabilityResult result) const;
Availability CreateAvailability(AvailabilityResult result,
Manifest::Type type) const;
diff --git a/extensions/common/features/simple_feature_filter.cc b/extensions/common/features/simple_feature_filter.cc
index 77343f1..623c49c 100644
--- a/extensions/common/features/simple_feature_filter.cc
+++ b/extensions/common/features/simple_feature_filter.cc
@@ -22,7 +22,7 @@ Feature::Availability SimpleFeatureFilter::IsAvailableToContext(
Feature::Context context,
const GURL& url,
Feature::Platform platform) const {
- return Feature::CreateAvailability(Feature::IS_AVAILABLE, std::string());
+ return Feature::Availability(Feature::IS_AVAILABLE, std::string());
}
Feature::Availability SimpleFeatureFilter::IsAvailableToManifest(
@@ -31,7 +31,7 @@ Feature::Availability SimpleFeatureFilter::IsAvailableToManifest(
Manifest::Location location,
int manifest_version,
Feature::Platform platform) const {
- return Feature::CreateAvailability(Feature::IS_AVAILABLE, std::string());
+ return Feature::Availability(Feature::IS_AVAILABLE, std::string());
}
} // namespace extensions