summaryrefslogtreecommitdiffstats
path: root/chrome/browser/extensions/extension_omnibox_api.h
diff options
context:
space:
mode:
authormpcomplete@chromium.org <mpcomplete@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-11-11 22:35:56 +0000
committermpcomplete@chromium.org <mpcomplete@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-11-11 22:35:56 +0000
commit098ca94b1a0da99230fcdbb7653f738e286a21a7 (patch)
treea6a1659e7c729d6f90797d67936de6a6e815fa1a /chrome/browser/extensions/extension_omnibox_api.h
parentb4e9c1a0aba8ccb23afb461e99e90090845b0a3e (diff)
downloadchromium_src-098ca94b1a0da99230fcdbb7653f738e286a21a7.zip
chromium_src-098ca94b1a0da99230fcdbb7653f738e286a21a7.tar.gz
chromium_src-098ca94b1a0da99230fcdbb7653f738e286a21a7.tar.bz2
Revise the omnibox extension API so that specifying descriptionStyles is easier.
Now each style has a range that it applies to. The styles can also overlap and be listed out of order. BUG=62385 TEST=covered by unit/browser tests Review URL: http://codereview.chromium.org/4660008 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@65869 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/extensions/extension_omnibox_api.h')
-rw-r--r--chrome/browser/extensions/extension_omnibox_api.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/chrome/browser/extensions/extension_omnibox_api.h b/chrome/browser/extensions/extension_omnibox_api.h
index 9d0dc99..98758cb 100644
--- a/chrome/browser/extensions/extension_omnibox_api.h
+++ b/chrome/browser/extensions/extension_omnibox_api.h
@@ -49,6 +49,10 @@ struct ExtensionOmniboxSuggestion {
ExtensionOmniboxSuggestion();
~ExtensionOmniboxSuggestion();
+ // Converts a list of style ranges from the extension into the format expected
+ // by the autocomplete system.
+ bool ReadStylesFromValue(const ListValue& value);
+
// The text that gets put in the edit box.
string16 content;
@@ -57,6 +61,11 @@ struct ExtensionOmniboxSuggestion {
// Contains style ranges for the description.
ACMatchClassifications description_styles;
+
+ private:
+ // Helper function to add the given style to the running list of
+ // |description_styles|.
+ void InsertNewStyle(int type, size_t offset, size_t length);
};
struct ExtensionOmniboxSuggestions {