| 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 188 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 199 base::SysInfo::OperatingSystemVersion()); | 199 base::SysInfo::OperatingSystemVersion()); |
| 200 dict->SetString("angle_revision", base::UintToString(BUILD_REVISION)); | 200 dict->SetString("angle_revision", base::UintToString(BUILD_REVISION)); |
| 201 #if defined(USE_SKIA) | 201 #if defined(USE_SKIA) |
| 202 dict->SetString("graphics_backend", "Skia"); | 202 dict->SetString("graphics_backend", "Skia"); |
| 203 #else | 203 #else |
| 204 dict->SetString("graphics_backend", "Core Graphics"); | 204 dict->SetString("graphics_backend", "Core Graphics"); |
| 205 #endif | 205 #endif |
| 206 dict->SetString("blacklist_version", | 206 dict->SetString("blacklist_version", |
| 207 GpuDataManager::GetInstance()->GetBlacklistVersion()); | 207 GpuDataManager::GetInstance()->GetBlacklistVersion()); |
| 208 | 208 |
| 209 GpuPerformanceStats stats = |
| 210 GpuDataManager::GetInstance()->GetPerformanceStats(); |
| 211 dict->Set("performance", stats.ToValue()); |
| 212 |
| 209 return dict; | 213 return dict; |
| 210 } | 214 } |
| 211 | 215 |
| 212 Value* GpuMessageHandler::OnRequestLogMessages(const ListValue*) { | 216 Value* GpuMessageHandler::OnRequestLogMessages(const ListValue*) { |
| 213 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 217 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
| 214 | 218 |
| 215 return gpu_data_manager_->log_messages().DeepCopy(); | 219 return gpu_data_manager_->log_messages().DeepCopy(); |
| 216 } | 220 } |
| 217 | 221 |
| 218 void GpuMessageHandler::OnGpuInfoUpdate() { | 222 void GpuMessageHandler::OnGpuInfoUpdate() { |
| (...skipping 21 matching lines...) Expand all Loading... |
| 240 //////////////////////////////////////////////////////////////////////////////// | 244 //////////////////////////////////////////////////////////////////////////////// |
| 241 | 245 |
| 242 GpuInternalsUI::GpuInternalsUI(content::WebUI* web_ui) | 246 GpuInternalsUI::GpuInternalsUI(content::WebUI* web_ui) |
| 243 : WebUIController(web_ui) { | 247 : WebUIController(web_ui) { |
| 244 web_ui->AddMessageHandler(new GpuMessageHandler()); | 248 web_ui->AddMessageHandler(new GpuMessageHandler()); |
| 245 | 249 |
| 246 // Set up the chrome://gpu-internals/ source. | 250 // Set up the chrome://gpu-internals/ source. |
| 247 Profile* profile = Profile::FromWebUI(web_ui); | 251 Profile* profile = Profile::FromWebUI(web_ui); |
| 248 profile->GetChromeURLDataManager()->AddDataSource(CreateGpuHTMLSource()); | 252 profile->GetChromeURLDataManager()->AddDataSource(CreateGpuHTMLSource()); |
| 249 } | 253 } |
| OLD | NEW |