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_API_OMNIBOX_OMNIBOX_API_H_ | 5 #ifndef CHROME_BROWSER_EXTENSIONS_API_OMNIBOX_OMNIBOX_API_H_ |
6 #define CHROME_BROWSER_EXTENSIONS_API_OMNIBOX_OMNIBOX_API_H_ | 6 #define CHROME_BROWSER_EXTENSIONS_API_OMNIBOX_OMNIBOX_API_H_ |
7 | 7 |
8 #include <set> | 8 #include <set> |
9 #include <string> | 9 #include <string> |
10 #include <vector> | 10 #include <vector> |
(...skipping 12 matching lines...) Expand all Loading... |
23 | 23 |
24 class Profile; | 24 class Profile; |
25 class TemplateURL; | 25 class TemplateURL; |
26 class TemplateURLService; | 26 class TemplateURLService; |
27 | 27 |
28 namespace base { | 28 namespace base { |
29 class ListValue; | 29 class ListValue; |
30 } | 30 } |
31 | 31 |
32 namespace content { | 32 namespace content { |
| 33 class BrowserContext; |
33 class WebContents; | 34 class WebContents; |
34 } | 35 } |
35 | 36 |
36 namespace gfx { | 37 namespace gfx { |
37 class Image; | 38 class Image; |
38 } | 39 } |
39 | 40 |
40 namespace extensions { | 41 namespace extensions { |
41 | 42 |
42 // Event router class for events related to the omnibox API. | 43 // Event router class for events related to the omnibox API. |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
78 protected: | 79 protected: |
79 virtual ~OmniboxSendSuggestionsFunction() {} | 80 virtual ~OmniboxSendSuggestionsFunction() {} |
80 | 81 |
81 // ExtensionFunction: | 82 // ExtensionFunction: |
82 virtual bool RunImpl() OVERRIDE; | 83 virtual bool RunImpl() OVERRIDE; |
83 }; | 84 }; |
84 | 85 |
85 class OmniboxAPI : public ProfileKeyedAPI, | 86 class OmniboxAPI : public ProfileKeyedAPI, |
86 public content::NotificationObserver { | 87 public content::NotificationObserver { |
87 public: | 88 public: |
88 explicit OmniboxAPI(Profile* profile); | 89 explicit OmniboxAPI(content::BrowserContext* context); |
89 virtual ~OmniboxAPI(); | 90 virtual ~OmniboxAPI(); |
90 | 91 |
91 // ProfileKeyedAPI implementation. | 92 // ProfileKeyedAPI implementation. |
92 static ProfileKeyedAPIFactory<OmniboxAPI>* GetFactoryInstance(); | 93 static ProfileKeyedAPIFactory<OmniboxAPI>* GetFactoryInstance(); |
93 | 94 |
94 // Convenience method to get the OmniboxAPI for a profile. | 95 // Convenience method to get the OmniboxAPI for a profile. |
95 static OmniboxAPI* Get(Profile* profile); | 96 static OmniboxAPI* Get(content::BrowserContext* context); |
96 | 97 |
97 // content::NotificationObserver implementation. | 98 // content::NotificationObserver implementation. |
98 virtual void Observe(int type, | 99 virtual void Observe(int type, |
99 const content::NotificationSource& source, | 100 const content::NotificationSource& source, |
100 const content::NotificationDetails& details) OVERRIDE; | 101 const content::NotificationDetails& details) OVERRIDE; |
101 | 102 |
102 // BrowserContextKeyedService implementation. | 103 // BrowserContextKeyedService implementation. |
103 virtual void Shutdown() OVERRIDE; | 104 virtual void Shutdown() OVERRIDE; |
104 | 105 |
105 // Returns the icon to display in the omnibox for the given extension. | 106 // Returns the icon to display in the omnibox for the given extension. |
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
165 AutocompleteMatch* match); | 166 AutocompleteMatch* match); |
166 | 167 |
167 // This function converts style information populated by the JSON schema | 168 // This function converts style information populated by the JSON schema |
168 // // compiler into an ACMatchClassifications object. | 169 // // compiler into an ACMatchClassifications object. |
169 ACMatchClassifications StyleTypesToACMatchClassifications( | 170 ACMatchClassifications StyleTypesToACMatchClassifications( |
170 const api::omnibox::SuggestResult &suggestion); | 171 const api::omnibox::SuggestResult &suggestion); |
171 | 172 |
172 } // namespace extensions | 173 } // namespace extensions |
173 | 174 |
174 #endif // CHROME_BROWSER_EXTENSIONS_API_OMNIBOX_OMNIBOX_API_H_ | 175 #endif // CHROME_BROWSER_EXTENSIONS_API_OMNIBOX_OMNIBOX_API_H_ |
OLD | NEW |