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 <stddef.h> | 7 #include <stddef.h> |
8 | 8 |
9 #include <memory> | 9 #include <memory> |
10 #include <string> | 10 #include <string> |
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
54 | 54 |
55 namespace content { | 55 namespace content { |
56 namespace { | 56 namespace { |
57 | 57 |
58 WebUIDataSource* CreateGpuHTMLSource() { | 58 WebUIDataSource* CreateGpuHTMLSource() { |
59 WebUIDataSource* source = WebUIDataSource::Create(kChromeUIGpuHost); | 59 WebUIDataSource* source = WebUIDataSource::Create(kChromeUIGpuHost); |
60 | 60 |
61 source->SetJsonPath("strings.js"); | 61 source->SetJsonPath("strings.js"); |
62 source->AddResourcePath("gpu_internals.js", IDR_GPU_INTERNALS_JS); | 62 source->AddResourcePath("gpu_internals.js", IDR_GPU_INTERNALS_JS); |
63 source->SetDefaultResource(IDR_GPU_INTERNALS_HTML); | 63 source->SetDefaultResource(IDR_GPU_INTERNALS_HTML); |
| 64 source->UseGzipForAllPaths(); |
64 return source; | 65 return source; |
65 } | 66 } |
66 | 67 |
67 base::DictionaryValue* NewDescriptionValuePair(const std::string& desc, | 68 base::DictionaryValue* NewDescriptionValuePair(const std::string& desc, |
68 const std::string& value) { | 69 const std::string& value) { |
69 base::DictionaryValue* dict = new base::DictionaryValue(); | 70 base::DictionaryValue* dict = new base::DictionaryValue(); |
70 dict->SetString("description", desc); | 71 dict->SetString("description", desc); |
71 dict->SetString("value", value); | 72 dict->SetString("value", value); |
72 return dict; | 73 return dict; |
73 } | 74 } |
(...skipping 466 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
540 : WebUIController(web_ui) { | 541 : WebUIController(web_ui) { |
541 web_ui->AddMessageHandler(new GpuMessageHandler()); | 542 web_ui->AddMessageHandler(new GpuMessageHandler()); |
542 | 543 |
543 // Set up the chrome://gpu/ source. | 544 // Set up the chrome://gpu/ source. |
544 BrowserContext* browser_context = | 545 BrowserContext* browser_context = |
545 web_ui->GetWebContents()->GetBrowserContext(); | 546 web_ui->GetWebContents()->GetBrowserContext(); |
546 WebUIDataSource::Add(browser_context, CreateGpuHTMLSource()); | 547 WebUIDataSource::Add(browser_context, CreateGpuHTMLSource()); |
547 } | 548 } |
548 | 549 |
549 } // namespace content | 550 } // namespace content |
OLD | NEW |