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

Side by Side Diff: chrome/common/extensions/features/complex_feature.cc

Issue 15091002: Lazily load API schemas from resource files and convert all APIs to features (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: optimize and "parent" property Created 7 years, 7 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/features/complex_feature.h" 5 #include "chrome/common/extensions/features/complex_feature.h"
6 6
7 #include "chrome/common/extensions/features/simple_feature.h" 7 #include "chrome/common/extensions/features/simple_feature.h"
8 8
9 namespace extensions { 9 namespace extensions {
10 10
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after
65 // but if they get more complicated, we need to return some meaningful context 65 // but if they get more complicated, we need to return some meaningful context
66 // set. Either that or remove this method from the Feature interface. 66 // set. Either that or remove this method from the Feature interface.
67 return features_[0]->GetContexts(); 67 return features_[0]->GetContexts();
68 } 68 }
69 69
70 bool ComplexFeature::IsInternal() const { 70 bool ComplexFeature::IsInternal() const {
71 NOTREACHED(); 71 NOTREACHED();
72 return false; 72 return false;
73 } 73 }
74 74
75 bool ComplexFeature::HasParent() const {
76 return false;
not at google - send to devlin 2013/05/23 00:09:40 should probably return the first parent that it fi
cduvall 2013/05/24 03:13:49 Done.
77 }
78
75 std::string ComplexFeature::GetAvailabilityMessage(AvailabilityResult result, 79 std::string ComplexFeature::GetAvailabilityMessage(AvailabilityResult result,
76 Manifest::Type type, 80 Manifest::Type type,
77 const GURL& url) const { 81 const GURL& url) const {
78 if (result == IS_AVAILABLE) 82 if (result == IS_AVAILABLE)
79 return std::string(); 83 return std::string();
80 84
81 // TODO(justinlin): Form some kind of combined availabilities/messages from 85 // TODO(justinlin): Form some kind of combined availabilities/messages from
82 // SimpleFeatures. 86 // SimpleFeatures.
83 return features_[0]->GetAvailabilityMessage(result, type, url); 87 return features_[0]->GetAvailabilityMessage(result, type, url);
84 } 88 }
85 89
86 bool ComplexFeature::IsIdInWhitelist(const std::string& extension_id) const { 90 bool ComplexFeature::IsIdInWhitelist(const std::string& extension_id) const {
87 for (FeatureList::const_iterator it = features_.begin(); 91 for (FeatureList::const_iterator it = features_.begin();
88 it != features_.end(); ++it) { 92 it != features_.end(); ++it) {
89 if ((*it)->IsIdInWhitelist(extension_id)) 93 if ((*it)->IsIdInWhitelist(extension_id))
90 return true; 94 return true;
91 } 95 }
92 return false; 96 return false;
93 } 97 }
94 98
95 } // namespace extensions 99 } // namespace extensions
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698