| 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 379 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 390 base::Value* GpuMessageHandler::OnRequestLogMessages(const base::ListValue*) { | 390 base::Value* GpuMessageHandler::OnRequestLogMessages(const base::ListValue*) { |
| 391 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 391 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
| 392 | 392 |
| 393 return GpuDataManagerImpl::GetInstance()->GetLogMessages(); | 393 return GpuDataManagerImpl::GetInstance()->GetLogMessages(); |
| 394 } | 394 } |
| 395 | 395 |
| 396 void GpuMessageHandler::OnGpuInfoUpdate() { | 396 void GpuMessageHandler::OnGpuInfoUpdate() { |
| 397 // Get GPU Info. | 397 // Get GPU Info. |
| 398 scoped_ptr<base::DictionaryValue> gpu_info_val(GpuInfoAsDictionaryValue()); | 398 scoped_ptr<base::DictionaryValue> gpu_info_val(GpuInfoAsDictionaryValue()); |
| 399 | 399 |
| 400 |
| 400 // Add in blacklisting features | 401 // Add in blacklisting features |
| 401 base::DictionaryValue* feature_status = new base::DictionaryValue; | 402 base::DictionaryValue* feature_status = new base::DictionaryValue; |
| 402 feature_status->Set("featureStatus", GetFeatureStatus()); | 403 feature_status->Set("featureStatus", GetFeatureStatus()); |
| 403 feature_status->Set("problems", GetProblems()); | 404 feature_status->Set("problems", GetProblems()); |
| 404 feature_status->Set("workarounds", GetDriverBugWorkarounds()); | 405 base::ListValue* workarounds = new base::ListValue(); |
| 405 if (feature_status) | 406 for (const std::string& workaround : GetDriverBugWorkarounds()) |
| 406 gpu_info_val->Set("featureStatus", feature_status); | 407 workarounds->AppendString(workaround); |
| 408 feature_status->Set("workarounds", workarounds); |
| 409 gpu_info_val->Set("featureStatus", feature_status); |
| 407 | 410 |
| 408 // Send GPU Info to javascript. | 411 // Send GPU Info to javascript. |
| 409 web_ui()->CallJavascriptFunction("browserBridge.onGpuInfoUpdate", | 412 web_ui()->CallJavascriptFunction("browserBridge.onGpuInfoUpdate", |
| 410 *(gpu_info_val.get())); | 413 *(gpu_info_val.get())); |
| 411 } | 414 } |
| 412 | 415 |
| 413 void GpuMessageHandler::OnGpuSwitched() { | 416 void GpuMessageHandler::OnGpuSwitched() { |
| 414 GpuDataManagerImpl::GetInstance()->RequestCompleteGpuInfoIfNeeded(); | 417 GpuDataManagerImpl::GetInstance()->RequestCompleteGpuInfoIfNeeded(); |
| 415 } | 418 } |
| 416 | 419 |
| (...skipping 10 matching lines...) Expand all Loading... |
| 427 : WebUIController(web_ui) { | 430 : WebUIController(web_ui) { |
| 428 web_ui->AddMessageHandler(new GpuMessageHandler()); | 431 web_ui->AddMessageHandler(new GpuMessageHandler()); |
| 429 | 432 |
| 430 // Set up the chrome://gpu/ source. | 433 // Set up the chrome://gpu/ source. |
| 431 BrowserContext* browser_context = | 434 BrowserContext* browser_context = |
| 432 web_ui->GetWebContents()->GetBrowserContext(); | 435 web_ui->GetWebContents()->GetBrowserContext(); |
| 433 WebUIDataSource::Add(browser_context, CreateGpuHTMLSource()); | 436 WebUIDataSource::Add(browser_context, CreateGpuHTMLSource()); |
| 434 } | 437 } |
| 435 | 438 |
| 436 } // namespace content | 439 } // namespace content |
| OLD | NEW |