Chromium Code Reviews| OLD | NEW |
|---|---|
| 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 #ifndef CHROME_BROWSER_EXTENSIONS_API_OMNIBOX_OMNIBOX_API_H_ | 5 #ifndef CHROME_BROWSER_EXTENSIONS_API_OMNIBOX_OMNIBOX_API_H_ |
| 6 #define CHROME_BROWSER_EXTENSIONS_API_OMNIBOX_OMNIBOX_API_H_ | 6 #define CHROME_BROWSER_EXTENSIONS_API_OMNIBOX_OMNIBOX_API_H_ |
| 7 | 7 |
| 8 #include <set> | 8 #include <set> |
| 9 #include <string> | 9 #include <string> |
| 10 #include <vector> | 10 #include <vector> |
| 11 | 11 |
| 12 #include "base/memory/scoped_ptr.h" | 12 #include "base/memory/scoped_ptr.h" |
| 13 #include "base/string16.h" | 13 #include "base/string16.h" |
| 14 #include "chrome/browser/autocomplete/autocomplete_match.h" | 14 #include "chrome/browser/autocomplete/autocomplete_match.h" |
| 15 #include "chrome/browser/extensions/api/profile_keyed_api_factory.h" | 15 #include "chrome/browser/extensions/api/profile_keyed_api_factory.h" |
| 16 #include "chrome/browser/extensions/extension_function.h" | 16 #include "chrome/browser/extensions/extension_function.h" |
| 17 #include "chrome/browser/extensions/extension_icon_manager.h" | 17 #include "chrome/browser/extensions/extension_icon_manager.h" |
| 18 #include "chrome/common/extensions/api/omnibox.h" | |
|
not at google - send to devlin
2013/03/11 16:32:40
Should be able to forward-declare api::omnibox::Se
Aaron Jacobs
2013/03/14 22:00:51
Unless I'm mistaken, I don't think a forward decla
| |
| 18 #include "content/public/browser/notification_observer.h" | 19 #include "content/public/browser/notification_observer.h" |
| 19 #include "content/public/browser/notification_registrar.h" | 20 #include "content/public/browser/notification_registrar.h" |
| 20 | 21 |
| 21 class Profile; | 22 class Profile; |
| 22 class TemplateURL; | 23 class TemplateURL; |
| 23 class TemplateURLService; | 24 class TemplateURLService; |
| 24 | 25 |
| 25 namespace base { | 26 namespace base { |
| 26 class ListValue; | 27 class ListValue; |
| 27 } | 28 } |
| (...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 144 | 145 |
| 145 struct ExtensionOmniboxSuggestion { | 146 struct ExtensionOmniboxSuggestion { |
| 146 ExtensionOmniboxSuggestion(); | 147 ExtensionOmniboxSuggestion(); |
| 147 ~ExtensionOmniboxSuggestion(); | 148 ~ExtensionOmniboxSuggestion(); |
| 148 | 149 |
| 149 // Populate a suggestion value from a DictionaryValue. If |require_content| | 150 // Populate a suggestion value from a DictionaryValue. If |require_content| |
| 150 // is false, then we won't fail if |content| is missing, to support | 151 // is false, then we won't fail if |content| is missing, to support |
| 151 // default suggestions. | 152 // default suggestions. |
| 152 bool Populate(const base::DictionaryValue& value, bool require_content); | 153 bool Populate(const base::DictionaryValue& value, bool require_content); |
| 153 | 154 |
| 155 // Populate a suggestion value from a Suggestion generated by the JSON schema | |
| 156 // compiler (which will only set the description). | |
| 157 bool PopulateFromDefaultSuggestion( | |
| 158 const api::omnibox::SetDefaultSuggestion::Params::Suggestion& suggestion); | |
| 159 | |
| 154 // Converts a list of style ranges from the extension into the format expected | 160 // Converts a list of style ranges from the extension into the format expected |
| 155 // by the autocomplete system. | 161 // by the autocomplete system. |
| 156 bool ReadStylesFromValue(const base::ListValue& value); | 162 bool ReadStylesFromValue(const base::ListValue& value); |
| 157 | 163 |
| 158 // Converts this structure to a DictionaryValue suitable for saving to disk. | 164 // Converts this structure to a DictionaryValue suitable for saving to disk. |
| 159 scoped_ptr<base::DictionaryValue> ToValue() const; | 165 scoped_ptr<base::DictionaryValue> ToValue() const; |
| 160 | 166 |
| 161 // The text that gets put in the edit box. | 167 // The text that gets put in the edit box. |
| 162 string16 content; | 168 string16 content; |
| 163 | 169 |
| (...skipping 20 matching lines...) Expand all Loading... | |
| 184 // omnibox.setDefaultSuggestion, apply that to |match|. Otherwise, do nothing. | 190 // omnibox.setDefaultSuggestion, apply that to |match|. Otherwise, do nothing. |
| 185 void ApplyDefaultSuggestionForExtensionKeyword( | 191 void ApplyDefaultSuggestionForExtensionKeyword( |
| 186 Profile* profile, | 192 Profile* profile, |
| 187 const TemplateURL* keyword, | 193 const TemplateURL* keyword, |
| 188 const string16& remaining_input, | 194 const string16& remaining_input, |
| 189 AutocompleteMatch* match); | 195 AutocompleteMatch* match); |
| 190 | 196 |
| 191 } // namespace extensions | 197 } // namespace extensions |
| 192 | 198 |
| 193 #endif // CHROME_BROWSER_EXTENSIONS_API_OMNIBOX_OMNIBOX_API_H_ | 199 #endif // CHROME_BROWSER_EXTENSIONS_API_OMNIBOX_OMNIBOX_API_H_ |
| OLD | NEW |