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 25 matching lines...) Expand all Loading... |
36 | 36 |
37 struct GpuFeatureInfo { | 37 struct GpuFeatureInfo { |
38 std::string name; | 38 std::string name; |
39 uint32 blocked; | 39 uint32 blocked; |
40 bool disabled; | 40 bool disabled; |
41 std::string disabled_description; | 41 std::string disabled_description; |
42 bool fallback_to_software; | 42 bool fallback_to_software; |
43 }; | 43 }; |
44 | 44 |
45 WebUIDataSource* CreateGpuHTMLSource() { | 45 WebUIDataSource* CreateGpuHTMLSource() { |
46 WebUIDataSource* source = WebUIDataSource::Create(chrome::kChromeUIGpuHost); | 46 WebUIDataSource* source = WebUIDataSource::Create(kChromeUIGpuHost); |
47 | 47 |
48 source->SetJsonPath("strings.js"); | 48 source->SetJsonPath("strings.js"); |
49 source->AddResourcePath("gpu_internals.js", IDR_GPU_INTERNALS_JS); | 49 source->AddResourcePath("gpu_internals.js", IDR_GPU_INTERNALS_JS); |
50 source->SetDefaultResource(IDR_GPU_INTERNALS_HTML); | 50 source->SetDefaultResource(IDR_GPU_INTERNALS_HTML); |
51 return source; | 51 return source; |
52 } | 52 } |
53 | 53 |
54 base::DictionaryValue* NewDescriptionValuePair(const std::string& desc, | 54 base::DictionaryValue* NewDescriptionValuePair(const std::string& desc, |
55 const std::string& value) { | 55 const std::string& value) { |
56 base::DictionaryValue* dict = new base::DictionaryValue(); | 56 base::DictionaryValue* dict = new base::DictionaryValue(); |
(...skipping 598 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
655 : WebUIController(web_ui) { | 655 : WebUIController(web_ui) { |
656 web_ui->AddMessageHandler(new GpuMessageHandler()); | 656 web_ui->AddMessageHandler(new GpuMessageHandler()); |
657 | 657 |
658 // Set up the chrome://gpu/ source. | 658 // Set up the chrome://gpu/ source. |
659 BrowserContext* browser_context = | 659 BrowserContext* browser_context = |
660 web_ui->GetWebContents()->GetBrowserContext(); | 660 web_ui->GetWebContents()->GetBrowserContext(); |
661 WebUIDataSource::Add(browser_context, CreateGpuHTMLSource()); | 661 WebUIDataSource::Add(browser_context, CreateGpuHTMLSource()); |
662 } | 662 } |
663 | 663 |
664 } // namespace content | 664 } // namespace content |
OLD | NEW |