OLD | NEW |
(Empty) | |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #ifndef CHROME_BROWSER_EXTENSIONS_EXTENSION_OMNIBOX_API_H_ |
| 6 #define CHROME_BROWSER_EXTENSIONS_EXTENSION_OMNIBOX_API_H_ |
| 7 |
| 8 #include "chrome/browser/extensions/extension_function.h" |
| 9 |
| 10 class ListValue; |
| 11 |
| 12 // Event router class for events related to the omnibox API. |
| 13 class ExtensionOmniboxEventRouter { |
| 14 public: |
| 15 // The user has changed what is typed into the omnibox while in an extension |
| 16 // keyword session. Returns true if someone is listening to this event, and |
| 17 // thus we have some degree of confidence we'll get a response. |
| 18 static bool OnInputChanged( |
| 19 Profile* profile, const std::string& extension_id, |
| 20 const std::string& input, int suggest_id); |
| 21 |
| 22 // The user has accepted the omnibox input. |
| 23 static void OnInputEntered( |
| 24 Profile* profile, const std::string& extension_id, |
| 25 const std::string& input); |
| 26 |
| 27 private: |
| 28 DISALLOW_COPY_AND_ASSIGN(ExtensionOmniboxEventRouter); |
| 29 }; |
| 30 |
| 31 class OmniboxSendSuggestionsFunction : public SyncExtensionFunction { |
| 32 public: |
| 33 virtual bool RunImpl(); |
| 34 DECLARE_EXTENSION_FUNCTION_NAME("experimental.omnibox.sendSuggestions"); |
| 35 }; |
| 36 |
| 37 typedef std::pair<int, ListValue*> ExtensionOmniboxSuggestions; |
| 38 |
| 39 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_OMNIBOX_API_H_ |
OLD | NEW |