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 260 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
271 #include "chrome/browser/ui/views/chrome_browser_main_extra_parts_views.h" | 271 #include "chrome/browser/ui/views/chrome_browser_main_extra_parts_views.h" |
272 #endif | 272 #endif |
273 | 273 |
274 #if defined(OS_LINUX) && !defined(OS_CHROMEOS) | 274 #if defined(OS_LINUX) && !defined(OS_CHROMEOS) |
275 #include "chrome/browser/ui/views/chrome_browser_main_extra_parts_views_linux.h" | 275 #include "chrome/browser/ui/views/chrome_browser_main_extra_parts_views_linux.h" |
276 #endif | 276 #endif |
277 | 277 |
278 #if defined(USE_AURA) | 278 #if defined(USE_AURA) |
279 #include "services/service_manager/runner/common/client_util.h" | 279 #include "services/service_manager/runner/common/client_util.h" |
280 #include "services/ui/public/cpp/gpu/gpu.h" | 280 #include "services/ui/public/cpp/gpu/gpu.h" |
281 #include "ui/views/mus/window_manager_connection.h" | 281 #include "ui/views/mus/mus_client.h" |
282 #endif | 282 #endif |
283 | 283 |
284 #if defined(USE_ASH) | 284 #if defined(USE_ASH) |
285 #include "chrome/browser/ui/views/ash/chrome_browser_main_extra_parts_ash.h" | 285 #include "chrome/browser/ui/views/ash/chrome_browser_main_extra_parts_ash.h" |
286 #endif | 286 #endif |
287 | 287 |
288 #if defined(USE_X11) | 288 #if defined(USE_X11) |
289 #include "chrome/browser/chrome_browser_main_extra_parts_x11.h" | 289 #include "chrome/browser/chrome_browser_main_extra_parts_x11.h" |
290 #endif | 290 #endif |
291 | 291 |
(...skipping 615 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
907 #endif | 907 #endif |
908 | 908 |
909 chrome::AddProfilesExtraParts(main_parts); | 909 chrome::AddProfilesExtraParts(main_parts); |
910 | 910 |
911 // Construct additional browser parts. Stages are called in the order in | 911 // Construct additional browser parts. Stages are called in the order in |
912 // which they are added. | 912 // which they are added. |
913 #if defined(TOOLKIT_VIEWS) | 913 #if defined(TOOLKIT_VIEWS) |
914 #if defined(OS_LINUX) && !defined(OS_CHROMEOS) && !defined(USE_OZONE) | 914 #if defined(OS_LINUX) && !defined(OS_CHROMEOS) && !defined(USE_OZONE) |
915 main_parts->AddParts(new ChromeBrowserMainExtraPartsViewsLinux()); | 915 main_parts->AddParts(new ChromeBrowserMainExtraPartsViewsLinux()); |
916 #else | 916 #else |
917 main_parts->AddParts(new ChromeBrowserMainExtraPartsViews()); | 917 ChromeBrowserMainExtraPartsViews* extra_parts_views = |
| 918 new ChromeBrowserMainExtraPartsViews; |
| 919 main_parts->AddParts(extra_parts_views); |
| 920 #if defined(USE_ASH) |
| 921 main_parts->AddParts(new ChromeBrowserMainExtraPartsAsh(extra_parts_views)); |
| 922 #endif |
918 #endif | 923 #endif |
919 #endif | 924 #endif |
920 | 925 |
921 // TODO(oshima): Athena on chrome currently requires USE_ASH to build. | |
922 // We should reduce the dependency as much as possible. | |
923 #if defined(USE_ASH) | |
924 main_parts->AddParts(new ChromeBrowserMainExtraPartsAsh()); | |
925 #endif | |
926 | |
927 #if defined(USE_X11) | 926 #if defined(USE_X11) |
928 main_parts->AddParts(new ChromeBrowserMainExtraPartsX11()); | 927 main_parts->AddParts(new ChromeBrowserMainExtraPartsX11()); |
929 #endif | 928 #endif |
930 | 929 |
931 #if defined(ENABLE_WAYLAND_SERVER) | 930 #if defined(ENABLE_WAYLAND_SERVER) |
932 main_parts->AddParts(new ChromeBrowserMainExtraPartsExo()); | 931 main_parts->AddParts(new ChromeBrowserMainExtraPartsExo()); |
933 #endif | 932 #endif |
934 | 933 |
935 chrome::AddMetricsExtraParts(main_parts); | 934 chrome::AddMetricsExtraParts(main_parts); |
936 | 935 |
(...skipping 1793 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2730 } | 2729 } |
2731 ++iter; | 2730 ++iter; |
2732 } | 2731 } |
2733 #endif | 2732 #endif |
2734 return NULL; | 2733 return NULL; |
2735 } | 2734 } |
2736 | 2735 |
2737 gpu::GpuChannelEstablishFactory* | 2736 gpu::GpuChannelEstablishFactory* |
2738 ChromeContentBrowserClient::GetGpuChannelEstablishFactory() { | 2737 ChromeContentBrowserClient::GetGpuChannelEstablishFactory() { |
2739 #if defined(USE_AURA) | 2738 #if defined(USE_AURA) |
2740 if (views::WindowManagerConnection::Exists()) | 2739 if (views::MusClient::Exists()) |
2741 return views::WindowManagerConnection::Get()->gpu(); | 2740 return views::MusClient::Get()->gpu(); |
2742 #endif | 2741 #endif |
2743 return nullptr; | 2742 return nullptr; |
2744 } | 2743 } |
2745 | 2744 |
2746 bool ChromeContentBrowserClient::AllowPepperSocketAPI( | 2745 bool ChromeContentBrowserClient::AllowPepperSocketAPI( |
2747 content::BrowserContext* browser_context, | 2746 content::BrowserContext* browser_context, |
2748 const GURL& url, | 2747 const GURL& url, |
2749 bool private_api, | 2748 bool private_api, |
2750 const content::SocketPermissionRequest* params) { | 2749 const content::SocketPermissionRequest* params) { |
2751 #if BUILDFLAG(ENABLE_PLUGINS) && BUILDFLAG(ENABLE_EXTENSIONS) | 2750 #if BUILDFLAG(ENABLE_PLUGINS) && BUILDFLAG(ENABLE_EXTENSIONS) |
(...skipping 624 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3376 RedirectNonUINonIOBrowserThreadsToTaskScheduler() { | 3375 RedirectNonUINonIOBrowserThreadsToTaskScheduler() { |
3377 return variations::GetVariationParamValue( | 3376 return variations::GetVariationParamValue( |
3378 "BrowserScheduler", "RedirectNonUINonIOBrowserThreads") == "true"; | 3377 "BrowserScheduler", "RedirectNonUINonIOBrowserThreads") == "true"; |
3379 } | 3378 } |
3380 | 3379 |
3381 // static | 3380 // static |
3382 void ChromeContentBrowserClient::SetDefaultQuotaSettingsForTesting( | 3381 void ChromeContentBrowserClient::SetDefaultQuotaSettingsForTesting( |
3383 const storage::QuotaSettings* settings) { | 3382 const storage::QuotaSettings* settings) { |
3384 g_default_quota_settings = settings; | 3383 g_default_quota_settings = settings; |
3385 } | 3384 } |
OLD | NEW |