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 source->UseGzip(std::unordered_set<std::string>()); |
68 return source; | 68 return source; |
69 } | 69 } |
70 | 70 |
71 std::unique_ptr<base::DictionaryValue> NewDescriptionValuePair( | 71 std::unique_ptr<base::DictionaryValue> NewDescriptionValuePair( |
72 const std::string& desc, | 72 const std::string& desc, |
73 const std::string& value) { | 73 const std::string& value) { |
74 std::unique_ptr<base::DictionaryValue> dict(new base::DictionaryValue()); | 74 std::unique_ptr<base::DictionaryValue> dict(new base::DictionaryValue()); |
75 dict->SetString("description", desc); | 75 dict->SetString("description", desc); |
76 dict->SetString("value", value); | 76 dict->SetString("value", value); |
77 return dict; | 77 return dict; |
(...skipping 481 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
559 : WebUIController(web_ui) { | 559 : WebUIController(web_ui) { |
560 web_ui->AddMessageHandler(new GpuMessageHandler()); | 560 web_ui->AddMessageHandler(new GpuMessageHandler()); |
561 | 561 |
562 // Set up the chrome://gpu/ source. | 562 // Set up the chrome://gpu/ source. |
563 BrowserContext* browser_context = | 563 BrowserContext* browser_context = |
564 web_ui->GetWebContents()->GetBrowserContext(); | 564 web_ui->GetWebContents()->GetBrowserContext(); |
565 WebUIDataSource::Add(browser_context, CreateGpuHTMLSource()); | 565 WebUIDataSource::Add(browser_context, CreateGpuHTMLSource()); |
566 } | 566 } |
567 | 567 |
568 } // namespace content | 568 } // namespace content |
OLD | NEW |