| 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 228 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 239 #endif | 239 #endif |
| 240 | 240 |
| 241 #if defined(TOOLKIT_VIEWS) | 241 #if defined(TOOLKIT_VIEWS) |
| 242 #include "chrome/browser/ui/views/chrome_browser_main_extra_parts_views.h" | 242 #include "chrome/browser/ui/views/chrome_browser_main_extra_parts_views.h" |
| 243 #endif | 243 #endif |
| 244 | 244 |
| 245 #if defined(OS_LINUX) && !defined(OS_CHROMEOS) | 245 #if defined(OS_LINUX) && !defined(OS_CHROMEOS) |
| 246 #include "chrome/browser/ui/views/chrome_browser_main_extra_parts_views_linux.h" | 246 #include "chrome/browser/ui/views/chrome_browser_main_extra_parts_views_linux.h" |
| 247 #endif | 247 #endif |
| 248 | 248 |
| 249 #if defined(USE_AURA) |
| 250 #include "services/shell/runner/common/client_util.h" |
| 251 #include "services/ui/common/gpu_service.h" |
| 252 #include "ui/views/mus/window_manager_connection.h" |
| 253 #endif |
| 254 |
| 249 #if defined(USE_ASH) | 255 #if defined(USE_ASH) |
| 250 #include "chrome/browser/ui/views/ash/chrome_browser_main_extra_parts_ash.h" | 256 #include "chrome/browser/ui/views/ash/chrome_browser_main_extra_parts_ash.h" |
| 251 #endif | 257 #endif |
| 252 | 258 |
| 253 #if defined(USE_X11) | 259 #if defined(USE_X11) |
| 254 #include "chrome/browser/chrome_browser_main_extra_parts_x11.h" | 260 #include "chrome/browser/chrome_browser_main_extra_parts_x11.h" |
| 255 #endif | 261 #endif |
| 256 | 262 |
| 257 #if defined(ENABLE_CAPTIVE_PORTAL_DETECTION) | 263 #if defined(ENABLE_CAPTIVE_PORTAL_DETECTION) |
| 258 #include "chrome/browser/captive_portal/captive_portal_tab_helper.h" | 264 #include "chrome/browser/captive_portal/captive_portal_tab_helper.h" |
| (...skipping 477 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 736 #if defined(OS_CHROMEOS) | 742 #if defined(OS_CHROMEOS) |
| 737 bool IsIntentPickerEnabled() { | 743 bool IsIntentPickerEnabled() { |
| 738 return base::CommandLine::ForCurrentProcess()->HasSwitch( | 744 return base::CommandLine::ForCurrentProcess()->HasSwitch( |
| 739 switches::kEnableIntentPicker); | 745 switches::kEnableIntentPicker); |
| 740 } | 746 } |
| 741 #endif | 747 #endif |
| 742 | 748 |
| 743 } // namespace | 749 } // namespace |
| 744 | 750 |
| 745 ChromeContentBrowserClient::ChromeContentBrowserClient() | 751 ChromeContentBrowserClient::ChromeContentBrowserClient() |
| 746 : | 752 : weak_factory_(this) { |
| 747 weak_factory_(this) { | |
| 748 #if defined(ENABLE_PLUGINS) | 753 #if defined(ENABLE_PLUGINS) |
| 749 for (size_t i = 0; i < arraysize(kPredefinedAllowedDevChannelOrigins); ++i) | 754 for (size_t i = 0; i < arraysize(kPredefinedAllowedDevChannelOrigins); ++i) |
| 750 allowed_dev_channel_origins_.insert(kPredefinedAllowedDevChannelOrigins[i]); | 755 allowed_dev_channel_origins_.insert(kPredefinedAllowedDevChannelOrigins[i]); |
| 751 for (size_t i = 0; i < arraysize(kPredefinedAllowedFileHandleOrigins); ++i) | 756 for (size_t i = 0; i < arraysize(kPredefinedAllowedFileHandleOrigins); ++i) |
| 752 allowed_file_handle_origins_.insert(kPredefinedAllowedFileHandleOrigins[i]); | 757 allowed_file_handle_origins_.insert(kPredefinedAllowedFileHandleOrigins[i]); |
| 753 for (size_t i = 0; i < arraysize(kPredefinedAllowedSocketOrigins); ++i) | 758 for (size_t i = 0; i < arraysize(kPredefinedAllowedSocketOrigins); ++i) |
| 754 allowed_socket_origins_.insert(kPredefinedAllowedSocketOrigins[i]); | 759 allowed_socket_origins_.insert(kPredefinedAllowedSocketOrigins[i]); |
| 755 | 760 |
| 756 extra_parts_.push_back(new ChromeContentBrowserClientPluginsPart); | 761 extra_parts_.push_back(new ChromeContentBrowserClientPluginsPart); |
| 757 #endif | 762 #endif |
| (...skipping 1747 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2505 host->process()->GetData().id == plugin_process_id) { | 2510 host->process()->GetData().id == plugin_process_id) { |
| 2506 // Found the plugin. | 2511 // Found the plugin. |
| 2507 return host->browser_ppapi_host(); | 2512 return host->browser_ppapi_host(); |
| 2508 } | 2513 } |
| 2509 ++iter; | 2514 ++iter; |
| 2510 } | 2515 } |
| 2511 #endif | 2516 #endif |
| 2512 return NULL; | 2517 return NULL; |
| 2513 } | 2518 } |
| 2514 | 2519 |
| 2520 gpu::GpuChannelEstablishFactory* |
| 2521 ChromeContentBrowserClient::GetGpuChannelEstablishFactory() { |
| 2522 #if defined(USE_AURA) |
| 2523 if (views::WindowManagerConnection::Exists()) |
| 2524 return views::WindowManagerConnection::Get()->gpu_service(); |
| 2525 #endif |
| 2526 return nullptr; |
| 2527 } |
| 2528 |
| 2515 bool ChromeContentBrowserClient::AllowPepperSocketAPI( | 2529 bool ChromeContentBrowserClient::AllowPepperSocketAPI( |
| 2516 content::BrowserContext* browser_context, | 2530 content::BrowserContext* browser_context, |
| 2517 const GURL& url, | 2531 const GURL& url, |
| 2518 bool private_api, | 2532 bool private_api, |
| 2519 const content::SocketPermissionRequest* params) { | 2533 const content::SocketPermissionRequest* params) { |
| 2520 #if defined(ENABLE_PLUGINS) && defined(ENABLE_EXTENSIONS) | 2534 #if defined(ENABLE_PLUGINS) && defined(ENABLE_EXTENSIONS) |
| 2521 return ChromeContentBrowserClientPluginsPart::AllowPepperSocketAPI( | 2535 return ChromeContentBrowserClientPluginsPart::AllowPepperSocketAPI( |
| 2522 browser_context, url, private_api, params, allowed_socket_origins_); | 2536 browser_context, url, private_api, params, allowed_socket_origins_); |
| 2523 #else | 2537 #else |
| 2524 return false; | 2538 return false; |
| (...skipping 533 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3058 if (channel <= kMaxDisableEncryptionChannel) { | 3072 if (channel <= kMaxDisableEncryptionChannel) { |
| 3059 static const char* const kWebRtcDevSwitchNames[] = { | 3073 static const char* const kWebRtcDevSwitchNames[] = { |
| 3060 switches::kDisableWebRtcEncryption, | 3074 switches::kDisableWebRtcEncryption, |
| 3061 }; | 3075 }; |
| 3062 to_command_line->CopySwitchesFrom(from_command_line, | 3076 to_command_line->CopySwitchesFrom(from_command_line, |
| 3063 kWebRtcDevSwitchNames, | 3077 kWebRtcDevSwitchNames, |
| 3064 arraysize(kWebRtcDevSwitchNames)); | 3078 arraysize(kWebRtcDevSwitchNames)); |
| 3065 } | 3079 } |
| 3066 } | 3080 } |
| 3067 #endif // defined(ENABLE_WEBRTC) | 3081 #endif // defined(ENABLE_WEBRTC) |
| OLD | NEW |