Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(317)

Side by Side Diff: content/browser/gpu/gpu_internals_ui.cc

Issue 541133002: Add XDG_CURRENT_DESKTOP and GDMSESSION env to about:gpu on Linux. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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"
11 #include "base/command_line.h" 11 #include "base/command_line.h"
12 #include "base/environment.h"
12 #include "base/i18n/time_formatting.h" 13 #include "base/i18n/time_formatting.h"
13 #include "base/strings/string_number_conversions.h" 14 #include "base/strings/string_number_conversions.h"
14 #include "base/strings/stringprintf.h" 15 #include "base/strings/stringprintf.h"
15 #include "base/sys_info.h" 16 #include "base/sys_info.h"
16 #include "base/values.h" 17 #include "base/values.h"
17 #include "content/browser/gpu/compositor_util.h" 18 #include "content/browser/gpu/compositor_util.h"
18 #include "content/browser/gpu/gpu_data_manager_impl.h" 19 #include "content/browser/gpu/gpu_data_manager_impl.h"
19 #include "content/grit/content_resources.h" 20 #include "content/grit/content_resources.h"
20 #include "content/public/browser/browser_thread.h" 21 #include "content/public/browser/browser_thread.h"
21 #include "content/public/browser/gpu_data_manager_observer.h" 22 #include "content/public/browser/gpu_data_manager_observer.h"
(...skipping 136 matching lines...) Expand 10 before | Expand all | Expand 10 after
158 basic_info->Append(NewDescriptionValuePair("GL_VERSION", 159 basic_info->Append(NewDescriptionValuePair("GL_VERSION",
159 gpu_info.gl_version)); 160 gpu_info.gl_version));
160 basic_info->Append(NewDescriptionValuePair("GL_EXTENSIONS", 161 basic_info->Append(NewDescriptionValuePair("GL_EXTENSIONS",
161 gpu_info.gl_extensions)); 162 gpu_info.gl_extensions));
162 basic_info->Append(NewDescriptionValuePair("Window system binding vendor", 163 basic_info->Append(NewDescriptionValuePair("Window system binding vendor",
163 gpu_info.gl_ws_vendor)); 164 gpu_info.gl_ws_vendor));
164 basic_info->Append(NewDescriptionValuePair("Window system binding version", 165 basic_info->Append(NewDescriptionValuePair("Window system binding version",
165 gpu_info.gl_ws_version)); 166 gpu_info.gl_ws_version));
166 basic_info->Append(NewDescriptionValuePair("Window system binding extensions", 167 basic_info->Append(NewDescriptionValuePair("Window system binding extensions",
167 gpu_info.gl_ws_extensions)); 168 gpu_info.gl_ws_extensions));
168 #if defined(OS_LINUX) && defined(USE_X11) 169 #if defined(OS_LINUX)
170 #if defined(USE_X11)
169 basic_info->Append(NewDescriptionValuePair("Window manager", 171 basic_info->Append(NewDescriptionValuePair("Window manager",
170 ui::GuessWindowManagerName())); 172 ui::GuessWindowManagerName()));
171 #endif 173 #endif // USE_X11
174 {
Ken Russell (switch to Gerrit) 2014/09/04 21:48:34 This block should go inside the USE_X11 #if guards
Zhenyao Mo 2014/09/04 21:51:54 Done.
175 scoped_ptr<base::Environment> env(base::Environment::Create());
176 std::string value;
177 const char kXDGCurrentDesktop[] = "XDG_CURRENT_DESKTOP";
178 if (env->GetVar(kXDGCurrentDesktop, &value))
179 basic_info->Append(NewDescriptionValuePair(kXDGCurrentDesktop, value));
180 const char kGDMSession[] = "GDMSESSION";
181 if (env->GetVar(kGDMSession, &value))
182 basic_info->Append(NewDescriptionValuePair(kGDMSession, value));
183 }
184 #endif // OS_LINUX
172 std::string direct_rendering = gpu_info.direct_rendering ? "Yes" : "No"; 185 std::string direct_rendering = gpu_info.direct_rendering ? "Yes" : "No";
173 basic_info->Append( 186 basic_info->Append(
174 NewDescriptionValuePair("Direct rendering", direct_rendering)); 187 NewDescriptionValuePair("Direct rendering", direct_rendering));
175 188
176 std::string reset_strategy = 189 std::string reset_strategy =
177 base::StringPrintf("0x%04x", gpu_info.gl_reset_notification_strategy); 190 base::StringPrintf("0x%04x", gpu_info.gl_reset_notification_strategy);
178 basic_info->Append(NewDescriptionValuePair( 191 basic_info->Append(NewDescriptionValuePair(
179 "Reset notification strategy", reset_strategy)); 192 "Reset notification strategy", reset_strategy));
180 193
181 basic_info->Append(NewDescriptionValuePair( 194 basic_info->Append(NewDescriptionValuePair(
(...skipping 212 matching lines...) Expand 10 before | Expand all | Expand 10 after
394 : WebUIController(web_ui) { 407 : WebUIController(web_ui) {
395 web_ui->AddMessageHandler(new GpuMessageHandler()); 408 web_ui->AddMessageHandler(new GpuMessageHandler());
396 409
397 // Set up the chrome://gpu/ source. 410 // Set up the chrome://gpu/ source.
398 BrowserContext* browser_context = 411 BrowserContext* browser_context =
399 web_ui->GetWebContents()->GetBrowserContext(); 412 web_ui->GetWebContents()->GetBrowserContext();
400 WebUIDataSource::Add(browser_context, CreateGpuHTMLSource()); 413 WebUIDataSource::Add(browser_context, CreateGpuHTMLSource());
401 } 414 }
402 415
403 } // namespace content 416 } // namespace content
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698