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

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

Issue 13971005: Basic multi-module support (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix copyright for presubmit 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
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/stringprintf.h" 10 #include "base/stringprintf.h"
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after
99 // Highest rank has highest priority. 99 // Highest rank has highest priority.
100 return (loc1_rank > loc2_rank ? loc1 : loc2 ); 100 return (loc1_rank > loc2_rank ? loc1 : loc2 );
101 } 101 }
102 102
103 Manifest::Manifest(Location location, scoped_ptr<base::DictionaryValue> value) 103 Manifest::Manifest(Location location, scoped_ptr<base::DictionaryValue> value)
104 : location_(location), 104 : location_(location),
105 value_(value.Pass()), 105 value_(value.Pass()),
106 type_(TYPE_UNKNOWN) { 106 type_(TYPE_UNKNOWN) {
107 if (value_->HasKey(keys::kTheme)) { 107 if (value_->HasKey(keys::kTheme)) {
108 type_ = TYPE_THEME; 108 type_ = TYPE_THEME;
109 } else if (value_->HasKey(keys::kExport)) {
110 type_ = TYPE_SHARED_MODULE;
109 } else if (value_->HasKey(keys::kApp)) { 111 } else if (value_->HasKey(keys::kApp)) {
110 if (value_->Get(keys::kWebURLs, NULL) || 112 if (value_->Get(keys::kWebURLs, NULL) ||
111 value_->Get(keys::kLaunchWebURL, NULL)) { 113 value_->Get(keys::kLaunchWebURL, NULL)) {
112 type_ = TYPE_HOSTED_APP; 114 type_ = TYPE_HOSTED_APP;
113 } else if (value_->Get(keys::kPlatformAppBackground, NULL)) { 115 } else if (value_->Get(keys::kPlatformAppBackground, NULL)) {
114 type_ = TYPE_PLATFORM_APP; 116 type_ = TYPE_PLATFORM_APP;
115 } else { 117 } else {
116 type_ = TYPE_LEGACY_PACKAGED_APP; 118 type_ = TYPE_LEGACY_PACKAGED_APP;
117 } 119 }
118 } else { 120 } else {
(...skipping 131 matching lines...) Expand 10 before | Expand all | Expand 10 after
250 BaseFeatureProvider::GetByName("manifest")->GetFeature(key); 252 BaseFeatureProvider::GetByName("manifest")->GetFeature(key);
251 if (!feature) 253 if (!feature)
252 return true; 254 return true;
253 255
254 return feature->IsAvailableToManifest( 256 return feature->IsAvailableToManifest(
255 extension_id_, type_, Feature::ConvertLocation(location_), 257 extension_id_, type_, Feature::ConvertLocation(location_),
256 GetManifestVersion()).is_available(); 258 GetManifestVersion()).is_available();
257 } 259 }
258 260
259 } // namespace extensions 261 } // namespace extensions
OLDNEW
« no previous file with comments | « chrome/common/extensions/manifest.h ('k') | chrome/common/extensions/manifest_handlers/shared_module_info.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698