OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 // KeywordExtensionsDelegateImpl contains the extensions-only logic used by | 5 // KeywordExtensionsDelegateImpl contains the extensions-only logic used by |
6 // KeywordProvider. Overrides KeywordExtensionsDelegate which does nothing. | 6 // KeywordProvider. Overrides KeywordExtensionsDelegate which does nothing. |
7 | 7 |
8 #ifndef CHROME_BROWSER_AUTOCOMPLETE_KEYWORD_EXTENSIONS_DELEGATE_IMPL_H_ | 8 #ifndef CHROME_BROWSER_AUTOCOMPLETE_KEYWORD_EXTENSIONS_DELEGATE_IMPL_H_ |
9 #define CHROME_BROWSER_AUTOCOMPLETE_KEYWORD_EXTENSIONS_DELEGATE_IMPL_H_ | 9 #define CHROME_BROWSER_AUTOCOMPLETE_KEYWORD_EXTENSIONS_DELEGATE_IMPL_H_ |
10 | 10 |
11 #include <vector> | 11 #include <vector> |
12 | 12 |
13 #include "base/compiler_specific.h" | 13 #include "base/compiler_specific.h" |
14 #include "base/macros.h" | 14 #include "base/macros.h" |
15 #include "components/omnibox/browser/autocomplete_input.h" | 15 #include "components/omnibox/browser/autocomplete_input.h" |
16 #include "components/omnibox/browser/autocomplete_match.h" | 16 #include "components/omnibox/browser/autocomplete_match.h" |
17 #include "components/omnibox/browser/autocomplete_provider_listener.h" | 17 #include "components/omnibox/browser/autocomplete_provider_listener.h" |
18 #include "components/omnibox/browser/keyword_extensions_delegate.h" | 18 #include "components/omnibox/browser/keyword_extensions_delegate.h" |
19 #include "components/omnibox/browser/keyword_provider.h" | 19 #include "components/omnibox/browser/keyword_provider.h" |
20 #include "content/public/browser/notification_observer.h" | 20 #include "content/public/browser/notification_observer.h" |
21 #include "content/public/browser/notification_registrar.h" | 21 #include "content/public/browser/notification_registrar.h" |
| 22 #include "extensions/features/features.h" |
22 | 23 |
23 #if !defined(ENABLE_EXTENSIONS) | 24 #if !BUILDFLAG(ENABLE_EXTENSIONS) |
24 #error "Should not be included when extensions are disabled" | 25 #error "Should not be included when extensions are disabled" |
25 #endif | 26 #endif |
26 | 27 |
27 class Profile; | 28 class Profile; |
28 | 29 |
29 class KeywordExtensionsDelegateImpl : public KeywordExtensionsDelegate, | 30 class KeywordExtensionsDelegateImpl : public KeywordExtensionsDelegate, |
30 public content::NotificationObserver { | 31 public content::NotificationObserver { |
31 public: | 32 public: |
32 KeywordExtensionsDelegateImpl(Profile* profile, KeywordProvider* provider); | 33 KeywordExtensionsDelegateImpl(Profile* profile, KeywordProvider* provider); |
33 ~KeywordExtensionsDelegateImpl() override; | 34 ~KeywordExtensionsDelegateImpl() override; |
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
81 content::NotificationRegistrar registrar_; | 82 content::NotificationRegistrar registrar_; |
82 | 83 |
83 // We need our input IDs to be unique across all profiles, so we keep a global | 84 // We need our input IDs to be unique across all profiles, so we keep a global |
84 // UID that each provider uses. | 85 // UID that each provider uses. |
85 static int global_input_uid_; | 86 static int global_input_uid_; |
86 | 87 |
87 DISALLOW_COPY_AND_ASSIGN(KeywordExtensionsDelegateImpl); | 88 DISALLOW_COPY_AND_ASSIGN(KeywordExtensionsDelegateImpl); |
88 }; | 89 }; |
89 | 90 |
90 #endif // CHROME_BROWSER_AUTOCOMPLETE_KEYWORD_EXTENSIONS_DELEGATE_IMPL_H_ | 91 #endif // CHROME_BROWSER_AUTOCOMPLETE_KEYWORD_EXTENSIONS_DELEGATE_IMPL_H_ |
OLD | NEW |