| 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/ui/webui/gpu_internals_ui.h" | 5 #include "chrome/browser/ui/webui/gpu_internals_ui.h" |
| 6 | 6 |
| 7 #include <string> | 7 #include <string> |
| 8 | 8 |
| 9 #if defined(OS_CHROMEOS) |
| 10 #include "ash/ash_switches.h" |
| 11 #endif |
| 9 #include "base/bind.h" | 12 #include "base/bind.h" |
| 10 #include "base/bind_helpers.h" | 13 #include "base/bind_helpers.h" |
| 11 #include "base/command_line.h" | 14 #include "base/command_line.h" |
| 12 #include "base/i18n/time_formatting.h" | 15 #include "base/i18n/time_formatting.h" |
| 13 #include "base/string_number_conversions.h" | 16 #include "base/string_number_conversions.h" |
| 14 #include "base/stringprintf.h" | 17 #include "base/stringprintf.h" |
| 15 #include "base/sys_info.h" | 18 #include "base/sys_info.h" |
| 16 #include "base/values.h" | 19 #include "base/values.h" |
| 17 #include "chrome/browser/crash_upload_list.h" | 20 #include "chrome/browser/crash_upload_list.h" |
| 18 #include "chrome/browser/profiles/profile.h" | 21 #include "chrome/browser/profiles/profile.h" |
| (...skipping 274 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 293 true | 296 true |
| 294 }, | 297 }, |
| 295 { | 298 { |
| 296 "video", | 299 "video", |
| 297 flags & content::GPU_FEATURE_TYPE_ACCELERATED_VIDEO, | 300 flags & content::GPU_FEATURE_TYPE_ACCELERATED_VIDEO, |
| 298 command_line.HasSwitch(switches::kDisableAcceleratedVideo) || | 301 command_line.HasSwitch(switches::kDisableAcceleratedVideo) || |
| 299 command_line.HasSwitch(switches::kDisableAcceleratedCompositing), | 302 command_line.HasSwitch(switches::kDisableAcceleratedCompositing), |
| 300 "Accelerated video presentation has been disabled, either via" | 303 "Accelerated video presentation has been disabled, either via" |
| 301 " about:flags or command line.", | 304 " about:flags or command line.", |
| 302 true | 305 true |
| 306 }, |
| 307 { |
| 308 "panel_fitting", |
| 309 flags & content::GPU_FEATURE_TYPE_PANEL_FITTING, |
| 310 #if defined(OS_CHROMEOS) |
| 311 command_line.HasSwitch(ash::switches::kAshDisablePanelFitting), |
| 312 #else |
| 313 true, |
| 314 #endif |
| 315 "Panel fitting is unavailable, either disabled at the command" |
| 316 " line or not supported by the current system.", |
| 317 false |
| 303 } | 318 } |
| 304 }; | 319 }; |
| 305 const size_t kNumFeatures = sizeof(kGpuFeatureInfo) / sizeof(GpuFeatureInfo); | 320 const size_t kNumFeatures = sizeof(kGpuFeatureInfo) / sizeof(GpuFeatureInfo); |
| 306 | 321 |
| 307 // Build the feature_status field. | 322 // Build the feature_status field. |
| 308 { | 323 { |
| 309 ListValue* feature_status_list = new ListValue(); | 324 ListValue* feature_status_list = new ListValue(); |
| 310 | 325 |
| 311 for (size_t i = 0; i < kNumFeatures; ++i) { | 326 for (size_t i = 0; i < kNumFeatures; ++i) { |
| 312 std::string status; | 327 std::string status; |
| (...skipping 343 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 656 //////////////////////////////////////////////////////////////////////////////// | 671 //////////////////////////////////////////////////////////////////////////////// |
| 657 | 672 |
| 658 GpuInternalsUI::GpuInternalsUI(content::WebUI* web_ui) | 673 GpuInternalsUI::GpuInternalsUI(content::WebUI* web_ui) |
| 659 : WebUIController(web_ui) { | 674 : WebUIController(web_ui) { |
| 660 web_ui->AddMessageHandler(new GpuMessageHandler()); | 675 web_ui->AddMessageHandler(new GpuMessageHandler()); |
| 661 | 676 |
| 662 // Set up the chrome://gpu-internals/ source. | 677 // Set up the chrome://gpu-internals/ source. |
| 663 Profile* profile = Profile::FromWebUI(web_ui); | 678 Profile* profile = Profile::FromWebUI(web_ui); |
| 664 ChromeURLDataManager::AddDataSource(profile, CreateGpuHTMLSource()); | 679 ChromeURLDataManager::AddDataSource(profile, CreateGpuHTMLSource()); |
| 665 } | 680 } |
| OLD | NEW |