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

Unified Diff: chrome/browser/ui/webui/omnibox/omnibox_ui_handler.h

Issue 9289028: Make chrome://omnibox/ be able to report per-provider matches. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Revert html & js listener structure. Created 8 years, 11 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/resources/omnibox/omnibox.js ('k') | chrome/browser/ui/webui/omnibox/omnibox_ui_handler.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/webui/omnibox/omnibox_ui_handler.h
diff --git a/chrome/browser/ui/webui/omnibox/omnibox_ui_handler.h b/chrome/browser/ui/webui/omnibox/omnibox_ui_handler.h
index e80e64905794b49300ef2ff7b16bd79ffee353ca..7701dfc04f944403a63a8e12bb10eeb675e11d46 100644
--- a/chrome/browser/ui/webui/omnibox/omnibox_ui_handler.h
+++ b/chrome/browser/ui/webui/omnibox/omnibox_ui_handler.h
@@ -8,6 +8,7 @@
#include "base/memory/scoped_ptr.h"
#include "base/time.h"
+#include "chrome/browser/autocomplete/autocomplete.h"
#include "chrome/browser/autocomplete/autocomplete_controller_delegate.h"
#include "content/public/browser/web_ui_message_handler.h"
@@ -21,9 +22,9 @@ class Profile;
// UI Handler for chrome://omnibox/
// It listens for calls from javascript to StartOmniboxQuery() and
// passes those calls to its private AutocompleteController. It also
-// listens for updates from the AutocompleteController to
-// OnResultChanged() and passes those results on calling back into the
-// javascript to update the page.
+// listens for updates from the AutocompleteController to OnResultChanged()
+// and passes those results on calling back into the Javascript to
+// update the page.
class OmniboxUIHandler : public AutocompleteControllerDelegate,
public content::WebUIMessageHandler {
public:
@@ -32,8 +33,8 @@ class OmniboxUIHandler : public AutocompleteControllerDelegate,
// AutocompleteControllerDelegate implementation.
// Gets called when the result set of the AutocompleteController changes.
- // We transform the AutocompleteResult into a javascript object and
- // call the javascript function gotNewAutocompleteResult with it.
+ // We transform the AutocompleteResult into a Javascript object and
+ // call the Javascript function gotNewAutocompleteResult with it.
// |default_match_changed| is given to us by the AutocompleteController
// but we don't need it. It's ignored.
virtual void OnResultChanged(bool default_match_changed) OVERRIDE;
@@ -51,6 +52,14 @@ class OmniboxUIHandler : public AutocompleteControllerDelegate,
// where the first element is the input string.
void StartOmniboxQuery(const base::ListValue* one_element_input_string);
+ // Helper function for OnResultChanged().
+ // Takes an iterator over AutocompleteMatches and packages them into
+ // the DictionaryValue output, all stored under the given prefix.
+ void AddResultToDictionary(const std::string prefix,
+ ACMatches::const_iterator result_it,
+ ACMatches::const_iterator end,
+ base::DictionaryValue* output);
+
// The omnibox AutocompleteController that collects/sorts/dup-
// eliminates the results as they come in.
scoped_ptr<AutocompleteController> controller_;
« no previous file with comments | « chrome/browser/resources/omnibox/omnibox.js ('k') | chrome/browser/ui/webui/omnibox/omnibox_ui_handler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698