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