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

Unified Diff: chrome/browser/extensions/extension_prefs.cc

Issue 12314164: Modified Omnibox extension api to use JSON Schema Compiler (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Replaced include with forward declaration Created 7 years, 8 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/browser/extensions/extension_prefs.h ('k') | chrome/common/chrome_notification_types.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/extensions/extension_prefs.cc
diff --git a/chrome/browser/extensions/extension_prefs.cc b/chrome/browser/extensions/extension_prefs.cc
index 58f5e8928633c16dc6274653acf361c404edadb4..4859538ebd556377442bc1a7ed1b4c4775de35c4 100644
--- a/chrome/browser/extensions/extension_prefs.cc
+++ b/chrome/browser/extensions/extension_prefs.cc
@@ -1150,22 +1150,26 @@ void ExtensionPrefs::GetSavedFileEntries(
}
}
-ExtensionOmniboxSuggestion
+scoped_ptr<api::omnibox::SuggestResult>
ExtensionPrefs::GetOmniboxDefaultSuggestion(const std::string& extension_id) {
- ExtensionOmniboxSuggestion suggestion;
+ scoped_ptr<api::omnibox::SuggestResult> suggestion;
const DictionaryValue* extension = GetExtensionPref(extension_id);
const DictionaryValue* dict = NULL;
- if (extension && extension->GetDictionary(kOmniboxDefaultSuggestion, &dict))
- suggestion.Populate(*dict, false);
+ if (extension && extension->GetDictionary(kOmniboxDefaultSuggestion, &dict)) {
+ suggestion.reset(new api::omnibox::SuggestResult);
+ api::omnibox::SuggestResult::Populate(*dict, suggestion.get());
+ }
- return suggestion;
+ return suggestion.Pass();
}
void ExtensionPrefs::SetOmniboxDefaultSuggestion(
const std::string& extension_id,
- const ExtensionOmniboxSuggestion& suggestion) {
- scoped_ptr<base::DictionaryValue> dict = suggestion.ToValue().Pass();
+ const api::omnibox::SuggestResult& suggestion) {
+ scoped_ptr<base::DictionaryValue> dict = suggestion.ToValue();
+ // A default suggestion should not have the content field set.
+ dict->Remove("content", NULL);
UpdateExtensionPref(extension_id, kOmniboxDefaultSuggestion, dict.release());
}
« no previous file with comments | « chrome/browser/extensions/extension_prefs.h ('k') | chrome/common/chrome_notification_types.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698