| 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 17 matching lines...) Expand all Loading... |
| 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 #include "printing/features/features.h" |
| 36 | 36 |
| 37 #if defined(OS_CHROMEOS) | 37 #if defined(OS_CHROMEOS) |
| 38 #include "chrome/browser/extensions/api/file_handlers/non_native_file_system_del
egate_chromeos.h" |
| 38 #include "chrome/browser/extensions/api/virtual_keyboard_private/chrome_virtual_
keyboard_delegate.h" | 39 #include "chrome/browser/extensions/api/virtual_keyboard_private/chrome_virtual_
keyboard_delegate.h" |
| 39 #include "chrome/browser/extensions/clipboard_extension_helper_chromeos.h" | 40 #include "chrome/browser/extensions/clipboard_extension_helper_chromeos.h" |
| 40 #endif | 41 #endif |
| 41 | 42 |
| 42 #if BUILDFLAG(ENABLE_PRINTING) | 43 #if BUILDFLAG(ENABLE_PRINTING) |
| 43 #if BUILDFLAG(ENABLE_PRINT_PREVIEW) | 44 #if BUILDFLAG(ENABLE_PRINT_PREVIEW) |
| 44 #include "chrome/browser/printing/print_preview_message_handler.h" | 45 #include "chrome/browser/printing/print_preview_message_handler.h" |
| 45 #include "chrome/browser/printing/print_view_manager.h" | 46 #include "chrome/browser/printing/print_view_manager.h" |
| 46 #else | 47 #else |
| 47 #include "chrome/browser/printing/print_view_manager_basic.h" | 48 #include "chrome/browser/printing/print_view_manager_basic.h" |
| (...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 161 return new ChromeManagementAPIDelegate; | 162 return new ChromeManagementAPIDelegate; |
| 162 } | 163 } |
| 163 | 164 |
| 164 MetricsPrivateDelegate* ChromeExtensionsAPIClient::GetMetricsPrivateDelegate() { | 165 MetricsPrivateDelegate* ChromeExtensionsAPIClient::GetMetricsPrivateDelegate() { |
| 165 if (!metrics_private_delegate_) | 166 if (!metrics_private_delegate_) |
| 166 metrics_private_delegate_.reset(new ChromeMetricsPrivateDelegate()); | 167 metrics_private_delegate_.reset(new ChromeMetricsPrivateDelegate()); |
| 167 return metrics_private_delegate_.get(); | 168 return metrics_private_delegate_.get(); |
| 168 } | 169 } |
| 169 | 170 |
| 170 #if defined(OS_CHROMEOS) | 171 #if defined(OS_CHROMEOS) |
| 172 NonNativeFileSystemDelegate* |
| 173 ChromeExtensionsAPIClient::GetNonNativeFileSystemDelegate() { |
| 174 if (!non_native_file_system_delegate_) { |
| 175 non_native_file_system_delegate_ = |
| 176 base::MakeUnique<NonNativeFileSystemDelegateChromeOS>(); |
| 177 } |
| 178 return non_native_file_system_delegate_.get(); |
| 179 } |
| 180 |
| 171 void ChromeExtensionsAPIClient::SaveImageDataToClipboard( | 181 void ChromeExtensionsAPIClient::SaveImageDataToClipboard( |
| 172 const std::vector<char>& image_data, | 182 const std::vector<char>& image_data, |
| 173 api::clipboard::ImageType type, | 183 api::clipboard::ImageType type, |
| 174 const base::Closure& success_callback, | 184 const base::Closure& success_callback, |
| 175 const base::Callback<void(const std::string&)>& error_callback) { | 185 const base::Callback<void(const std::string&)>& error_callback) { |
| 176 if (!clipboard_extension_helper_) | 186 if (!clipboard_extension_helper_) |
| 177 clipboard_extension_helper_ = base::MakeUnique<ClipboardExtensionHelper>(); | 187 clipboard_extension_helper_ = base::MakeUnique<ClipboardExtensionHelper>(); |
| 178 clipboard_extension_helper_->DecodeAndSaveImageData( | 188 clipboard_extension_helper_->DecodeAndSaveImageData( |
| 179 image_data, type, success_callback, error_callback); | 189 image_data, type, success_callback, error_callback); |
| 180 } | 190 } |
| 181 #endif | 191 #endif |
| 182 | 192 |
| 183 } // namespace extensions | 193 } // namespace extensions |
| OLD | NEW |