| 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 "content/browser/gpu/gpu_internals_ui.h" | 5 #include "content/browser/gpu/gpu_internals_ui.h" |
| 6 | 6 |
| 7 #if defined(OS_LINUX) && defined(USE_X11) | 7 #if defined(OS_LINUX) && defined(USE_X11) |
| 8 #include <X11/Xlib.h> | 8 #include <X11/Xlib.h> |
| 9 #endif | 9 #endif |
| 10 | 10 |
| (...skipping 195 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 206 "Reset notification strategy", reset_strategy)); | 206 "Reset notification strategy", reset_strategy)); |
| 207 | 207 |
| 208 basic_info->Append(NewDescriptionValuePair( | 208 basic_info->Append(NewDescriptionValuePair( |
| 209 "GPU process crash count", | 209 "GPU process crash count", |
| 210 new base::FundamentalValue(gpu_info.process_crash_count))); | 210 new base::FundamentalValue(gpu_info.process_crash_count))); |
| 211 | 211 |
| 212 base::DictionaryValue* info = new base::DictionaryValue(); | 212 base::DictionaryValue* info = new base::DictionaryValue(); |
| 213 info->Set("basic_info", basic_info); | 213 info->Set("basic_info", basic_info); |
| 214 | 214 |
| 215 #if defined(OS_WIN) | 215 #if defined(OS_WIN) |
| 216 base::ListValue* perf_info = new base::ListValue(); | |
| 217 perf_info->Append(NewDescriptionValuePair( | |
| 218 "Graphics", | |
| 219 base::StringPrintf("%.1f", gpu_info.performance_stats.graphics))); | |
| 220 perf_info->Append(NewDescriptionValuePair( | |
| 221 "Gaming", | |
| 222 base::StringPrintf("%.1f", gpu_info.performance_stats.gaming))); | |
| 223 perf_info->Append(NewDescriptionValuePair( | |
| 224 "Overall", | |
| 225 base::StringPrintf("%.1f", gpu_info.performance_stats.overall))); | |
| 226 info->Set("performance_info", perf_info); | |
| 227 | |
| 228 base::Value* dx_info = gpu_info.dx_diagnostics.children.size() ? | 216 base::Value* dx_info = gpu_info.dx_diagnostics.children.size() ? |
| 229 DxDiagNodeToList(gpu_info.dx_diagnostics) : | 217 DxDiagNodeToList(gpu_info.dx_diagnostics) : |
| 230 base::Value::CreateNullValue(); | 218 base::Value::CreateNullValue(); |
| 231 info->Set("diagnostics", dx_info); | 219 info->Set("diagnostics", dx_info); |
| 232 #endif | 220 #endif |
| 233 | 221 |
| 234 return info; | 222 return info; |
| 235 } | 223 } |
| 236 | 224 |
| 237 // This class receives javascript messages from the renderer. | 225 // This class receives javascript messages from the renderer. |
| (...skipping 192 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 430 : WebUIController(web_ui) { | 418 : WebUIController(web_ui) { |
| 431 web_ui->AddMessageHandler(new GpuMessageHandler()); | 419 web_ui->AddMessageHandler(new GpuMessageHandler()); |
| 432 | 420 |
| 433 // Set up the chrome://gpu/ source. | 421 // Set up the chrome://gpu/ source. |
| 434 BrowserContext* browser_context = | 422 BrowserContext* browser_context = |
| 435 web_ui->GetWebContents()->GetBrowserContext(); | 423 web_ui->GetWebContents()->GetBrowserContext(); |
| 436 WebUIDataSource::Add(browser_context, CreateGpuHTMLSource()); | 424 WebUIDataSource::Add(browser_context, CreateGpuHTMLSource()); |
| 437 } | 425 } |
| 438 | 426 |
| 439 } // namespace content | 427 } // namespace content |
| OLD | NEW |