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 #include "chrome/browser/autocomplete/keyword_extensions_delegate_impl.h" | 5 #include "chrome/browser/autocomplete/keyword_extensions_delegate_impl.h" |
6 | 6 |
7 #include "base/memory/ref_counted.h" | 7 #include "base/memory/ref_counted.h" |
8 #include "base/path_service.h" | 8 #include "base/path_service.h" |
9 #include "chrome/browser/extensions/extension_service.h" | 9 #include "chrome/browser/extensions/extension_service.h" |
10 #include "chrome/browser/extensions/extension_service_test_base.h" | 10 #include "chrome/browser/extensions/extension_service_test_base.h" |
11 #include "chrome/browser/extensions/extension_util.h" | 11 #include "chrome/browser/extensions/extension_util.h" |
12 #include "chrome/browser/extensions/test_extension_system.h" | 12 #include "chrome/browser/extensions/test_extension_system.h" |
13 #include "chrome/browser/extensions/unpacked_installer.h" | 13 #include "chrome/browser/extensions/unpacked_installer.h" |
14 #include "chrome/browser/profiles/profile.h" | 14 #include "chrome/browser/profiles/profile.h" |
15 #include "chrome/common/chrome_paths.h" | 15 #include "chrome/common/chrome_paths.h" |
16 #include "components/omnibox/keyword_provider.h" | 16 #include "components/omnibox/keyword_provider.h" |
17 #include "components/search_engines/template_url_service.h" | 17 #include "components/search_engines/template_url_service.h" |
18 #include "extensions/browser/extension_registry.h" | 18 #include "extensions/browser/extension_registry.h" |
19 #include "extensions/browser/extension_registry_observer.h" | 19 #include "extensions/browser/extension_registry_observer.h" |
20 #include "extensions/common/extension.h" | 20 #include "extensions/common/extension.h" |
21 | 21 |
22 namespace extensions { | 22 namespace extensions { |
23 | 23 |
24 namespace { | 24 namespace { |
25 | 25 |
26 class ScopedExtensionLoadObserver : public ExtensionRegistryObserver { | 26 class ScopedExtensionLoadObserver : public ExtensionRegistryObserver { |
27 public: | 27 public: |
28 ScopedExtensionLoadObserver(ExtensionRegistry* registry, | 28 ScopedExtensionLoadObserver(ExtensionRegistry* registry, |
29 const base::Closure& quit_closure); | 29 const base::Closure& quit_closure); |
30 virtual ~ScopedExtensionLoadObserver(); | 30 ~ScopedExtensionLoadObserver() override; |
31 | 31 |
32 private: | 32 private: |
33 virtual void OnExtensionInstalled(content::BrowserContext* browser_context, | 33 void OnExtensionInstalled(content::BrowserContext* browser_context, |
34 const Extension* extension, | 34 const Extension* extension, |
35 bool is_update) override; | 35 bool is_update) override; |
36 | 36 |
37 ExtensionRegistry* registry_; | 37 ExtensionRegistry* registry_; |
38 base::Closure quit_closure_; | 38 base::Closure quit_closure_; |
39 | 39 |
40 DISALLOW_COPY_AND_ASSIGN(ScopedExtensionLoadObserver); | 40 DISALLOW_COPY_AND_ASSIGN(ScopedExtensionLoadObserver); |
41 }; | 41 }; |
42 | 42 |
43 ScopedExtensionLoadObserver::ScopedExtensionLoadObserver( | 43 ScopedExtensionLoadObserver::ScopedExtensionLoadObserver( |
44 ExtensionRegistry* registry, | 44 ExtensionRegistry* registry, |
45 const base::Closure& quit_closure) | 45 const base::Closure& quit_closure) |
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
134 RunTest(false); | 134 RunTest(false); |
135 } | 135 } |
136 | 136 |
137 TEST_F(KeywordExtensionsDelegateImplTest, IsEnabledExtensionIncognito) { | 137 TEST_F(KeywordExtensionsDelegateImplTest, IsEnabledExtensionIncognito) { |
138 RunTest(true); | 138 RunTest(true); |
139 } | 139 } |
140 | 140 |
141 } // namespace | 141 } // namespace |
142 | 142 |
143 } // namespace extensions | 143 } // namespace extensions |
OLD | NEW |