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

Side by Side Diff: chrome/browser/chromeos/system/runtime_environment.cc

Issue 9546013: Move IsRunningOnChromeOS to base/chromeos (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: chromeos_version,sync,cleanup Created 8 years, 9 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 | Annotate | Revision Log
OLDNEW
(Empty)
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #include "chrome/browser/chromeos/system/runtime_environment.h"
6
7 #include <stdlib.h>
8 #include <string.h>
9
10 #include "base/logging.h"
11
12 namespace chromeos {
13 namespace system {
14 namespace runtime_environment {
15
16 bool IsRunningOnChromeOS() {
17 // Check if the user name is chronos. Note that we don't go with
18 // getuid() + getpwuid_r() as it may end up reading /etc/passwd, which
19 // can be expensive.
20 const char* user = getenv("USER");
21 return user && strcmp(user, "chronos") == 0;
22 }
23
24 } // namespace runtime_environment
25 } // namespace system
26 } // namespace chromeos
OLDNEW
« no previous file with comments | « chrome/browser/chromeos/system/runtime_environment.h ('k') | chrome/browser/chromeos/system/screen_locker_settings.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698