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/aura/image_transport_factory.h" | 5 #include "content/browser/aura/image_transport_factory.h" |
6 | 6 |
7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
| 8 #include "base/sys_info.h" |
8 #include "content/browser/aura/gpu_process_transport_factory.h" | 9 #include "content/browser/aura/gpu_process_transport_factory.h" |
9 #include "content/browser/aura/no_transport_image_transport_factory.h" | 10 #include "content/browser/aura/no_transport_image_transport_factory.h" |
10 #include "content/public/common/content_switches.h" | 11 #include "content/public/common/content_switches.h" |
11 #include "ui/compositor/compositor.h" | 12 #include "ui/compositor/compositor.h" |
12 #include "ui/compositor/compositor_switches.h" | 13 #include "ui/compositor/compositor_switches.h" |
13 | 14 |
14 #if defined(OS_CHROMEOS) | |
15 #include "base/chromeos/chromeos_version.h" | |
16 #endif | |
17 | |
18 namespace content { | 15 namespace content { |
19 | 16 |
20 namespace { | 17 namespace { |
21 ImageTransportFactory* g_factory; | 18 ImageTransportFactory* g_factory; |
22 } | 19 } |
23 | 20 |
24 | 21 |
25 static bool UseTestContextAndTransportFactory() { | 22 static bool UseTestContextAndTransportFactory() { |
26 #if defined(OS_CHROMEOS) | 23 #if defined(OS_CHROMEOS) |
27 // If the test is running on the chromeos envrionment (such as | 24 // If the test is running on the chromeos envrionment (such as |
28 // device or vm bots), always use real contexts. | 25 // device or vm bots), always use real contexts. |
29 if (base::chromeos::IsRunningOnChromeOS()) | 26 if (base::SysInfo::IsRunningOnChromeOS()) |
30 return false; | 27 return false; |
31 #endif | 28 #endif |
32 | 29 |
33 // Only used if the enable command line flag is used. | 30 // Only used if the enable command line flag is used. |
34 CommandLine* command_line = CommandLine::ForCurrentProcess(); | 31 CommandLine* command_line = CommandLine::ForCurrentProcess(); |
35 if (!command_line->HasSwitch(switches::kTestCompositor)) | 32 if (!command_line->HasSwitch(switches::kTestCompositor)) |
36 return false; | 33 return false; |
37 | 34 |
38 // The disable command line flag preempts the enable flag. | 35 // The disable command line flag preempts the enable flag. |
39 if (!command_line->HasSwitch(switches::kDisableTestCompositor)) | 36 if (!command_line->HasSwitch(switches::kDisableTestCompositor)) |
(...skipping 26 matching lines...) Expand all Loading... |
66 delete g_factory; | 63 delete g_factory; |
67 g_factory = NULL; | 64 g_factory = NULL; |
68 } | 65 } |
69 | 66 |
70 // static | 67 // static |
71 ImageTransportFactory* ImageTransportFactory::GetInstance() { | 68 ImageTransportFactory* ImageTransportFactory::GetInstance() { |
72 return g_factory; | 69 return g_factory; |
73 } | 70 } |
74 | 71 |
75 } // namespace content | 72 } // namespace content |
OLD | NEW |