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 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
57 | 57 |
58 namespace content { | 58 namespace content { |
59 namespace { | 59 namespace { |
60 | 60 |
61 WebUIDataSource* CreateGpuHTMLSource() { | 61 WebUIDataSource* CreateGpuHTMLSource() { |
62 WebUIDataSource* source = WebUIDataSource::Create(kChromeUIGpuHost); | 62 WebUIDataSource* source = WebUIDataSource::Create(kChromeUIGpuHost); |
63 | 63 |
64 source->SetJsonPath("strings.js"); | 64 source->SetJsonPath("strings.js"); |
65 source->AddResourcePath("gpu_internals.js", IDR_GPU_INTERNALS_JS); | 65 source->AddResourcePath("gpu_internals.js", IDR_GPU_INTERNALS_JS); |
66 source->SetDefaultResource(IDR_GPU_INTERNALS_HTML); | 66 source->SetDefaultResource(IDR_GPU_INTERNALS_HTML); |
| 67 source->DisableI18nAndUseGzipForAllPaths(); |
67 return source; | 68 return source; |
68 } | 69 } |
69 | 70 |
70 base::DictionaryValue* NewDescriptionValuePair(const std::string& desc, | 71 base::DictionaryValue* NewDescriptionValuePair(const std::string& desc, |
71 const std::string& value) { | 72 const std::string& value) { |
72 base::DictionaryValue* dict = new base::DictionaryValue(); | 73 base::DictionaryValue* dict = new base::DictionaryValue(); |
73 dict->SetString("description", desc); | 74 dict->SetString("description", desc); |
74 dict->SetString("value", value); | 75 dict->SetString("value", value); |
75 return dict; | 76 return dict; |
76 } | 77 } |
(...skipping 468 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
545 : WebUIController(web_ui) { | 546 : WebUIController(web_ui) { |
546 web_ui->AddMessageHandler(new GpuMessageHandler()); | 547 web_ui->AddMessageHandler(new GpuMessageHandler()); |
547 | 548 |
548 // Set up the chrome://gpu/ source. | 549 // Set up the chrome://gpu/ source. |
549 BrowserContext* browser_context = | 550 BrowserContext* browser_context = |
550 web_ui->GetWebContents()->GetBrowserContext(); | 551 web_ui->GetWebContents()->GetBrowserContext(); |
551 WebUIDataSource::Add(browser_context, CreateGpuHTMLSource()); | 552 WebUIDataSource::Add(browser_context, CreateGpuHTMLSource()); |
552 } | 553 } |
553 | 554 |
554 } // namespace content | 555 } // namespace content |
OLD | NEW |