Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(64)

Side by Side Diff: chrome/common/extensions/manifest.cc

Issue 12084034: Change manifest handler interface to always (implicitly) pass the entire manifest to handlers. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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/common/extensions/manifest.h" 5 #include "chrome/common/extensions/manifest.h"
6 6
7 #include "base/basictypes.h" 7 #include "base/basictypes.h"
8 #include "base/lazy_instance.h" 8 #include "base/lazy_instance.h"
9 #include "base/logging.h" 9 #include "base/logging.h"
10 #include "base/string_split.h" 10 #include "base/string_split.h"
(...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after
117 const std::string& path, std::string* out_value) const { 117 const std::string& path, std::string* out_value) const {
118 return CanAccessPath(path) && value_->GetString(path, out_value); 118 return CanAccessPath(path) && value_->GetString(path, out_value);
119 } 119 }
120 120
121 bool Manifest::GetString( 121 bool Manifest::GetString(
122 const std::string& path, string16* out_value) const { 122 const std::string& path, string16* out_value) const {
123 return CanAccessPath(path) && value_->GetString(path, out_value); 123 return CanAccessPath(path) && value_->GetString(path, out_value);
124 } 124 }
125 125
126 bool Manifest::GetDictionary( 126 bool Manifest::GetDictionary(
127 const std::string& path, const DictionaryValue** out_value) const {
128 return CanAccessPath(path) && value_->GetDictionary(path, out_value);
Matt Perry 2013/01/29 00:58:47 implement these in terms of the non-const versions
Yoyo Zhou 2013/01/29 04:32:42 Done - let me know if this casting looks reasonabl
129 }
130
131 bool Manifest::GetDictionary(
127 const std::string& path, DictionaryValue** out_value) const { 132 const std::string& path, DictionaryValue** out_value) const {
128 return CanAccessPath(path) && value_->GetDictionary(path, out_value); 133 return CanAccessPath(path) && value_->GetDictionary(path, out_value);
129 } 134 }
130 135
131 bool Manifest::GetList( 136 bool Manifest::GetList(
137 const std::string& path, const ListValue** out_value) const {
138 return CanAccessPath(path) && value_->GetList(path, out_value);
139 }
140
141 bool Manifest::GetList(
132 const std::string& path, ListValue** out_value) const { 142 const std::string& path, ListValue** out_value) const {
133 return CanAccessPath(path) && value_->GetList(path, out_value); 143 return CanAccessPath(path) && value_->GetList(path, out_value);
134 } 144 }
135 145
136 Manifest* Manifest::DeepCopy() const { 146 Manifest* Manifest::DeepCopy() const {
137 Manifest* manifest = new Manifest( 147 Manifest* manifest = new Manifest(
138 location_, scoped_ptr<DictionaryValue>(value_->DeepCopy())); 148 location_, scoped_ptr<DictionaryValue>(value_->DeepCopy()));
139 manifest->set_extension_id(extension_id_); 149 manifest->set_extension_id(extension_id_);
140 return manifest; 150 return manifest;
141 } 151 }
(...skipping 28 matching lines...) Expand all
170 BaseFeatureProvider::GetManifestFeatures()->GetFeature(key); 180 BaseFeatureProvider::GetManifestFeatures()->GetFeature(key);
171 if (!feature) 181 if (!feature)
172 return true; 182 return true;
173 183
174 return feature->IsAvailableToManifest( 184 return feature->IsAvailableToManifest(
175 extension_id_, type_, Feature::ConvertLocation(location_), 185 extension_id_, type_, Feature::ConvertLocation(location_),
176 GetManifestVersion()).is_available(); 186 GetManifestVersion()).is_available();
177 } 187 }
178 188
179 } // namespace extensions 189 } // namespace extensions
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698