Chromium Code Reviews| 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 254 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 265 #endif | 265 #endif |
| 266 | 266 |
| 267 #if defined(ENABLE_WEBRTC) | 267 #if defined(ENABLE_WEBRTC) |
| 268 #include "chrome/browser/media/webrtc_logging_handler_host.h" | 268 #include "chrome/browser/media/webrtc_logging_handler_host.h" |
| 269 #endif | 269 #endif |
| 270 | 270 |
| 271 #if defined(ENABLE_MEDIA_ROUTER) | 271 #if defined(ENABLE_MEDIA_ROUTER) |
| 272 #include "chrome/browser/media/router/presentation_service_delegate_impl.h" | 272 #include "chrome/browser/media/router/presentation_service_delegate_impl.h" |
| 273 #endif | 273 #endif |
| 274 | 274 |
| 275 #if !defined(OS_ANDROID) && !defined(OS_IOS) | |
| 276 #include "components/webusb/public/interfaces/webusb_permission_bubble.mojom.h" | |
| 277 #endif | |
| 278 | |
| 275 using base::FileDescriptor; | 279 using base::FileDescriptor; |
| 276 using blink::WebWindowFeatures; | 280 using blink::WebWindowFeatures; |
| 277 using content::AccessTokenStore; | 281 using content::AccessTokenStore; |
| 278 using content::BrowserThread; | 282 using content::BrowserThread; |
| 279 using content::BrowserURLHandler; | 283 using content::BrowserURLHandler; |
| 280 using content::ChildProcessSecurityPolicy; | 284 using content::ChildProcessSecurityPolicy; |
| 281 using content::QuotaPermissionContext; | 285 using content::QuotaPermissionContext; |
| 282 using content::RenderFrameHost; | 286 using content::RenderFrameHost; |
| 283 using content::RenderViewHost; | 287 using content::RenderViewHost; |
| 284 using content::ResourceType; | 288 using content::ResourceType; |
| (...skipping 355 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 640 NOTREACHED(); | 644 NOTREACHED(); |
| 641 return; | 645 return; |
| 642 } | 646 } |
| 643 | 647 |
| 644 UsbTabHelper* tab_helper = | 648 UsbTabHelper* tab_helper = |
| 645 UsbTabHelper::GetOrCreateForWebContents(web_contents); | 649 UsbTabHelper::GetOrCreateForWebContents(web_contents); |
| 646 tab_helper->CreateDeviceManager(render_frame_host, request.Pass()); | 650 tab_helper->CreateDeviceManager(render_frame_host, request.Pass()); |
| 647 #endif // !defined(OS_ANDROID) && !defined(OS_IOS) | 651 #endif // !defined(OS_ANDROID) && !defined(OS_IOS) |
| 648 } | 652 } |
| 649 | 653 |
| 654 #if !defined(OS_ANDROID) && !defined(OS_IOS) | |
| 655 void CreateWebUsbPermissionBubble( | |
| 656 RenderFrameHost* render_frame_host, | |
| 657 mojo::InterfaceRequest<webusb::WebUsbPermissionBubble> request) { | |
| 658 WebContents* web_contents = | |
| 659 WebContents::FromRenderFrameHost(render_frame_host); | |
| 660 if (!web_contents) { | |
| 661 NOTREACHED(); | |
| 662 return; | |
| 663 } | |
| 664 | |
| 665 UsbTabHelper* tab_helper = | |
| 666 UsbTabHelper::GetOrCreateForWebContents(web_contents); | |
| 667 tab_helper->CreatePermissionBubble(render_frame_host, request.Pass()); | |
| 668 } | |
| 669 #endif | |
| 670 | |
| 650 } // namespace | 671 } // namespace |
| 651 | 672 |
| 652 ChromeContentBrowserClient::ChromeContentBrowserClient() | 673 ChromeContentBrowserClient::ChromeContentBrowserClient() |
| 653 : | 674 : |
| 654 weak_factory_(this) { | 675 weak_factory_(this) { |
| 655 #if defined(ENABLE_PLUGINS) | 676 #if defined(ENABLE_PLUGINS) |
| 656 for (size_t i = 0; i < arraysize(kPredefinedAllowedDevChannelOrigins); ++i) | 677 for (size_t i = 0; i < arraysize(kPredefinedAllowedDevChannelOrigins); ++i) |
| 657 allowed_dev_channel_origins_.insert(kPredefinedAllowedDevChannelOrigins[i]); | 678 allowed_dev_channel_origins_.insert(kPredefinedAllowedDevChannelOrigins[i]); |
| 658 for (size_t i = 0; i < arraysize(kPredefinedAllowedFileHandleOrigins); ++i) | 679 for (size_t i = 0; i < arraysize(kPredefinedAllowedFileHandleOrigins); ++i) |
| 659 allowed_file_handle_origins_.insert(kPredefinedAllowedFileHandleOrigins[i]); | 680 allowed_file_handle_origins_.insert(kPredefinedAllowedFileHandleOrigins[i]); |
| (...skipping 1919 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 2579 registry->AddService( | 2600 registry->AddService( |
| 2580 base::Bind(&chromeos::attestation::PlatformVerificationImpl::Create, | 2601 base::Bind(&chromeos::attestation::PlatformVerificationImpl::Create, |
| 2581 render_frame_host)); | 2602 render_frame_host)); |
| 2582 #endif | 2603 #endif |
| 2583 } | 2604 } |
| 2584 | 2605 |
| 2585 void ChromeContentBrowserClient::RegisterRenderFrameMojoServices( | 2606 void ChromeContentBrowserClient::RegisterRenderFrameMojoServices( |
| 2586 content::ServiceRegistry* registry, | 2607 content::ServiceRegistry* registry, |
| 2587 content::RenderFrameHost* render_frame_host) { | 2608 content::RenderFrameHost* render_frame_host) { |
| 2588 registry->AddService(base::Bind(&CreateUsbDeviceManager, render_frame_host)); | 2609 registry->AddService(base::Bind(&CreateUsbDeviceManager, render_frame_host)); |
| 2610 #if !defined(OS_ANDROID) && !defined(OS_IOS) | |
|
Reilly Grant (use Gerrit)
2015/10/29 01:11:32
It is possible, like for DeviceManager, to avoid t
juncai
2015/10/31 04:15:36
Tried moving webusb.gypi to be included in all pla
| |
| 2611 registry->AddService( | |
| 2612 base::Bind(&CreateWebUsbPermissionBubble, render_frame_host)); | |
| 2613 #endif | |
| 2589 } | 2614 } |
| 2590 | 2615 |
| 2591 void ChromeContentBrowserClient::OpenURL( | 2616 void ChromeContentBrowserClient::OpenURL( |
| 2592 content::BrowserContext* browser_context, | 2617 content::BrowserContext* browser_context, |
| 2593 const content::OpenURLParams& params, | 2618 const content::OpenURLParams& params, |
| 2594 const base::Callback<void(content::WebContents*)>& callback) { | 2619 const base::Callback<void(content::WebContents*)>& callback) { |
| 2595 DCHECK_CURRENTLY_ON(BrowserThread::UI); | 2620 DCHECK_CURRENTLY_ON(BrowserThread::UI); |
| 2596 | 2621 |
| 2597 #if !defined(OS_ANDROID) && !defined(OS_IOS) | 2622 #if !defined(OS_ANDROID) && !defined(OS_IOS) |
| 2598 chrome::NavigateParams nav_params( | 2623 chrome::NavigateParams nav_params( |
| (...skipping 148 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 2747 if (channel <= kMaxDisableEncryptionChannel) { | 2772 if (channel <= kMaxDisableEncryptionChannel) { |
| 2748 static const char* const kWebRtcDevSwitchNames[] = { | 2773 static const char* const kWebRtcDevSwitchNames[] = { |
| 2749 switches::kDisableWebRtcEncryption, | 2774 switches::kDisableWebRtcEncryption, |
| 2750 }; | 2775 }; |
| 2751 to_command_line->CopySwitchesFrom(from_command_line, | 2776 to_command_line->CopySwitchesFrom(from_command_line, |
| 2752 kWebRtcDevSwitchNames, | 2777 kWebRtcDevSwitchNames, |
| 2753 arraysize(kWebRtcDevSwitchNames)); | 2778 arraysize(kWebRtcDevSwitchNames)); |
| 2754 } | 2779 } |
| 2755 } | 2780 } |
| 2756 #endif // defined(ENABLE_WEBRTC) | 2781 #endif // defined(ENABLE_WEBRTC) |
| OLD | NEW |