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

Unified Diff: chrome/common/extensions/extension.cc

Issue 2078021: First pass at experimental omnibox API. There are plenty of rough edges and (Closed)
Patch Set: no prefer_keyword Created 10 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/common/extensions/extension.h ('k') | chrome/common/extensions/extension_constants.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/common/extensions/extension.cc
diff --git a/chrome/common/extensions/extension.cc b/chrome/common/extensions/extension.cc
index 89d709573be6b3d6d5d119830eb1b96a9f2e1af9..f68445e14b3b8b7f9b4443d11cd1616ec9a48abe 100644
--- a/chrome/common/extensions/extension.cc
+++ b/chrome/common/extensions/extension.cc
@@ -1456,6 +1456,18 @@ bool Extension::InitFromValue(const DictionaryValue& source, bool require_key,
}
}
+ if (source.HasKey(keys::kOmniboxKeyword)) {
+ if (!source.GetString(keys::kOmniboxKeyword, &omnibox_keyword_) ||
+ omnibox_keyword_.empty()) {
+ *error = errors::kInvalidOmniboxKeyword;
+ return false;
+ }
+ if (!HasApiPermission(Extension::kExperimentalPermission)) {
+ *error = errors::kOmniboxExperimental;
+ return false;
+ }
+ }
+
if (!CheckAppsAreEnabled(manifest_value_.get(), error) ||
!LoadWebContentEnabled(manifest_value_.get(), error) ||
!LoadWebOrigin(manifest_value_.get(), error) ||
« no previous file with comments | « chrome/common/extensions/extension.h ('k') | chrome/common/extensions/extension_constants.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698