OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 <algorithm> | 7 #include <algorithm> |
8 #include <string> | 8 #include <string> |
9 #include <utility> | 9 #include <utility> |
10 #include <vector> | 10 #include <vector> |
(...skipping 364 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
375 | 375 |
376 return gpu_data_manager_->log_messages().DeepCopy(); | 376 return gpu_data_manager_->log_messages().DeepCopy(); |
377 } | 377 } |
378 | 378 |
379 void GpuMessageHandler::OnGpuInfoUpdate() { | 379 void GpuMessageHandler::OnGpuInfoUpdate() { |
380 const GPUInfo& gpu_info = gpu_data_manager_->gpu_info(); | 380 const GPUInfo& gpu_info = gpu_data_manager_->gpu_info(); |
381 | 381 |
382 // Get GPU Info. | 382 // Get GPU Info. |
383 DictionaryValue* gpu_info_val = GpuInfoToDict(gpu_info); | 383 DictionaryValue* gpu_info_val = GpuInfoToDict(gpu_info); |
384 | 384 |
385 // Add in blacklisting reasons | 385 // Add in blacklisting features |
386 Value* blacklisting_reasons = gpu_data_manager_->GetBlacklistingReasons(); | 386 Value* feature_status = gpu_data_manager_->GetFeatureStatus(); |
387 if (blacklisting_reasons) | 387 if (feature_status) |
388 gpu_info_val->Set("blacklistingReasons", blacklisting_reasons); | 388 gpu_info_val->Set("featureStatus", feature_status); |
389 | 389 |
390 // Send GPU Info to javascript. | 390 // Send GPU Info to javascript. |
391 web_ui_->CallJavascriptFunction("browserBridge.onGpuInfoUpdate", | 391 web_ui_->CallJavascriptFunction("browserBridge.onGpuInfoUpdate", |
392 *gpu_info_val); | 392 *gpu_info_val); |
393 | 393 |
394 delete gpu_info_val; | 394 delete gpu_info_val; |
395 } | 395 } |
396 | 396 |
397 void GpuMessageHandler::OnBeginTracing(const ListValue* args) { | 397 void GpuMessageHandler::OnBeginTracing(const ListValue* args) { |
398 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 398 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
445 //////////////////////////////////////////////////////////////////////////////// | 445 //////////////////////////////////////////////////////////////////////////////// |
446 | 446 |
447 GpuInternalsUI::GpuInternalsUI(TabContents* contents) : WebUI(contents) { | 447 GpuInternalsUI::GpuInternalsUI(TabContents* contents) : WebUI(contents) { |
448 AddMessageHandler((new GpuMessageHandler())->Attach(this)); | 448 AddMessageHandler((new GpuMessageHandler())->Attach(this)); |
449 | 449 |
450 GpuHTMLSource* html_source = new GpuHTMLSource(); | 450 GpuHTMLSource* html_source = new GpuHTMLSource(); |
451 | 451 |
452 // Set up the chrome://gpu/ source. | 452 // Set up the chrome://gpu/ source. |
453 contents->profile()->GetChromeURLDataManager()->AddDataSource(html_source); | 453 contents->profile()->GetChromeURLDataManager()->AddDataSource(html_source); |
454 } | 454 } |
OLD | NEW |