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/extensions/api/chrome_extensions_api_client.h" | 5 #include "chrome/browser/extensions/api/chrome_extensions_api_client.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/files/file_path.h" | 8 #include "base/files/file_path.h" |
9 #include "base/memory/ptr_util.h" | 9 #include "base/memory/ptr_util.h" |
10 #include "build/build_config.h" | 10 #include "build/build_config.h" |
(...skipping 14 matching lines...) Expand all Loading... |
25 #include "chrome/browser/guest_view/mime_handler_view/chrome_mime_handler_view_g
uest_delegate.h" | 25 #include "chrome/browser/guest_view/mime_handler_view/chrome_mime_handler_view_g
uest_delegate.h" |
26 #include "chrome/browser/guest_view/web_view/chrome_web_view_guest_delegate.h" | 26 #include "chrome/browser/guest_view/web_view/chrome_web_view_guest_delegate.h" |
27 #include "chrome/browser/guest_view/web_view/chrome_web_view_permission_helper_d
elegate.h" | 27 #include "chrome/browser/guest_view/web_view/chrome_web_view_permission_helper_d
elegate.h" |
28 #include "chrome/browser/ui/pdf/chrome_pdf_web_contents_helper_client.h" | 28 #include "chrome/browser/ui/pdf/chrome_pdf_web_contents_helper_client.h" |
29 #include "components/pdf/browser/pdf_web_contents_helper.h" | 29 #include "components/pdf/browser/pdf_web_contents_helper.h" |
30 #include "content/public/browser/browser_context.h" | 30 #include "content/public/browser/browser_context.h" |
31 #include "content/public/browser/browser_thread.h" | 31 #include "content/public/browser/browser_thread.h" |
32 #include "extensions/browser/api/virtual_keyboard_private/virtual_keyboard_deleg
ate.h" | 32 #include "extensions/browser/api/virtual_keyboard_private/virtual_keyboard_deleg
ate.h" |
33 #include "extensions/browser/guest_view/web_view/web_view_guest.h" | 33 #include "extensions/browser/guest_view/web_view/web_view_guest.h" |
34 #include "extensions/browser/guest_view/web_view/web_view_permission_helper.h" | 34 #include "extensions/browser/guest_view/web_view/web_view_permission_helper.h" |
| 35 #include "printing/features/features.h" |
35 | 36 |
36 #if defined(OS_CHROMEOS) | 37 #if defined(OS_CHROMEOS) |
37 #include "chrome/browser/extensions/api/virtual_keyboard_private/chrome_virtual_
keyboard_delegate.h" | 38 #include "chrome/browser/extensions/api/virtual_keyboard_private/chrome_virtual_
keyboard_delegate.h" |
38 #endif | 39 #endif |
39 | 40 |
40 #if defined(ENABLE_PRINTING) | 41 #if BUILDFLAG(ENABLE_PRINTING) |
41 #if defined(ENABLE_PRINT_PREVIEW) | 42 #if BUILDFLAG(ENABLE_PRINT_PREVIEW) |
42 #include "chrome/browser/printing/print_preview_message_handler.h" | 43 #include "chrome/browser/printing/print_preview_message_handler.h" |
43 #include "chrome/browser/printing/print_view_manager.h" | 44 #include "chrome/browser/printing/print_view_manager.h" |
44 #else | 45 #else |
45 #include "chrome/browser/printing/print_view_manager_basic.h" | 46 #include "chrome/browser/printing/print_view_manager_basic.h" |
46 #endif // defined(ENABLE_PRINT_PREVIEW) | 47 #endif // BUILDFLAG(ENABLE_PRINT_PREVIEW) |
47 #endif // defined(ENABLE_PRINTING) | 48 #endif // BUILDFLAG(ENABLE_PRINTING) |
48 | 49 |
49 namespace extensions { | 50 namespace extensions { |
50 | 51 |
51 ChromeExtensionsAPIClient::ChromeExtensionsAPIClient() {} | 52 ChromeExtensionsAPIClient::ChromeExtensionsAPIClient() {} |
52 | 53 |
53 ChromeExtensionsAPIClient::~ChromeExtensionsAPIClient() {} | 54 ChromeExtensionsAPIClient::~ChromeExtensionsAPIClient() {} |
54 | 55 |
55 void ChromeExtensionsAPIClient::AddAdditionalValueStoreCaches( | 56 void ChromeExtensionsAPIClient::AddAdditionalValueStoreCaches( |
56 content::BrowserContext* context, | 57 content::BrowserContext* context, |
57 const scoped_refptr<ValueStoreFactory>& factory, | 58 const scoped_refptr<ValueStoreFactory>& factory, |
58 const scoped_refptr<base::ObserverListThreadSafe<SettingsObserver>>& | 59 const scoped_refptr<base::ObserverListThreadSafe<SettingsObserver>>& |
59 observers, | 60 observers, |
60 std::map<settings_namespace::Namespace, ValueStoreCache*>* caches) { | 61 std::map<settings_namespace::Namespace, ValueStoreCache*>* caches) { |
61 // Add support for chrome.storage.sync. | 62 // Add support for chrome.storage.sync. |
62 (*caches)[settings_namespace::SYNC] = | 63 (*caches)[settings_namespace::SYNC] = |
63 new SyncValueStoreCache(factory, observers, context->GetPath()); | 64 new SyncValueStoreCache(factory, observers, context->GetPath()); |
64 | 65 |
65 // Add support for chrome.storage.managed. | 66 // Add support for chrome.storage.managed. |
66 (*caches)[settings_namespace::MANAGED] = | 67 (*caches)[settings_namespace::MANAGED] = |
67 new ManagedValueStoreCache(context, factory, observers); | 68 new ManagedValueStoreCache(context, factory, observers); |
68 } | 69 } |
69 | 70 |
70 void ChromeExtensionsAPIClient::AttachWebContentsHelpers( | 71 void ChromeExtensionsAPIClient::AttachWebContentsHelpers( |
71 content::WebContents* web_contents) const { | 72 content::WebContents* web_contents) const { |
72 favicon::CreateContentFaviconDriverForWebContents(web_contents); | 73 favicon::CreateContentFaviconDriverForWebContents(web_contents); |
73 #if defined(ENABLE_PRINTING) | 74 #if BUILDFLAG(ENABLE_PRINTING) |
74 #if defined(ENABLE_PRINT_PREVIEW) | 75 #if BUILDFLAG(ENABLE_PRINT_PREVIEW) |
75 printing::PrintViewManager::CreateForWebContents(web_contents); | 76 printing::PrintViewManager::CreateForWebContents(web_contents); |
76 printing::PrintPreviewMessageHandler::CreateForWebContents(web_contents); | 77 printing::PrintPreviewMessageHandler::CreateForWebContents(web_contents); |
77 #else | 78 #else |
78 printing::PrintViewManagerBasic::CreateForWebContents(web_contents); | 79 printing::PrintViewManagerBasic::CreateForWebContents(web_contents); |
79 #endif // defined(ENABLE_PRINT_PREVIEW) | 80 #endif // BUILDFLAG(ENABLE_PRINT_PREVIEW) |
80 #endif // defined(ENABLE_PRINTING) | 81 #endif // BUILDFLAG(ENABLE_PRINTING) |
81 pdf::PDFWebContentsHelper::CreateForWebContentsWithClient( | 82 pdf::PDFWebContentsHelper::CreateForWebContentsWithClient( |
82 web_contents, std::unique_ptr<pdf::PDFWebContentsHelperClient>( | 83 web_contents, std::unique_ptr<pdf::PDFWebContentsHelperClient>( |
83 new ChromePDFWebContentsHelperClient())); | 84 new ChromePDFWebContentsHelperClient())); |
84 | 85 |
85 data_use_measurement::DataUseWebContentsObserver::CreateForWebContents( | 86 data_use_measurement::DataUseWebContentsObserver::CreateForWebContents( |
86 web_contents); | 87 web_contents); |
87 extensions::ChromeExtensionWebContentsObserver::CreateForWebContents( | 88 extensions::ChromeExtensionWebContentsObserver::CreateForWebContents( |
88 web_contents); | 89 web_contents); |
89 } | 90 } |
90 | 91 |
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
159 return new ChromeManagementAPIDelegate; | 160 return new ChromeManagementAPIDelegate; |
160 } | 161 } |
161 | 162 |
162 MetricsPrivateDelegate* ChromeExtensionsAPIClient::GetMetricsPrivateDelegate() { | 163 MetricsPrivateDelegate* ChromeExtensionsAPIClient::GetMetricsPrivateDelegate() { |
163 if (!metrics_private_delegate_) | 164 if (!metrics_private_delegate_) |
164 metrics_private_delegate_.reset(new ChromeMetricsPrivateDelegate()); | 165 metrics_private_delegate_.reset(new ChromeMetricsPrivateDelegate()); |
165 return metrics_private_delegate_.get(); | 166 return metrics_private_delegate_.get(); |
166 } | 167 } |
167 | 168 |
168 } // namespace extensions | 169 } // namespace extensions |
OLD | NEW |