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

Unified Diff: chrome/browser/extensions/api/omnibox/omnibox_api.cc

Issue 14592004: Merge 199135 "Fix mismatched parameter expectations between chro..." (Closed) Base URL: svn://svn.chromium.org/chrome/branches/1500/src/
Patch Set: 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | chrome/browser/extensions/api/omnibox/omnibox_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/extensions/api/omnibox/omnibox_api.cc
===================================================================
--- chrome/browser/extensions/api/omnibox/omnibox_api.cc (revision 199613)
+++ chrome/browser/extensions/api/omnibox/omnibox_api.cc (working copy)
@@ -86,17 +86,19 @@
// Tries to set the omnibox default suggestion; returns true on success or
// false on failure.
-bool SetOmniboxDefaultSuggestion(Profile* profile,
- const std::string& extension_id,
- const omnibox::SuggestResult& suggestion) {
+bool SetOmniboxDefaultSuggestion(
+ Profile* profile,
+ const std::string& extension_id,
+ const omnibox::DefaultSuggestResult& suggestion) {
ExtensionPrefs* prefs =
ExtensionSystem::Get(profile)->extension_service()->extension_prefs();
if (!prefs)
return false;
scoped_ptr<base::DictionaryValue> dict = suggestion.ToValue();
- // A default suggestion should not have the content field set.
- dict->Remove(kSuggestionContent, NULL);
+ // Add the content field so that the dictionary can be used to populate an
+ // omnibox::SuggestResult.
+ dict->SetWithoutPathExpansion(kSuggestionContent, new base::StringValue(""));
prefs->UpdateExtensionPref(extension_id,
kOmniboxDefaultSuggestion,
dict.release());
« no previous file with comments | « no previous file | chrome/browser/extensions/api/omnibox/omnibox_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698