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 "content/browser/browser_main_loop.h" | 5 #include "content/browser/browser_main_loop.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/command_line.h" | 8 #include "base/command_line.h" |
9 #include "base/debug/trace_event.h" | 9 #include "base/debug/trace_event.h" |
10 #include "base/file_util.h" | 10 #include "base/file_util.h" |
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
60 #include "net/base/network_change_notifier.h" | 60 #include "net/base/network_change_notifier.h" |
61 #include "net/socket/client_socket_factory.h" | 61 #include "net/socket/client_socket_factory.h" |
62 #include "net/ssl/ssl_config_service.h" | 62 #include "net/ssl/ssl_config_service.h" |
63 #include "ui/base/clipboard/clipboard.h" | 63 #include "ui/base/clipboard/clipboard.h" |
64 | 64 |
65 #if defined(USE_AURA) || (defined(OS_MACOSX) && !defined(OS_IOS)) | 65 #if defined(USE_AURA) || (defined(OS_MACOSX) && !defined(OS_IOS)) |
66 #include "content/browser/compositor/image_transport_factory.h" | 66 #include "content/browser/compositor/image_transport_factory.h" |
67 #endif | 67 #endif |
68 | 68 |
69 #if defined(USE_AURA) | 69 #if defined(USE_AURA) |
| 70 #include "content/public/browser/context_factory.h" |
70 #include "ui/aura/env.h" | 71 #include "ui/aura/env.h" |
71 #endif | 72 #endif |
72 | 73 |
73 #if !defined(OS_IOS) | 74 #if !defined(OS_IOS) |
74 #include "content/browser/renderer_host/render_process_host_impl.h" | 75 #include "content/browser/renderer_host/render_process_host_impl.h" |
75 #endif | 76 #endif |
76 | 77 |
77 #if defined(OS_ANDROID) | 78 #if defined(OS_ANDROID) |
78 #include "base/android/jni_android.h" | 79 #include "base/android/jni_android.h" |
79 #include "content/browser/android/browser_startup_controller.h" | 80 #include "content/browser/android/browser_startup_controller.h" |
(...skipping 855 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
935 bool always_uses_gpu = true; | 936 bool always_uses_gpu = true; |
936 bool established_gpu_channel = false; | 937 bool established_gpu_channel = false; |
937 #if defined(USE_AURA) || defined(OS_MACOSX) | 938 #if defined(USE_AURA) || defined(OS_MACOSX) |
938 if (ShouldInitializeBrowserGpuChannelAndTransportSurface()) { | 939 if (ShouldInitializeBrowserGpuChannelAndTransportSurface()) { |
939 established_gpu_channel = true; | 940 established_gpu_channel = true; |
940 if (!GpuDataManagerImpl::GetInstance()->CanUseGpuBrowserCompositor()) { | 941 if (!GpuDataManagerImpl::GetInstance()->CanUseGpuBrowserCompositor()) { |
941 established_gpu_channel = always_uses_gpu = false; | 942 established_gpu_channel = always_uses_gpu = false; |
942 } | 943 } |
943 BrowserGpuChannelHostFactory::Initialize(established_gpu_channel); | 944 BrowserGpuChannelHostFactory::Initialize(established_gpu_channel); |
944 ImageTransportFactory::Initialize(); | 945 ImageTransportFactory::Initialize(); |
| 946 #if defined(USE_AURA) |
| 947 if (aura::Env::GetInstance()) { |
| 948 aura::Env::GetInstance()->set_context_factory( |
| 949 content::GetContextFactory()); |
| 950 } |
| 951 #endif |
945 } | 952 } |
946 #elif defined(OS_ANDROID) | 953 #elif defined(OS_ANDROID) |
947 established_gpu_channel = true; | 954 established_gpu_channel = true; |
948 BrowserGpuChannelHostFactory::Initialize(established_gpu_channel); | 955 BrowserGpuChannelHostFactory::Initialize(established_gpu_channel); |
949 #endif | 956 #endif |
950 | 957 |
951 #if defined(OS_LINUX) && defined(USE_UDEV) | 958 #if defined(OS_LINUX) && defined(USE_UDEV) |
952 device_monitor_linux_.reset(new DeviceMonitorLinux()); | 959 device_monitor_linux_.reset(new DeviceMonitorLinux()); |
953 #elif defined(OS_MACOSX) | 960 #elif defined(OS_MACOSX) |
954 device_monitor_mac_.reset(new DeviceMonitorMac()); | 961 device_monitor_mac_.reset(new DeviceMonitorMac()); |
(...skipping 164 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1119 base::TimeDelta::FromSeconds(delay_secs)); | 1126 base::TimeDelta::FromSeconds(delay_secs)); |
1120 } | 1127 } |
1121 | 1128 |
1122 void BrowserMainLoop::EndStartupTracing(const base::FilePath& trace_file) { | 1129 void BrowserMainLoop::EndStartupTracing(const base::FilePath& trace_file) { |
1123 is_tracing_startup_ = false; | 1130 is_tracing_startup_ = false; |
1124 TracingController::GetInstance()->DisableRecording( | 1131 TracingController::GetInstance()->DisableRecording( |
1125 trace_file, base::Bind(&OnStoppedStartupTracing)); | 1132 trace_file, base::Bind(&OnStoppedStartupTracing)); |
1126 } | 1133 } |
1127 | 1134 |
1128 } // namespace content | 1135 } // namespace content |
OLD | NEW |