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

Side by Side Diff: base/win/win_util.cc

Issue 706203003: Update from https://crrev.com/303153 (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 6 years, 1 month 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 | « base/win/win_util.h ('k') | build/all.gyp » ('j') | 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 "base/win/win_util.h" 5 #include "base/win/win_util.h"
6 6
7 #include <aclapi.h> 7 #include <aclapi.h>
8 #include <cfgmgr32.h> 8 #include <cfgmgr32.h>
9 #include <lm.h> 9 #include <lm.h>
10 #include <powrprof.h> 10 #include <powrprof.h>
(...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after
112 return keyboard_count > 1; 112 return keyboard_count > 1;
113 } 113 }
114 114
115 } // namespace 115 } // namespace
116 116
117 namespace base { 117 namespace base {
118 namespace win { 118 namespace win {
119 119
120 static bool g_crash_on_process_detach = false; 120 static bool g_crash_on_process_detach = false;
121 121
122 void GetNonClientMetrics(NONCLIENTMETRICS* metrics) { 122 void GetNonClientMetrics(NONCLIENTMETRICS_XP* metrics) {
123 DCHECK(metrics); 123 DCHECK(metrics);
124 metrics->cbSize = sizeof(*metrics); 124 metrics->cbSize = sizeof(*metrics);
125 const bool success = 125 const bool success = !!SystemParametersInfo(
126 !!SystemParametersInfo( 126 SPI_GETNONCLIENTMETRICS,
127 SPI_GETNONCLIENTMETRICS, metrics->cbSize, metrics, 0); 127 metrics->cbSize,
128 reinterpret_cast<NONCLIENTMETRICS*>(metrics),
129 0);
128 DCHECK(success); 130 DCHECK(success);
129 } 131 }
130 132
131 bool GetUserSidString(std::wstring* user_sid) { 133 bool GetUserSidString(std::wstring* user_sid) {
132 // Get the current token. 134 // Get the current token.
133 HANDLE token = NULL; 135 HANDLE token = NULL;
134 if (!::OpenProcessToken(::GetCurrentProcess(), TOKEN_QUERY, &token)) 136 if (!::OpenProcessToken(::GetCurrentProcess(), TOKEN_QUERY, &token))
135 return false; 137 return false;
136 base::win::ScopedHandle token_scoped(token); 138 base::win::ScopedHandle token_scoped(token);
137 139
(...skipping 327 matching lines...) Expand 10 before | Expand all | Expand 10 after
465 #if defined(_MSC_FULL_VER) 467 #if defined(_MSC_FULL_VER)
466 #pragma message(__PPOUT__(_MSC_FULL_VER)) 468 #pragma message(__PPOUT__(_MSC_FULL_VER))
467 #endif 469 #endif
468 470
469 #pragma message("Visual Studio 2012 x86 must be updated to at least Update 1") 471 #pragma message("Visual Studio 2012 x86 must be updated to at least Update 1")
470 #error Must install Update 1 to Visual Studio 2012. 472 #error Must install Update 1 to Visual Studio 2012.
471 #endif 473 #endif
472 474
473 #endif // _MSC_VER 475 #endif // _MSC_VER
474 476
OLDNEW
« no previous file with comments | « base/win/win_util.h ('k') | build/all.gyp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698