Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(255)

Side by Side Diff: chrome/browser/chrome_content_browser_client.cc

Issue 2197613003: gpu: Introduce GpuChannelEstablishFactory. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: tot merge Created 4 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « chrome/browser/chrome_content_browser_client.h ('k') | chrome/browser/ui/BUILD.gn » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 226 matching lines...) Expand 10 before | Expand all | Expand 10 after
237 #endif 237 #endif
238 238
239 #if defined(TOOLKIT_VIEWS) 239 #if defined(TOOLKIT_VIEWS)
240 #include "chrome/browser/ui/views/chrome_browser_main_extra_parts_views.h" 240 #include "chrome/browser/ui/views/chrome_browser_main_extra_parts_views.h"
241 #endif 241 #endif
242 242
243 #if defined(OS_LINUX) && !defined(OS_CHROMEOS) 243 #if defined(OS_LINUX) && !defined(OS_CHROMEOS)
244 #include "chrome/browser/ui/views/chrome_browser_main_extra_parts_views_linux.h" 244 #include "chrome/browser/ui/views/chrome_browser_main_extra_parts_views_linux.h"
245 #endif 245 #endif
246 246
247 #if defined(USE_AURA)
248 #include "services/shell/runner/common/client_util.h"
249 #include "services/ui/common/gpu_service.h"
250 #include "ui/views/mus/window_manager_connection.h"
251 #endif
252
247 #if defined(USE_ASH) 253 #if defined(USE_ASH)
248 #include "chrome/browser/ui/views/ash/chrome_browser_main_extra_parts_ash.h" 254 #include "chrome/browser/ui/views/ash/chrome_browser_main_extra_parts_ash.h"
249 #endif 255 #endif
250 256
251 #if defined(USE_X11) 257 #if defined(USE_X11)
252 #include "chrome/browser/chrome_browser_main_extra_parts_x11.h" 258 #include "chrome/browser/chrome_browser_main_extra_parts_x11.h"
253 #endif 259 #endif
254 260
255 #if defined(ENABLE_CAPTIVE_PORTAL_DETECTION) 261 #if defined(ENABLE_CAPTIVE_PORTAL_DETECTION)
256 #include "chrome/browser/captive_portal/captive_portal_tab_helper.h" 262 #include "chrome/browser/captive_portal/captive_portal_tab_helper.h"
(...skipping 477 matching lines...) Expand 10 before | Expand all | Expand 10 after
734 #if defined(OS_CHROMEOS) 740 #if defined(OS_CHROMEOS)
735 bool IsIntentPickerEnabled() { 741 bool IsIntentPickerEnabled() {
736 return base::CommandLine::ForCurrentProcess()->HasSwitch( 742 return base::CommandLine::ForCurrentProcess()->HasSwitch(
737 switches::kEnableIntentPicker); 743 switches::kEnableIntentPicker);
738 } 744 }
739 #endif 745 #endif
740 746
741 } // namespace 747 } // namespace
742 748
743 ChromeContentBrowserClient::ChromeContentBrowserClient() 749 ChromeContentBrowserClient::ChromeContentBrowserClient()
744 : 750 : weak_factory_(this) {
745 weak_factory_(this) {
746 #if defined(ENABLE_PLUGINS) 751 #if defined(ENABLE_PLUGINS)
747 for (size_t i = 0; i < arraysize(kPredefinedAllowedDevChannelOrigins); ++i) 752 for (size_t i = 0; i < arraysize(kPredefinedAllowedDevChannelOrigins); ++i)
748 allowed_dev_channel_origins_.insert(kPredefinedAllowedDevChannelOrigins[i]); 753 allowed_dev_channel_origins_.insert(kPredefinedAllowedDevChannelOrigins[i]);
749 for (size_t i = 0; i < arraysize(kPredefinedAllowedFileHandleOrigins); ++i) 754 for (size_t i = 0; i < arraysize(kPredefinedAllowedFileHandleOrigins); ++i)
750 allowed_file_handle_origins_.insert(kPredefinedAllowedFileHandleOrigins[i]); 755 allowed_file_handle_origins_.insert(kPredefinedAllowedFileHandleOrigins[i]);
751 for (size_t i = 0; i < arraysize(kPredefinedAllowedSocketOrigins); ++i) 756 for (size_t i = 0; i < arraysize(kPredefinedAllowedSocketOrigins); ++i)
752 allowed_socket_origins_.insert(kPredefinedAllowedSocketOrigins[i]); 757 allowed_socket_origins_.insert(kPredefinedAllowedSocketOrigins[i]);
753 758
754 extra_parts_.push_back(new ChromeContentBrowserClientPluginsPart); 759 extra_parts_.push_back(new ChromeContentBrowserClientPluginsPart);
755 #endif 760 #endif
(...skipping 1747 matching lines...) Expand 10 before | Expand all | Expand 10 after
2503 host->process()->GetData().id == plugin_process_id) { 2508 host->process()->GetData().id == plugin_process_id) {
2504 // Found the plugin. 2509 // Found the plugin.
2505 return host->browser_ppapi_host(); 2510 return host->browser_ppapi_host();
2506 } 2511 }
2507 ++iter; 2512 ++iter;
2508 } 2513 }
2509 #endif 2514 #endif
2510 return NULL; 2515 return NULL;
2511 } 2516 }
2512 2517
2518 gpu::GpuChannelEstablishFactory*
2519 ChromeContentBrowserClient::GetGpuChannelEstablishFactory() {
2520 #if defined(USE_AURA)
2521 if (views::WindowManagerConnection::Exists())
2522 return views::WindowManagerConnection::Get()->gpu_service();
2523 #endif
2524 return nullptr;
2525 }
2526
2513 bool ChromeContentBrowserClient::AllowPepperSocketAPI( 2527 bool ChromeContentBrowserClient::AllowPepperSocketAPI(
2514 content::BrowserContext* browser_context, 2528 content::BrowserContext* browser_context,
2515 const GURL& url, 2529 const GURL& url,
2516 bool private_api, 2530 bool private_api,
2517 const content::SocketPermissionRequest* params) { 2531 const content::SocketPermissionRequest* params) {
2518 #if defined(ENABLE_PLUGINS) && defined(ENABLE_EXTENSIONS) 2532 #if defined(ENABLE_PLUGINS) && defined(ENABLE_EXTENSIONS)
2519 return ChromeContentBrowserClientPluginsPart::AllowPepperSocketAPI( 2533 return ChromeContentBrowserClientPluginsPart::AllowPepperSocketAPI(
2520 browser_context, url, private_api, params, allowed_socket_origins_); 2534 browser_context, url, private_api, params, allowed_socket_origins_);
2521 #else 2535 #else
2522 return false; 2536 return false;
(...skipping 525 matching lines...) Expand 10 before | Expand all | Expand 10 after
3048 if (channel <= kMaxDisableEncryptionChannel) { 3062 if (channel <= kMaxDisableEncryptionChannel) {
3049 static const char* const kWebRtcDevSwitchNames[] = { 3063 static const char* const kWebRtcDevSwitchNames[] = {
3050 switches::kDisableWebRtcEncryption, 3064 switches::kDisableWebRtcEncryption,
3051 }; 3065 };
3052 to_command_line->CopySwitchesFrom(from_command_line, 3066 to_command_line->CopySwitchesFrom(from_command_line,
3053 kWebRtcDevSwitchNames, 3067 kWebRtcDevSwitchNames,
3054 arraysize(kWebRtcDevSwitchNames)); 3068 arraysize(kWebRtcDevSwitchNames));
3055 } 3069 }
3056 } 3070 }
3057 #endif // defined(ENABLE_WEBRTC) 3071 #endif // defined(ENABLE_WEBRTC)
OLDNEW
« no previous file with comments | « chrome/browser/chrome_content_browser_client.h ('k') | chrome/browser/ui/BUILD.gn » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698