| 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_UI_WEBUI_OMNIBOX_OMNIBOX_UI_HANDLER_H_ | 5 #ifndef CHROME_BROWSER_UI_WEBUI_OMNIBOX_OMNIBOX_UI_HANDLER_H_ |
| 6 #define CHROME_BROWSER_UI_WEBUI_OMNIBOX_OMNIBOX_UI_HANDLER_H_ | 6 #define CHROME_BROWSER_UI_WEBUI_OMNIBOX_OMNIBOX_UI_HANDLER_H_ |
| 7 | 7 |
| 8 #include "base/basictypes.h" | 8 #include "base/basictypes.h" |
| 9 #include "base/compiler_specific.h" | 9 #include "base/compiler_specific.h" |
| 10 #include "base/memory/scoped_ptr.h" | 10 #include "base/memory/scoped_ptr.h" |
| (...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 48 | 48 |
| 49 private: | 49 private: |
| 50 // Gets called from the javascript when a user enters text into the | 50 // Gets called from the javascript when a user enters text into the |
| 51 // chrome://omnibox/ text box and clicks submit or hits enter. | 51 // chrome://omnibox/ text box and clicks submit or hits enter. |
| 52 // |input| is expected to be a four-element list: | 52 // |input| is expected to be a four-element list: |
| 53 // - first element: input string. | 53 // - first element: input string. |
| 54 // - second element: the cursor position. | 54 // - second element: the cursor position. |
| 55 // - third element: boolean indicating whether we should set | 55 // - third element: boolean indicating whether we should set |
| 56 // prevent_inline_autocomplete or not. | 56 // prevent_inline_autocomplete or not. |
| 57 // - fourth element: boolean indicating whether we should set prefer_keyword | 57 // - fourth element: boolean indicating whether we should set prefer_keyword |
| 58 // - fifth element: current page classification value (enum |
| 59 // PageClassification from omnibox_event.proto) |
| 58 void StartOmniboxQuery(const base::ListValue* input); | 60 void StartOmniboxQuery(const base::ListValue* input); |
| 59 | 61 |
| 60 // Helper function for OnResultChanged(). | 62 // Helper function for OnResultChanged(). |
| 61 // Takes an iterator over AutocompleteMatches and packages them into | 63 // Takes an iterator over AutocompleteMatches and packages them into |
| 62 // the DictionaryValue output, all stored under the given prefix. | 64 // the DictionaryValue output, all stored under the given prefix. |
| 63 void AddResultToDictionary(const std::string& prefix, | 65 void AddResultToDictionary(const std::string& prefix, |
| 64 ACMatches::const_iterator result_it, | 66 ACMatches::const_iterator result_it, |
| 65 ACMatches::const_iterator end, | 67 ACMatches::const_iterator end, |
| 66 base::DictionaryValue* output); | 68 base::DictionaryValue* output); |
| 67 | 69 |
| (...skipping 15 matching lines...) Expand all Loading... |
| 83 // hand back to the javascript. | 85 // hand back to the javascript. |
| 84 base::Time time_omnibox_started_; | 86 base::Time time_omnibox_started_; |
| 85 | 87 |
| 86 // The Profile* handed to us in our constructor. | 88 // The Profile* handed to us in our constructor. |
| 87 Profile* profile_; | 89 Profile* profile_; |
| 88 | 90 |
| 89 DISALLOW_COPY_AND_ASSIGN(OmniboxUIHandler); | 91 DISALLOW_COPY_AND_ASSIGN(OmniboxUIHandler); |
| 90 }; | 92 }; |
| 91 | 93 |
| 92 #endif // CHROME_BROWSER_UI_WEBUI_OMNIBOX_OMNIBOX_UI_HANDLER_H_ | 94 #endif // CHROME_BROWSER_UI_WEBUI_OMNIBOX_OMNIBOX_UI_HANDLER_H_ |
| OLD | NEW |