| 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 #include "ash/ash_switches.h" |
| 9 #include "base/bind.h" | 10 #include "base/bind.h" |
| 10 #include "base/bind_helpers.h" | 11 #include "base/bind_helpers.h" |
| 11 #include "base/command_line.h" | 12 #include "base/command_line.h" |
| 12 #include "base/i18n/time_formatting.h" | 13 #include "base/i18n/time_formatting.h" |
| 13 #include "base/string_number_conversions.h" | 14 #include "base/string_number_conversions.h" |
| 14 #include "base/stringprintf.h" | 15 #include "base/stringprintf.h" |
| 15 #include "base/sys_info.h" | 16 #include "base/sys_info.h" |
| 16 #include "base/values.h" | 17 #include "base/values.h" |
| 17 #include "chrome/browser/crash_upload_list.h" | 18 #include "chrome/browser/crash_upload_list.h" |
| 18 #include "chrome/browser/profiles/profile.h" | 19 #include "chrome/browser/profiles/profile.h" |
| (...skipping 257 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 276 " about:flags or command line.", | 277 " about:flags or command line.", |
| 277 false | 278 false |
| 278 }, | 279 }, |
| 279 { | 280 { |
| 280 "video_decode", | 281 "video_decode", |
| 281 flags & content::GPU_FEATURE_TYPE_ACCELERATED_VIDEO_DECODE, | 282 flags & content::GPU_FEATURE_TYPE_ACCELERATED_VIDEO_DECODE, |
| 282 command_line.HasSwitch(switches::kDisableAcceleratedVideoDecode), | 283 command_line.HasSwitch(switches::kDisableAcceleratedVideoDecode), |
| 283 "Accelerated video decode has been disabled, either via about:flags" | 284 "Accelerated video decode has been disabled, either via about:flags" |
| 284 " or command line.", | 285 " or command line.", |
| 285 true | 286 true |
| 287 }, |
| 288 { |
| 289 "panel_fitting", |
| 290 flags & content::GPU_FEATURE_TYPE_PANEL_FITTING, |
| 291 command_line.HasSwitch(ash::switches::kAshDisablePanelFitting), |
| 292 "Panel fitting is unavailable, either disabled at the command" |
| 293 " line or not supported by the current system.", |
| 294 false |
| 286 } | 295 } |
| 287 }; | 296 }; |
| 288 const size_t kNumFeatures = sizeof(kGpuFeatureInfo) / sizeof(GpuFeatureInfo); | 297 const size_t kNumFeatures = sizeof(kGpuFeatureInfo) / sizeof(GpuFeatureInfo); |
| 289 | 298 |
| 290 // Build the feature_status field. | 299 // Build the feature_status field. |
| 291 { | 300 { |
| 292 ListValue* feature_status_list = new ListValue(); | 301 ListValue* feature_status_list = new ListValue(); |
| 293 | 302 |
| 294 for (size_t i = 0; i < kNumFeatures; ++i) { | 303 for (size_t i = 0; i < kNumFeatures; ++i) { |
| 295 std::string status; | 304 std::string status; |
| (...skipping 324 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 620 //////////////////////////////////////////////////////////////////////////////// | 629 //////////////////////////////////////////////////////////////////////////////// |
| 621 | 630 |
| 622 GpuInternalsUI::GpuInternalsUI(content::WebUI* web_ui) | 631 GpuInternalsUI::GpuInternalsUI(content::WebUI* web_ui) |
| 623 : WebUIController(web_ui) { | 632 : WebUIController(web_ui) { |
| 624 web_ui->AddMessageHandler(new GpuMessageHandler()); | 633 web_ui->AddMessageHandler(new GpuMessageHandler()); |
| 625 | 634 |
| 626 // Set up the chrome://gpu-internals/ source. | 635 // Set up the chrome://gpu-internals/ source. |
| 627 Profile* profile = Profile::FromWebUI(web_ui); | 636 Profile* profile = Profile::FromWebUI(web_ui); |
| 628 ChromeURLDataManager::AddDataSource(profile, CreateGpuHTMLSource()); | 637 ChromeURLDataManager::AddDataSource(profile, CreateGpuHTMLSource()); |
| 629 } | 638 } |
| OLD | NEW |