| 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 <memory> |
| 8 #include <set> | 9 #include <set> |
| 9 #include <string> | 10 #include <string> |
| 10 | 11 |
| 11 #include "base/macros.h" | 12 #include "base/macros.h" |
| 12 #include "base/memory/scoped_ptr.h" | |
| 13 #include "base/scoped_observer.h" | 13 #include "base/scoped_observer.h" |
| 14 #include "base/strings/string16.h" | 14 #include "base/strings/string16.h" |
| 15 #include "chrome/browser/extensions/chrome_extension_function.h" | 15 #include "chrome/browser/extensions/chrome_extension_function.h" |
| 16 #include "chrome/browser/extensions/extension_icon_manager.h" | 16 #include "chrome/browser/extensions/extension_icon_manager.h" |
| 17 #include "chrome/common/extensions/api/omnibox.h" | 17 #include "chrome/common/extensions/api/omnibox.h" |
| 18 #include "components/omnibox/browser/autocomplete_match.h" | 18 #include "components/omnibox/browser/autocomplete_match.h" |
| 19 #include "components/search_engines/template_url_service.h" | 19 #include "components/search_engines/template_url_service.h" |
| 20 #include "extensions/browser/browser_context_keyed_api_factory.h" | 20 #include "extensions/browser/browser_context_keyed_api_factory.h" |
| 21 #include "extensions/browser/extension_registry_observer.h" | 21 #include "extensions/browser/extension_registry_observer.h" |
| 22 #include "ui/base/window_open_disposition.h" | 22 #include "ui/base/window_open_disposition.h" |
| (...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 135 PendingExtensions pending_extensions_; | 135 PendingExtensions pending_extensions_; |
| 136 | 136 |
| 137 // Listen to extension load, unloaded notifications. | 137 // Listen to extension load, unloaded notifications. |
| 138 ScopedObserver<ExtensionRegistry, ExtensionRegistryObserver> | 138 ScopedObserver<ExtensionRegistry, ExtensionRegistryObserver> |
| 139 extension_registry_observer_; | 139 extension_registry_observer_; |
| 140 | 140 |
| 141 // Keeps track of favicon-sized omnibox icons for extensions. | 141 // Keeps track of favicon-sized omnibox icons for extensions. |
| 142 ExtensionIconManager omnibox_icon_manager_; | 142 ExtensionIconManager omnibox_icon_manager_; |
| 143 ExtensionIconManager omnibox_popup_icon_manager_; | 143 ExtensionIconManager omnibox_popup_icon_manager_; |
| 144 | 144 |
| 145 scoped_ptr<TemplateURLService::Subscription> template_url_sub_; | 145 std::unique_ptr<TemplateURLService::Subscription> template_url_sub_; |
| 146 | 146 |
| 147 DISALLOW_COPY_AND_ASSIGN(OmniboxAPI); | 147 DISALLOW_COPY_AND_ASSIGN(OmniboxAPI); |
| 148 }; | 148 }; |
| 149 | 149 |
| 150 template <> | 150 template <> |
| 151 void BrowserContextKeyedAPIFactory<OmniboxAPI>::DeclareFactoryDependencies(); | 151 void BrowserContextKeyedAPIFactory<OmniboxAPI>::DeclareFactoryDependencies(); |
| 152 | 152 |
| 153 class OmniboxSetDefaultSuggestionFunction : public ChromeSyncExtensionFunction { | 153 class OmniboxSetDefaultSuggestionFunction : public ChromeSyncExtensionFunction { |
| 154 public: | 154 public: |
| 155 DECLARE_EXTENSION_FUNCTION("omnibox.setDefaultSuggestion", | 155 DECLARE_EXTENSION_FUNCTION("omnibox.setDefaultSuggestion", |
| (...skipping 15 matching lines...) Expand all Loading... |
| 171 AutocompleteMatch* match); | 171 AutocompleteMatch* match); |
| 172 | 172 |
| 173 // This function converts style information populated by the JSON schema | 173 // This function converts style information populated by the JSON schema |
| 174 // // compiler into an ACMatchClassifications object. | 174 // // compiler into an ACMatchClassifications object. |
| 175 ACMatchClassifications StyleTypesToACMatchClassifications( | 175 ACMatchClassifications StyleTypesToACMatchClassifications( |
| 176 const api::omnibox::SuggestResult &suggestion); | 176 const api::omnibox::SuggestResult &suggestion); |
| 177 | 177 |
| 178 } // namespace extensions | 178 } // namespace extensions |
| 179 | 179 |
| 180 #endif // CHROME_BROWSER_EXTENSIONS_API_OMNIBOX_OMNIBOX_API_H_ | 180 #endif // CHROME_BROWSER_EXTENSIONS_API_OMNIBOX_OMNIBOX_API_H_ |
| OLD | NEW |