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

Side by Side Diff: chrome/installer/util/master_preferences.cc

Issue 18286004: Move PathExists to base namespace. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 5 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/installer/util/master_preferences.h" 5 #include "chrome/installer/util/master_preferences.h"
6 6
7 #include "base/environment.h" 7 #include "base/environment.h"
8 #include "base/file_util.h" 8 #include "base/file_util.h"
9 #include "base/json/json_string_value_serializer.h" 9 #include "base/json/json_string_value_serializer.h"
10 #include "base/lazy_instance.h" 10 #include "base/lazy_instance.h"
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after
94 : distribution_(NULL), 94 : distribution_(NULL),
95 preferences_read_from_file_(false), 95 preferences_read_from_file_(false),
96 chrome_(true), 96 chrome_(true),
97 chrome_app_launcher_(false), 97 chrome_app_launcher_(false),
98 chrome_frame_(false), 98 chrome_frame_(false),
99 multi_install_(false) { 99 multi_install_(false) {
100 std::string json_data; 100 std::string json_data;
101 // Failure to read the file is ignored as |json_data| will be the empty string 101 // Failure to read the file is ignored as |json_data| will be the empty string
102 // and the remainder of this MasterPreferences object should still be 102 // and the remainder of this MasterPreferences object should still be
103 // initialized as best as possible. 103 // initialized as best as possible.
104 if (file_util::PathExists(prefs_path) && 104 if (base::PathExists(prefs_path) &&
105 !file_util::ReadFileToString(prefs_path, &json_data)) { 105 !file_util::ReadFileToString(prefs_path, &json_data)) {
106 LOG(ERROR) << "Failed to read preferences from " << prefs_path.value(); 106 LOG(ERROR) << "Failed to read preferences from " << prefs_path.value();
107 } 107 }
108 if (InitializeFromString(json_data)) 108 if (InitializeFromString(json_data))
109 preferences_read_from_file_ = true; 109 preferences_read_from_file_ = true;
110 } 110 }
111 111
112 MasterPreferences::MasterPreferences(const std::string& prefs) 112 MasterPreferences::MasterPreferences(const std::string& prefs)
113 : distribution_(NULL), 113 : distribution_(NULL),
114 preferences_read_from_file_(false), 114 preferences_read_from_file_(false),
(...skipping 202 matching lines...) Expand 10 before | Expand all | Expand 10 after
317 master_dictionary_->GetString(prefs::kVariationsSeed, &variations_seed); 317 master_dictionary_->GetString(prefs::kVariationsSeed, &variations_seed);
318 return variations_seed; 318 return variations_seed;
319 } 319 }
320 320
321 // static 321 // static
322 const MasterPreferences& MasterPreferences::ForCurrentProcess() { 322 const MasterPreferences& MasterPreferences::ForCurrentProcess() {
323 return g_master_preferences.Get(); 323 return g_master_preferences.Get();
324 } 324 }
325 325
326 } // namespace installer 326 } // namespace installer
OLDNEW
« no previous file with comments | « chrome/installer/util/lzma_util_unittest.cc ('k') | chrome/installer/util/move_tree_work_item.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698