Chromium Code Reviews| 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 16 matching lines...) Expand all Loading... | |
| 27 #include "content/public/common/content_switches.h" | 27 #include "content/public/common/content_switches.h" |
| 28 #include "content/public/common/url_constants.h" | 28 #include "content/public/common/url_constants.h" |
| 29 #include "gpu/config/gpu_feature_type.h" | 29 #include "gpu/config/gpu_feature_type.h" |
| 30 #include "gpu/config/gpu_info.h" | 30 #include "gpu/config/gpu_info.h" |
| 31 #include "third_party/angle/src/common/version.h" | 31 #include "third_party/angle/src/common/version.h" |
| 32 | 32 |
| 33 #if defined(OS_WIN) | 33 #if defined(OS_WIN) |
| 34 #include "ui/base/win/shell.h" | 34 #include "ui/base/win/shell.h" |
| 35 #endif | 35 #endif |
| 36 | 36 |
| 37 #if defined(OS_LINUX) | |
|
piman
2014/09/03 23:21:58
&& defined(USE_X11)
Zhenyao Mo
2014/09/04 00:03:57
Done.
| |
| 38 #include "ui/base/x/x11_util.h" | |
| 39 #endif | |
| 40 | |
| 37 namespace content { | 41 namespace content { |
| 38 namespace { | 42 namespace { |
| 39 | 43 |
| 40 WebUIDataSource* CreateGpuHTMLSource() { | 44 WebUIDataSource* CreateGpuHTMLSource() { |
| 41 WebUIDataSource* source = WebUIDataSource::Create(kChromeUIGpuHost); | 45 WebUIDataSource* source = WebUIDataSource::Create(kChromeUIGpuHost); |
| 42 | 46 |
| 43 source->SetJsonPath("strings.js"); | 47 source->SetJsonPath("strings.js"); |
| 44 source->AddResourcePath("gpu_internals.js", IDR_GPU_INTERNALS_JS); | 48 source->AddResourcePath("gpu_internals.js", IDR_GPU_INTERNALS_JS); |
| 45 source->SetDefaultResource(IDR_GPU_INTERNALS_HTML); | 49 source->SetDefaultResource(IDR_GPU_INTERNALS_HTML); |
| 46 return source; | 50 return source; |
| (...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 150 basic_info->Append(NewDescriptionValuePair("GL_VERSION", | 154 basic_info->Append(NewDescriptionValuePair("GL_VERSION", |
| 151 gpu_info.gl_version)); | 155 gpu_info.gl_version)); |
| 152 basic_info->Append(NewDescriptionValuePair("GL_EXTENSIONS", | 156 basic_info->Append(NewDescriptionValuePair("GL_EXTENSIONS", |
| 153 gpu_info.gl_extensions)); | 157 gpu_info.gl_extensions)); |
| 154 basic_info->Append(NewDescriptionValuePair("Window system binding vendor", | 158 basic_info->Append(NewDescriptionValuePair("Window system binding vendor", |
| 155 gpu_info.gl_ws_vendor)); | 159 gpu_info.gl_ws_vendor)); |
| 156 basic_info->Append(NewDescriptionValuePair("Window system binding version", | 160 basic_info->Append(NewDescriptionValuePair("Window system binding version", |
| 157 gpu_info.gl_ws_version)); | 161 gpu_info.gl_ws_version)); |
| 158 basic_info->Append(NewDescriptionValuePair("Window system binding extensions", | 162 basic_info->Append(NewDescriptionValuePair("Window system binding extensions", |
| 159 gpu_info.gl_ws_extensions)); | 163 gpu_info.gl_ws_extensions)); |
| 164 #if defined(OS_LINUX) && defined(USE_X11) | |
| 165 basic_info->Append(NewDescriptionValuePair("Window manager", | |
| 166 ui::GuessWindowManagerName())); | |
| 167 #endif | |
| 160 std::string direct_rendering = gpu_info.direct_rendering ? "Yes" : "No"; | 168 std::string direct_rendering = gpu_info.direct_rendering ? "Yes" : "No"; |
| 161 basic_info->Append( | 169 basic_info->Append( |
| 162 NewDescriptionValuePair("Direct rendering", direct_rendering)); | 170 NewDescriptionValuePair("Direct rendering", direct_rendering)); |
| 163 | 171 |
| 164 std::string reset_strategy = | 172 std::string reset_strategy = |
| 165 base::StringPrintf("0x%04x", gpu_info.gl_reset_notification_strategy); | 173 base::StringPrintf("0x%04x", gpu_info.gl_reset_notification_strategy); |
| 166 basic_info->Append(NewDescriptionValuePair( | 174 basic_info->Append(NewDescriptionValuePair( |
| 167 "Reset notification strategy", reset_strategy)); | 175 "Reset notification strategy", reset_strategy)); |
| 168 | 176 |
| 169 basic_info->Append(NewDescriptionValuePair( | 177 basic_info->Append(NewDescriptionValuePair( |
| (...skipping 212 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 382 : WebUIController(web_ui) { | 390 : WebUIController(web_ui) { |
| 383 web_ui->AddMessageHandler(new GpuMessageHandler()); | 391 web_ui->AddMessageHandler(new GpuMessageHandler()); |
| 384 | 392 |
| 385 // Set up the chrome://gpu/ source. | 393 // Set up the chrome://gpu/ source. |
| 386 BrowserContext* browser_context = | 394 BrowserContext* browser_context = |
| 387 web_ui->GetWebContents()->GetBrowserContext(); | 395 web_ui->GetWebContents()->GetBrowserContext(); |
| 388 WebUIDataSource::Add(browser_context, CreateGpuHTMLSource()); | 396 WebUIDataSource::Add(browser_context, CreateGpuHTMLSource()); |
| 389 } | 397 } |
| 390 | 398 |
| 391 } // namespace content | 399 } // namespace content |
| OLD | NEW |