| 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 "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/bind_helpers.h" | 10 #include "base/bind_helpers.h" |
| (...skipping 324 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 335 if (kGpuFeatureInfo[i].name == "css_animation") { | 335 if (kGpuFeatureInfo[i].name == "css_animation") { |
| 336 if (has_thread) | 336 if (has_thread) |
| 337 status = "accelerated_threaded"; | 337 status = "accelerated_threaded"; |
| 338 else | 338 else |
| 339 status = "accelerated"; | 339 status = "accelerated"; |
| 340 } | 340 } |
| 341 } | 341 } |
| 342 feature_status_list->Append( | 342 feature_status_list->Append( |
| 343 NewStatusValue(kGpuFeatureInfo[i].name.c_str(), status.c_str())); | 343 NewStatusValue(kGpuFeatureInfo[i].name.c_str(), status.c_str())); |
| 344 } | 344 } |
| 345 | 345 content::GPUInfo gpu_info = GpuDataManager::GetInstance()->GetGPUInfo(); |
| 346 if (gpu_info.secondary_gpus.size() > 0 || |
| 347 gpu_info.optimus || gpu_info.amd_switchable) { |
| 348 std::string gpu_switching; |
| 349 switch (GpuDataManager::GetInstance()->GetGpuSwitchingOption()) { |
| 350 case content::GPU_SWITCHING_AUTOMATIC: |
| 351 gpu_switching = "gpu_switching_automatic"; |
| 352 break; |
| 353 case content::GPU_SWITCHING_FORCE_DISCRETE: |
| 354 gpu_switching = "gpu_switching_force_discrete"; |
| 355 break; |
| 356 case content::GPU_SWITCHING_FORCE_INTEGRATED: |
| 357 gpu_switching = "gpu_switching_force_integrated"; |
| 358 break; |
| 359 default: |
| 360 break; |
| 361 } |
| 362 feature_status_list->Append( |
| 363 NewStatusValue("gpu_switching", gpu_switching.c_str())); |
| 364 } |
| 346 status->Set("featureStatus", feature_status_list); | 365 status->Set("featureStatus", feature_status_list); |
| 347 } | 366 } |
| 348 | 367 |
| 349 // Build the problems list. | 368 // Build the problems list. |
| 350 { | 369 { |
| 351 ListValue* problem_list = | 370 ListValue* problem_list = |
| 352 GpuDataManager::GetInstance()->GetBlacklistReasons(); | 371 GpuDataManager::GetInstance()->GetBlacklistReasons(); |
| 353 | 372 |
| 354 if (gpu_access_blocked) { | 373 if (gpu_access_blocked) { |
| 355 DictionaryValue* problem = new DictionaryValue(); | 374 DictionaryValue* problem = new DictionaryValue(); |
| (...skipping 301 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 657 //////////////////////////////////////////////////////////////////////////////// | 676 //////////////////////////////////////////////////////////////////////////////// |
| 658 | 677 |
| 659 GpuInternalsUI::GpuInternalsUI(content::WebUI* web_ui) | 678 GpuInternalsUI::GpuInternalsUI(content::WebUI* web_ui) |
| 660 : WebUIController(web_ui) { | 679 : WebUIController(web_ui) { |
| 661 web_ui->AddMessageHandler(new GpuMessageHandler()); | 680 web_ui->AddMessageHandler(new GpuMessageHandler()); |
| 662 | 681 |
| 663 // Set up the chrome://gpu-internals/ source. | 682 // Set up the chrome://gpu-internals/ source. |
| 664 Profile* profile = Profile::FromWebUI(web_ui); | 683 Profile* profile = Profile::FromWebUI(web_ui); |
| 665 ChromeURLDataManager::AddDataSource(profile, CreateGpuHTMLSource()); | 684 ChromeURLDataManager::AddDataSource(profile, CreateGpuHTMLSource()); |
| 666 } | 685 } |
| OLD | NEW |