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

Unified Diff: base/win/win_util.cc

Issue 7740055: Set user-visible machine names and devices types for synced sessions. (Closed) Base URL: http://git.chromium.org/git/chromium.git@trunk
Patch Set: Split off platform-specific code to various util files, addressed comments Created 9 years, 4 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 side-by-side diff with in-line comments
Download patch
Index: base/win/win_util.cc
diff --git a/base/win/win_util.cc b/base/win/win_util.cc
index 8a9d6229e7d3399d02f457756cdca29f5ca14d4a..8517c8f82571342ca51d3036c9fb0f62a75f3216 100644
--- a/base/win/win_util.cc
+++ b/base/win/win_util.cc
@@ -71,6 +71,15 @@ bool GetUserSidString(std::wstring* user_sid) {
return true;
}
+std::string GetComputerName() {
+ char computer_name[MAX_COMPUTERNAME_LENGTH + 1];
+ DWORD size = sizeof(computer_name);
+ if (GetComputerNameA(computer_name, &size)) {
+ return computer_name;
+ }
+ return "";
darin (slow to review) 2011/08/31 05:52:01 return std::string();
Yaron 2011/08/31 23:23:22 Done.
+}
+
bool IsShiftPressed() {
return (::GetKeyState(VK_SHIFT) & 0x8000) == 0x8000;
}

Powered by Google App Engine
This is Rietveld 408576698