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

Side by Side Diff: chrome/browser/first_run/first_run_internal_win.cc

Issue 184563006: Move WriteFile and WriteFileDescriptor from file_util to base namespace. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 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
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/first_run/first_run_internal.h" 5 #include "chrome/browser/first_run/first_run_internal.h"
6 6
7 #include <windows.h> 7 #include <windows.h>
8 #include <shellapi.h> 8 #include <shellapi.h>
9 9
10 #include "base/base_paths.h" 10 #include "base/base_paths.h"
(...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after
101 } 101 }
102 return false; 102 return false;
103 } 103 }
104 104
105 // Writes the EULA to a temporary file, returned in |*eula_path|, and returns 105 // Writes the EULA to a temporary file, returned in |*eula_path|, and returns
106 // true if successful. 106 // true if successful.
107 bool WriteEULAtoTempFile(base::FilePath* eula_path) { 107 bool WriteEULAtoTempFile(base::FilePath* eula_path) {
108 std::string terms = l10n_util::GetStringUTF8(IDS_TERMS_HTML); 108 std::string terms = l10n_util::GetStringUTF8(IDS_TERMS_HTML);
109 return (!terms.empty() && 109 return (!terms.empty() &&
110 base::CreateTemporaryFile(eula_path) && 110 base::CreateTemporaryFile(eula_path) &&
111 file_util::WriteFile(*eula_path, terms.data(), terms.size()) != -1); 111 base::WriteFile(*eula_path, terms.data(), terms.size()) != -1);
112 } 112 }
113 113
114 // Creates the sentinel indicating that the EULA was required and has been 114 // Creates the sentinel indicating that the EULA was required and has been
115 // accepted. 115 // accepted.
116 bool CreateEULASentinel() { 116 bool CreateEULASentinel() {
117 base::FilePath eula_sentinel; 117 base::FilePath eula_sentinel;
118 if (!GetEULASentinelFilePath(&eula_sentinel)) 118 if (!GetEULASentinelFilePath(&eula_sentinel))
119 return false; 119 return false;
120 120
121 return (base::CreateDirectory(eula_sentinel.DirName()) && 121 return (base::CreateDirectory(eula_sentinel.DirName()) &&
122 file_util::WriteFile(eula_sentinel, "", 0) != -1); 122 base::WriteFile(eula_sentinel, "", 0) != -1);
123 } 123 }
124 124
125 } // namespace 125 } // namespace
126 126
127 namespace first_run { 127 namespace first_run {
128 namespace internal { 128 namespace internal {
129 129
130 void DoPostImportPlatformSpecificTasks(Profile* /* profile */) { 130 void DoPostImportPlatformSpecificTasks(Profile* /* profile */) {
131 // Trigger the Active Setup command for system-level Chromes to finish 131 // Trigger the Active Setup command for system-level Chromes to finish
132 // configuring this user's install (e.g. per-user shortcuts). 132 // configuring this user's install (e.g. per-user shortcuts).
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after
196 base::FilePath MasterPrefsPath() { 196 base::FilePath MasterPrefsPath() {
197 // The standard location of the master prefs is next to the chrome binary. 197 // The standard location of the master prefs is next to the chrome binary.
198 base::FilePath master_prefs; 198 base::FilePath master_prefs;
199 if (!PathService::Get(base::DIR_EXE, &master_prefs)) 199 if (!PathService::Get(base::DIR_EXE, &master_prefs))
200 return base::FilePath(); 200 return base::FilePath();
201 return master_prefs.AppendASCII(installer::kDefaultMasterPrefs); 201 return master_prefs.AppendASCII(installer::kDefaultMasterPrefs);
202 } 202 }
203 203
204 } // namespace internal 204 } // namespace internal
205 } // namespace first_run 205 } // namespace first_run
OLDNEW
« no previous file with comments | « chrome/browser/first_run/first_run_browsertest.cc ('k') | chrome/browser/google/google_update_settings_posix.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698