| 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 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 115 "VENDOR = %s, DEVICE= %s", vendor.c_str(), device.c_str()); | 115 "VENDOR = %s, DEVICE= %s", vendor.c_str(), device.c_str()); |
| 116 } | 116 } |
| 117 | 117 |
| 118 DictionaryValue* GpuInfoAsDictionaryValue() { | 118 DictionaryValue* GpuInfoAsDictionaryValue() { |
| 119 content::GPUInfo gpu_info = GpuDataManager::GetInstance()->GetGPUInfo(); | 119 content::GPUInfo gpu_info = GpuDataManager::GetInstance()->GetGPUInfo(); |
| 120 ListValue* basic_info = new ListValue(); | 120 ListValue* basic_info = new ListValue(); |
| 121 basic_info->Append(NewDescriptionValuePair( | 121 basic_info->Append(NewDescriptionValuePair( |
| 122 "Initialization time", | 122 "Initialization time", |
| 123 base::Int64ToString(gpu_info.initialization_time.InMilliseconds()))); | 123 base::Int64ToString(gpu_info.initialization_time.InMilliseconds()))); |
| 124 basic_info->Append(NewDescriptionValuePair( | 124 basic_info->Append(NewDescriptionValuePair( |
| 125 "Sandboxed", |
| 126 Value::CreateBooleanValue(gpu_info.sandboxed))); |
| 127 basic_info->Append(NewDescriptionValuePair( |
| 125 "GPU0", GPUDeviceToString(gpu_info.gpu))); | 128 "GPU0", GPUDeviceToString(gpu_info.gpu))); |
| 126 for (size_t i = 0; i < gpu_info.secondary_gpus.size(); ++i) { | 129 for (size_t i = 0; i < gpu_info.secondary_gpus.size(); ++i) { |
| 127 basic_info->Append(NewDescriptionValuePair( | 130 basic_info->Append(NewDescriptionValuePair( |
| 128 base::StringPrintf("GPU%d", static_cast<int>(i + 1)), | 131 base::StringPrintf("GPU%d", static_cast<int>(i + 1)), |
| 129 GPUDeviceToString(gpu_info.secondary_gpus[i]))); | 132 GPUDeviceToString(gpu_info.secondary_gpus[i]))); |
| 130 } | 133 } |
| 131 basic_info->Append(NewDescriptionValuePair( | 134 basic_info->Append(NewDescriptionValuePair( |
| 132 "Optimus", Value::CreateBooleanValue(gpu_info.optimus))); | 135 "Optimus", Value::CreateBooleanValue(gpu_info.optimus))); |
| 133 basic_info->Append(NewDescriptionValuePair( | 136 basic_info->Append(NewDescriptionValuePair( |
| 134 "AMD switchable", Value::CreateBooleanValue(gpu_info.amd_switchable))); | 137 "AMD switchable", Value::CreateBooleanValue(gpu_info.amd_switchable))); |
| (...skipping 485 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 620 //////////////////////////////////////////////////////////////////////////////// | 623 //////////////////////////////////////////////////////////////////////////////// |
| 621 | 624 |
| 622 GpuInternalsUI::GpuInternalsUI(content::WebUI* web_ui) | 625 GpuInternalsUI::GpuInternalsUI(content::WebUI* web_ui) |
| 623 : WebUIController(web_ui) { | 626 : WebUIController(web_ui) { |
| 624 web_ui->AddMessageHandler(new GpuMessageHandler()); | 627 web_ui->AddMessageHandler(new GpuMessageHandler()); |
| 625 | 628 |
| 626 // Set up the chrome://gpu-internals/ source. | 629 // Set up the chrome://gpu-internals/ source. |
| 627 Profile* profile = Profile::FromWebUI(web_ui); | 630 Profile* profile = Profile::FromWebUI(web_ui); |
| 628 ChromeURLDataManager::AddDataSource(profile, CreateGpuHTMLSource()); | 631 ChromeURLDataManager::AddDataSource(profile, CreateGpuHTMLSource()); |
| 629 } | 632 } |
| OLD | NEW |