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