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 #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 316 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
327 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 327 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
328 | 328 |
329 return GpuDataManagerImpl::GetInstance()->GetLogMessages(); | 329 return GpuDataManagerImpl::GetInstance()->GetLogMessages(); |
330 } | 330 } |
331 | 331 |
332 void GpuMessageHandler::OnGpuInfoUpdate() { | 332 void GpuMessageHandler::OnGpuInfoUpdate() { |
333 // Get GPU Info. | 333 // Get GPU Info. |
334 scoped_ptr<base::DictionaryValue> gpu_info_val(GpuInfoAsDictionaryValue()); | 334 scoped_ptr<base::DictionaryValue> gpu_info_val(GpuInfoAsDictionaryValue()); |
335 | 335 |
336 // Add in blacklisting features | 336 // Add in blacklisting features |
337 base::DictionaryValue* feature_status = new DictionaryValue; | 337 base::DictionaryValue* feature_status = new base::DictionaryValue; |
338 feature_status->Set("featureStatus", GetFeatureStatus()); | 338 feature_status->Set("featureStatus", GetFeatureStatus()); |
339 feature_status->Set("problems", GetProblems()); | 339 feature_status->Set("problems", GetProblems()); |
340 feature_status->Set("workarounds", GetDriverBugWorkarounds()); | 340 feature_status->Set("workarounds", GetDriverBugWorkarounds()); |
341 if (feature_status) | 341 if (feature_status) |
342 gpu_info_val->Set("featureStatus", feature_status); | 342 gpu_info_val->Set("featureStatus", feature_status); |
343 | 343 |
344 // Send GPU Info to javascript. | 344 // Send GPU Info to javascript. |
345 web_ui()->CallJavascriptFunction("browserBridge.onGpuInfoUpdate", | 345 web_ui()->CallJavascriptFunction("browserBridge.onGpuInfoUpdate", |
346 *(gpu_info_val.get())); | 346 *(gpu_info_val.get())); |
347 } | 347 } |
(...skipping 15 matching lines...) Expand all Loading... |
363 : WebUIController(web_ui) { | 363 : WebUIController(web_ui) { |
364 web_ui->AddMessageHandler(new GpuMessageHandler()); | 364 web_ui->AddMessageHandler(new GpuMessageHandler()); |
365 | 365 |
366 // Set up the chrome://gpu/ source. | 366 // Set up the chrome://gpu/ source. |
367 BrowserContext* browser_context = | 367 BrowserContext* browser_context = |
368 web_ui->GetWebContents()->GetBrowserContext(); | 368 web_ui->GetWebContents()->GetBrowserContext(); |
369 WebUIDataSource::Add(browser_context, CreateGpuHTMLSource()); | 369 WebUIDataSource::Add(browser_context, CreateGpuHTMLSource()); |
370 } | 370 } |
371 | 371 |
372 } // namespace content | 372 } // namespace content |
OLD | NEW |