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

Side by Side Diff: chrome/browser/chromeos/login/startup_utils.cc

Issue 23904025: Move IsRunningOnChromeOS to SysInfo (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Merge fix Created 7 years, 2 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
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 "chrome/browser/chromeos/login/startup_utils.h" 5 #include "chrome/browser/chromeos/login/startup_utils.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/chromeos/chromeos_version.h"
9 #include "base/file_util.h" 8 #include "base/file_util.h"
10 #include "base/path_service.h" 9 #include "base/path_service.h"
11 #include "base/prefs/pref_registry_simple.h" 10 #include "base/prefs/pref_registry_simple.h"
12 #include "base/prefs/pref_service.h" 11 #include "base/prefs/pref_service.h"
12 #include "base/sys_info.h"
13 #include "base/threading/thread_restrictions.h" 13 #include "base/threading/thread_restrictions.h"
14 #include "chrome/browser/browser_process.h" 14 #include "chrome/browser/browser_process.h"
15 #include "chrome/common/chrome_paths.h" 15 #include "chrome/common/chrome_paths.h"
16 #include "chrome/common/pref_names.h" 16 #include "chrome/common/pref_names.h"
17 #include "content/public/browser/browser_thread.h" 17 #include "content/public/browser/browser_thread.h"
18 #include "ui/base/l10n/l10n_util.h" 18 #include "ui/base/l10n/l10n_util.h"
19 19
20 using content::BrowserThread; 20 using content::BrowserThread;
21 21
22 namespace { 22 namespace {
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after
88 } 88 }
89 89
90 // Returns the path to flag file indicating that both parts of OOBE were 90 // Returns the path to flag file indicating that both parts of OOBE were
91 // completed. 91 // completed.
92 // On chrome device, returns /home/chronos/.oobe_completed. 92 // On chrome device, returns /home/chronos/.oobe_completed.
93 // On Linux desktop, returns {DIR_USER_DATA}/.oobe_completed. 93 // On Linux desktop, returns {DIR_USER_DATA}/.oobe_completed.
94 static base::FilePath GetOobeCompleteFlagPath() { 94 static base::FilePath GetOobeCompleteFlagPath() {
95 // The constant is defined here so it won't be referenced directly. 95 // The constant is defined here so it won't be referenced directly.
96 const char kOobeCompleteFlagFilePath[] = "/home/chronos/.oobe_completed"; 96 const char kOobeCompleteFlagFilePath[] = "/home/chronos/.oobe_completed";
97 97
98 if (base::chromeos::IsRunningOnChromeOS()) { 98 if (base::SysInfo::IsRunningOnChromeOS()) {
99 return base::FilePath(kOobeCompleteFlagFilePath); 99 return base::FilePath(kOobeCompleteFlagFilePath);
100 } else { 100 } else {
101 base::FilePath user_data_dir; 101 base::FilePath user_data_dir;
102 PathService::Get(chrome::DIR_USER_DATA, &user_data_dir); 102 PathService::Get(chrome::DIR_USER_DATA, &user_data_dir);
103 return user_data_dir.AppendASCII(".oobe_completed"); 103 return user_data_dir.AppendASCII(".oobe_completed");
104 } 104 }
105 } 105 }
106 106
107 static void CreateOobeCompleteFlagFile() { 107 static void CreateOobeCompleteFlagFile() {
108 // Create flag file for boot-time init scripts. 108 // Create flag file for boot-time init scripts.
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after
159 159
160 // static 160 // static
161 void StartupUtils::SetInitialLocale(const std::string& locale) { 161 void StartupUtils::SetInitialLocale(const std::string& locale) {
162 if (l10n_util::IsValidLocaleSyntax(locale)) 162 if (l10n_util::IsValidLocaleSyntax(locale))
163 SaveStringPreferenceForced(kInitialLocale, locale); 163 SaveStringPreferenceForced(kInitialLocale, locale);
164 else 164 else
165 NOTREACHED(); 165 NOTREACHED();
166 } 166 }
167 167
168 } // namespace chromeos 168 } // namespace chromeos
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698