| 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 327 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 338 } | 338 } |
| 339 } | 339 } |
| 340 feature_status_list->Append( | 340 feature_status_list->Append( |
| 341 NewStatusValue(kGpuFeatureInfo[i].name.c_str(), status.c_str())); | 341 NewStatusValue(kGpuFeatureInfo[i].name.c_str(), status.c_str())); |
| 342 } | 342 } |
| 343 content::GPUInfo gpu_info = GpuDataManager::GetInstance()->GetGPUInfo(); | 343 content::GPUInfo gpu_info = GpuDataManager::GetInstance()->GetGPUInfo(); |
| 344 if (gpu_info.secondary_gpus.size() > 0 || | 344 if (gpu_info.secondary_gpus.size() > 0 || |
| 345 gpu_info.optimus || gpu_info.amd_switchable) { | 345 gpu_info.optimus || gpu_info.amd_switchable) { |
| 346 std::string gpu_switching; | 346 std::string gpu_switching; |
| 347 switch (GpuDataManager::GetInstance()->GetGpuSwitchingOption()) { | 347 switch (GpuDataManager::GetInstance()->GetGpuSwitchingOption()) { |
| 348 case content::GPU_SWITCHING_OPTION_AUTOMATIC: | 348 case content::GPU_SWITCHING_AUTOMATIC: |
| 349 gpu_switching = "gpu_switching_automatic"; | 349 gpu_switching = "gpu_switching_automatic"; |
| 350 break; | 350 break; |
| 351 case content::GPU_SWITCHING_OPTION_FORCE_DISCRETE: | 351 case content::GPU_SWITCHING_FORCE_DISCRETE: |
| 352 gpu_switching = "gpu_switching_force_discrete"; | 352 gpu_switching = "gpu_switching_force_discrete"; |
| 353 break; | 353 break; |
| 354 case content::GPU_SWITCHING_OPTION_FORCE_INTEGRATED: | 354 case content::GPU_SWITCHING_FORCE_INTEGRATED: |
| 355 gpu_switching = "gpu_switching_force_integrated"; | 355 gpu_switching = "gpu_switching_force_integrated"; |
| 356 break; | 356 break; |
| 357 default: | 357 default: |
| 358 break; | 358 break; |
| 359 } | 359 } |
| 360 feature_status_list->Append( | 360 feature_status_list->Append( |
| 361 NewStatusValue("gpu_switching", gpu_switching.c_str())); | 361 NewStatusValue("gpu_switching", gpu_switching.c_str())); |
| 362 } | 362 } |
| 363 status->Set("featureStatus", feature_status_list); | 363 status->Set("featureStatus", feature_status_list); |
| 364 } | 364 } |
| (...skipping 277 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 642 //////////////////////////////////////////////////////////////////////////////// | 642 //////////////////////////////////////////////////////////////////////////////// |
| 643 | 643 |
| 644 GpuInternalsUI::GpuInternalsUI(content::WebUI* web_ui) | 644 GpuInternalsUI::GpuInternalsUI(content::WebUI* web_ui) |
| 645 : WebUIController(web_ui) { | 645 : WebUIController(web_ui) { |
| 646 web_ui->AddMessageHandler(new GpuMessageHandler()); | 646 web_ui->AddMessageHandler(new GpuMessageHandler()); |
| 647 | 647 |
| 648 // Set up the chrome://gpu-internals/ source. | 648 // Set up the chrome://gpu-internals/ source. |
| 649 Profile* profile = Profile::FromWebUI(web_ui); | 649 Profile* profile = Profile::FromWebUI(web_ui); |
| 650 ChromeURLDataManager::AddDataSource(profile, CreateGpuHTMLSource()); | 650 ChromeURLDataManager::AddDataSource(profile, CreateGpuHTMLSource()); |
| 651 } | 651 } |
| OLD | NEW |