| 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 372 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 383 base::Value* GpuMessageHandler::OnRequestLogMessages(const base::ListValue*) { | 383 base::Value* GpuMessageHandler::OnRequestLogMessages(const base::ListValue*) { |
| 384 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 384 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
| 385 | 385 |
| 386 return GpuDataManagerImpl::GetInstance()->GetLogMessages(); | 386 return GpuDataManagerImpl::GetInstance()->GetLogMessages(); |
| 387 } | 387 } |
| 388 | 388 |
| 389 void GpuMessageHandler::OnGpuInfoUpdate() { | 389 void GpuMessageHandler::OnGpuInfoUpdate() { |
| 390 // Get GPU Info. | 390 // Get GPU Info. |
| 391 scoped_ptr<base::DictionaryValue> gpu_info_val(GpuInfoAsDictionaryValue()); | 391 scoped_ptr<base::DictionaryValue> gpu_info_val(GpuInfoAsDictionaryValue()); |
| 392 | 392 |
| 393 |
| 393 // Add in blacklisting features | 394 // Add in blacklisting features |
| 394 base::DictionaryValue* feature_status = new base::DictionaryValue; | 395 base::DictionaryValue* feature_status = new base::DictionaryValue; |
| 395 feature_status->Set("featureStatus", GetFeatureStatus()); | 396 feature_status->Set("featureStatus", GetFeatureStatus()); |
| 396 feature_status->Set("problems", GetProblems()); | 397 feature_status->Set("problems", GetProblems()); |
| 397 feature_status->Set("workarounds", GetDriverBugWorkarounds()); | 398 base::ListValue* workarounds = new base::ListValue(); |
| 398 if (feature_status) | 399 for (const std::string& workaround : GetDriverBugWorkarounds()) |
| 399 gpu_info_val->Set("featureStatus", feature_status); | 400 workarounds->AppendString(workaround); |
| 401 feature_status->Set("workarounds", workarounds); |
| 402 gpu_info_val->Set("featureStatus", feature_status); |
| 400 | 403 |
| 401 // Send GPU Info to javascript. | 404 // Send GPU Info to javascript. |
| 402 web_ui()->CallJavascriptFunction("browserBridge.onGpuInfoUpdate", | 405 web_ui()->CallJavascriptFunction("browserBridge.onGpuInfoUpdate", |
| 403 *(gpu_info_val.get())); | 406 *(gpu_info_val.get())); |
| 404 } | 407 } |
| 405 | 408 |
| 406 void GpuMessageHandler::OnGpuSwitching() { | 409 void GpuMessageHandler::OnGpuSwitching() { |
| 407 GpuDataManagerImpl::GetInstance()->RequestCompleteGpuInfoIfNeeded(); | 410 GpuDataManagerImpl::GetInstance()->RequestCompleteGpuInfoIfNeeded(); |
| 408 } | 411 } |
| 409 | 412 |
| (...skipping 10 matching lines...) Expand all Loading... |
| 420 : WebUIController(web_ui) { | 423 : WebUIController(web_ui) { |
| 421 web_ui->AddMessageHandler(new GpuMessageHandler()); | 424 web_ui->AddMessageHandler(new GpuMessageHandler()); |
| 422 | 425 |
| 423 // Set up the chrome://gpu/ source. | 426 // Set up the chrome://gpu/ source. |
| 424 BrowserContext* browser_context = | 427 BrowserContext* browser_context = |
| 425 web_ui->GetWebContents()->GetBrowserContext(); | 428 web_ui->GetWebContents()->GetBrowserContext(); |
| 426 WebUIDataSource::Add(browser_context, CreateGpuHTMLSource()); | 429 WebUIDataSource::Add(browser_context, CreateGpuHTMLSource()); |
| 427 } | 430 } |
| 428 | 431 |
| 429 } // namespace content | 432 } // namespace content |
| OLD | NEW |