OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/chrome_content_browser_client.h" | 5 #include "chrome/browser/chrome_content_browser_client.h" |
6 | 6 |
7 #include <map> | 7 #include <map> |
8 #include <set> | 8 #include <set> |
9 #include <utility> | 9 #include <utility> |
10 #include <vector> | 10 #include <vector> |
(...skipping 252 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
263 #endif | 263 #endif |
264 | 264 |
265 #if defined(ENABLE_WEBRTC) | 265 #if defined(ENABLE_WEBRTC) |
266 #include "chrome/browser/media/webrtc_logging_handler_host.h" | 266 #include "chrome/browser/media/webrtc_logging_handler_host.h" |
267 #endif | 267 #endif |
268 | 268 |
269 #if defined(ENABLE_MEDIA_ROUTER) | 269 #if defined(ENABLE_MEDIA_ROUTER) |
270 #include "chrome/browser/media/router/presentation_service_delegate_impl.h" | 270 #include "chrome/browser/media/router/presentation_service_delegate_impl.h" |
271 #endif | 271 #endif |
272 | 272 |
| 273 #if !defined(OS_ANDROID) && !defined(OS_IOS) |
| 274 #include "chrome/browser/usb/web_usb_permission_bubble.h" |
| 275 #endif |
| 276 |
273 using base::FileDescriptor; | 277 using base::FileDescriptor; |
274 using blink::WebWindowFeatures; | 278 using blink::WebWindowFeatures; |
275 using content::AccessTokenStore; | 279 using content::AccessTokenStore; |
276 using content::BrowserThread; | 280 using content::BrowserThread; |
277 using content::BrowserURLHandler; | 281 using content::BrowserURLHandler; |
278 using content::ChildProcessSecurityPolicy; | 282 using content::ChildProcessSecurityPolicy; |
279 using content::QuotaPermissionContext; | 283 using content::QuotaPermissionContext; |
280 using content::RenderFrameHost; | 284 using content::RenderFrameHost; |
281 using content::RenderViewHost; | 285 using content::RenderViewHost; |
282 using content::ResourceType; | 286 using content::ResourceType; |
(...skipping 350 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
633 mojo::InterfaceRequest<device::usb::DeviceManager> request) { | 637 mojo::InterfaceRequest<device::usb::DeviceManager> request) { |
634 #if !defined(OS_ANDROID) && !defined(OS_IOS) | 638 #if !defined(OS_ANDROID) && !defined(OS_IOS) |
635 device::usb::PermissionProviderPtr permission_provider; | 639 device::usb::PermissionProviderPtr permission_provider; |
636 WebUSBPermissionProvider::Create(render_frame_host, | 640 WebUSBPermissionProvider::Create(render_frame_host, |
637 mojo::GetProxy(&permission_provider)); | 641 mojo::GetProxy(&permission_provider)); |
638 device::usb::DeviceManagerImpl::Create(permission_provider.Pass(), | 642 device::usb::DeviceManagerImpl::Create(permission_provider.Pass(), |
639 request.Pass()); | 643 request.Pass()); |
640 #endif // !defined(OS_ANDROID) && !defined(OS_IOS) | 644 #endif // !defined(OS_ANDROID) && !defined(OS_IOS) |
641 } | 645 } |
642 | 646 |
| 647 #if !defined(OS_ANDROID) && !defined(OS_IOS) |
| 648 void CreateWebUsbPermissionBubble( |
| 649 RenderFrameHost* render_frame_host, |
| 650 mojo::InterfaceRequest<webusb::WebUsbPermissionBubble> request) { |
| 651 ChromeWebUsbPermissionBubble::Create(render_frame_host, request.Pass()); |
| 652 } |
| 653 #endif |
| 654 |
643 } // namespace | 655 } // namespace |
644 | 656 |
645 ChromeContentBrowserClient::ChromeContentBrowserClient() | 657 ChromeContentBrowserClient::ChromeContentBrowserClient() |
646 : | 658 : |
647 weak_factory_(this) { | 659 weak_factory_(this) { |
648 #if defined(ENABLE_PLUGINS) | 660 #if defined(ENABLE_PLUGINS) |
649 for (size_t i = 0; i < arraysize(kPredefinedAllowedDevChannelOrigins); ++i) | 661 for (size_t i = 0; i < arraysize(kPredefinedAllowedDevChannelOrigins); ++i) |
650 allowed_dev_channel_origins_.insert(kPredefinedAllowedDevChannelOrigins[i]); | 662 allowed_dev_channel_origins_.insert(kPredefinedAllowedDevChannelOrigins[i]); |
651 for (size_t i = 0; i < arraysize(kPredefinedAllowedFileHandleOrigins); ++i) | 663 for (size_t i = 0; i < arraysize(kPredefinedAllowedFileHandleOrigins); ++i) |
652 allowed_file_handle_origins_.insert(kPredefinedAllowedFileHandleOrigins[i]); | 664 allowed_file_handle_origins_.insert(kPredefinedAllowedFileHandleOrigins[i]); |
(...skipping 1919 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2572 registry->AddService( | 2584 registry->AddService( |
2573 base::Bind(&chromeos::attestation::PlatformVerificationImpl::Create, | 2585 base::Bind(&chromeos::attestation::PlatformVerificationImpl::Create, |
2574 render_frame_host)); | 2586 render_frame_host)); |
2575 #endif | 2587 #endif |
2576 } | 2588 } |
2577 | 2589 |
2578 void ChromeContentBrowserClient::RegisterRenderFrameMojoServices( | 2590 void ChromeContentBrowserClient::RegisterRenderFrameMojoServices( |
2579 content::ServiceRegistry* registry, | 2591 content::ServiceRegistry* registry, |
2580 content::RenderFrameHost* render_frame_host) { | 2592 content::RenderFrameHost* render_frame_host) { |
2581 registry->AddService(base::Bind(&CreateUsbDeviceManager, render_frame_host)); | 2593 registry->AddService(base::Bind(&CreateUsbDeviceManager, render_frame_host)); |
| 2594 #if !defined(OS_ANDROID) && !defined(OS_IOS) |
| 2595 registry->AddService( |
| 2596 base::Bind(&CreateWebUsbPermissionBubble, render_frame_host)); |
| 2597 #endif |
2582 } | 2598 } |
2583 | 2599 |
2584 void ChromeContentBrowserClient::OpenURL( | 2600 void ChromeContentBrowserClient::OpenURL( |
2585 content::BrowserContext* browser_context, | 2601 content::BrowserContext* browser_context, |
2586 const content::OpenURLParams& params, | 2602 const content::OpenURLParams& params, |
2587 const base::Callback<void(content::WebContents*)>& callback) { | 2603 const base::Callback<void(content::WebContents*)>& callback) { |
2588 DCHECK_CURRENTLY_ON(BrowserThread::UI); | 2604 DCHECK_CURRENTLY_ON(BrowserThread::UI); |
2589 | 2605 |
2590 #if !defined(OS_ANDROID) && !defined(OS_IOS) | 2606 #if !defined(OS_ANDROID) && !defined(OS_IOS) |
2591 chrome::NavigateParams nav_params( | 2607 chrome::NavigateParams nav_params( |
(...skipping 133 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2725 if (channel <= kMaxDisableEncryptionChannel) { | 2741 if (channel <= kMaxDisableEncryptionChannel) { |
2726 static const char* const kWebRtcDevSwitchNames[] = { | 2742 static const char* const kWebRtcDevSwitchNames[] = { |
2727 switches::kDisableWebRtcEncryption, | 2743 switches::kDisableWebRtcEncryption, |
2728 }; | 2744 }; |
2729 to_command_line->CopySwitchesFrom(from_command_line, | 2745 to_command_line->CopySwitchesFrom(from_command_line, |
2730 kWebRtcDevSwitchNames, | 2746 kWebRtcDevSwitchNames, |
2731 arraysize(kWebRtcDevSwitchNames)); | 2747 arraysize(kWebRtcDevSwitchNames)); |
2732 } | 2748 } |
2733 } | 2749 } |
2734 #endif // defined(ENABLE_WEBRTC) | 2750 #endif // defined(ENABLE_WEBRTC) |
OLD | NEW |