| 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 200 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 211 ui::GuessWindowManagerName())); | 211 ui::GuessWindowManagerName())); |
| 212 { | 212 { |
| 213 std::unique_ptr<base::Environment> env(base::Environment::Create()); | 213 std::unique_ptr<base::Environment> env(base::Environment::Create()); |
| 214 std::string value; | 214 std::string value; |
| 215 const char kXDGCurrentDesktop[] = "XDG_CURRENT_DESKTOP"; | 215 const char kXDGCurrentDesktop[] = "XDG_CURRENT_DESKTOP"; |
| 216 if (env->GetVar(kXDGCurrentDesktop, &value)) | 216 if (env->GetVar(kXDGCurrentDesktop, &value)) |
| 217 basic_info->Append(NewDescriptionValuePair(kXDGCurrentDesktop, value)); | 217 basic_info->Append(NewDescriptionValuePair(kXDGCurrentDesktop, value)); |
| 218 const char kGDMSession[] = "GDMSESSION"; | 218 const char kGDMSession[] = "GDMSESSION"; |
| 219 if (env->GetVar(kGDMSession, &value)) | 219 if (env->GetVar(kGDMSession, &value)) |
| 220 basic_info->Append(NewDescriptionValuePair(kGDMSession, value)); | 220 basic_info->Append(NewDescriptionValuePair(kGDMSession, value)); |
| 221 const char* const kAtomsToCache[] = { | 221 basic_info->Append(NewDescriptionValuePair( |
| 222 "_NET_WM_CM_S0", | 222 "Compositing manager", |
| 223 NULL | 223 ui::IsCompositingManagerPresent() ? "Yes" : "No")); |
| 224 }; | |
| 225 ui::X11AtomCache atom_cache(gfx::GetXDisplay(), kAtomsToCache); | |
| 226 std::string compositing_manager = XGetSelectionOwner( | |
| 227 gfx::GetXDisplay(), | |
| 228 atom_cache.GetAtom("_NET_WM_CM_S0")) != None ? "Yes" : "No"; | |
| 229 basic_info->Append( | |
| 230 NewDescriptionValuePair("Compositing manager", compositing_manager)); | |
| 231 } | 224 } |
| 232 #endif | 225 #endif |
| 233 std::string direct_rendering = gpu_info.direct_rendering ? "Yes" : "No"; | 226 std::string direct_rendering = gpu_info.direct_rendering ? "Yes" : "No"; |
| 234 basic_info->Append( | 227 basic_info->Append( |
| 235 NewDescriptionValuePair("Direct rendering", direct_rendering)); | 228 NewDescriptionValuePair("Direct rendering", direct_rendering)); |
| 236 | 229 |
| 237 std::string reset_strategy = | 230 std::string reset_strategy = |
| 238 base::StringPrintf("0x%04x", gpu_info.gl_reset_notification_strategy); | 231 base::StringPrintf("0x%04x", gpu_info.gl_reset_notification_strategy); |
| 239 basic_info->Append(NewDescriptionValuePair( | 232 basic_info->Append(NewDescriptionValuePair( |
| 240 "Reset notification strategy", reset_strategy)); | 233 "Reset notification strategy", reset_strategy)); |
| (...skipping 319 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 560 : WebUIController(web_ui) { | 553 : WebUIController(web_ui) { |
| 561 web_ui->AddMessageHandler(base::MakeUnique<GpuMessageHandler>()); | 554 web_ui->AddMessageHandler(base::MakeUnique<GpuMessageHandler>()); |
| 562 | 555 |
| 563 // Set up the chrome://gpu/ source. | 556 // Set up the chrome://gpu/ source. |
| 564 BrowserContext* browser_context = | 557 BrowserContext* browser_context = |
| 565 web_ui->GetWebContents()->GetBrowserContext(); | 558 web_ui->GetWebContents()->GetBrowserContext(); |
| 566 WebUIDataSource::Add(browser_context, CreateGpuHTMLSource()); | 559 WebUIDataSource::Add(browser_context, CreateGpuHTMLSource()); |
| 567 } | 560 } |
| 568 | 561 |
| 569 } // namespace content | 562 } // namespace content |
| OLD | NEW |