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_EXTENSION_OMNIBOX_API_H_ | 5 #ifndef CHROME_BROWSER_EXTENSIONS_API_OMNIBOX_OMNIBOX_API_H_ |
6 #define CHROME_BROWSER_EXTENSIONS_EXTENSION_OMNIBOX_API_H_ | 6 #define CHROME_BROWSER_EXTENSIONS_API_OMNIBOX_OMNIBOX_API_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include <string> | 9 #include <string> |
10 #include <vector> | 10 #include <vector> |
11 | 11 |
12 #include "base/string16.h" | 12 #include "base/string16.h" |
13 #include "chrome/browser/autocomplete/autocomplete_match.h" | 13 #include "chrome/browser/autocomplete/autocomplete_match.h" |
14 #include "chrome/browser/extensions/extension_function.h" | 14 #include "chrome/browser/extensions/extension_function.h" |
15 #include "webkit/glue/window_open_disposition.h" | 15 #include "webkit/glue/window_open_disposition.h" |
16 | 16 |
17 class TemplateURL; | 17 class TemplateURL; |
18 namespace base { | 18 namespace base { |
19 class ListValue; | 19 class ListValue; |
20 } | 20 } |
21 | 21 |
| 22 namespace extensions { |
| 23 |
22 // Event router class for events related to the omnibox API. | 24 // Event router class for events related to the omnibox API. |
23 class ExtensionOmniboxEventRouter { | 25 class ExtensionOmniboxEventRouter { |
24 public: | 26 public: |
25 // The user has just typed the omnibox keyword. This is sent exactly once in | 27 // The user has just typed the omnibox keyword. This is sent exactly once in |
26 // a given input session, before any OnInputChanged events. | 28 // a given input session, before any OnInputChanged events. |
27 static void OnInputStarted( | 29 static void OnInputStarted( |
28 Profile* profile, const std::string& extension_id); | 30 Profile* profile, const std::string& extension_id); |
29 | 31 |
30 // The user has changed what is typed into the omnibox while in an extension | 32 // The user has changed what is typed into the omnibox while in an extension |
31 // keyword session. Returns true if someone is listening to this event, and | 33 // keyword session. Returns true if someone is listening to this event, and |
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
108 const string16& remaining_input, | 110 const string16& remaining_input, |
109 AutocompleteMatch* match); | 111 AutocompleteMatch* match); |
110 | 112 |
111 // Launch an Extension App from |match| details provided by the Omnibox. If the | 113 // Launch an Extension App from |match| details provided by the Omnibox. If the |
112 // application wants to launch as a window or panel, |disposition| is ignored; | 114 // application wants to launch as a window or panel, |disposition| is ignored; |
113 // otherwise it's used to determine in which tab we'll launch the application. | 115 // otherwise it's used to determine in which tab we'll launch the application. |
114 void LaunchAppFromOmnibox(const AutocompleteMatch& match, | 116 void LaunchAppFromOmnibox(const AutocompleteMatch& match, |
115 Profile* profile, | 117 Profile* profile, |
116 WindowOpenDisposition disposition); | 118 WindowOpenDisposition disposition); |
117 | 119 |
118 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_OMNIBOX_API_H_ | 120 } // namespace extensions |
| 121 |
| 122 #endif // CHROME_BROWSER_EXTENSIONS_API_OMNIBOX_OMNIBOX_API_H_ |
OLD | NEW |