OLD | NEW |
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/mobile_config.h" | 5 #include "chrome/browser/chromeos/mobile_config.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 | 8 |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/files/file_path.h" | 10 #include "base/files/file_path.h" |
(...skipping 337 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
348 local_config_root_.reset(NULL); | 348 local_config_root_.reset(NULL); |
349 } else { | 349 } else { |
350 local_config_root_.reset(root_.release()); | 350 local_config_root_.reset(root_.release()); |
351 root_.reset(global_config_root.release()); | 351 root_.reset(global_config_root.release()); |
352 } | 352 } |
353 } | 353 } |
354 | 354 |
355 void MobileConfig::ReadConfigInBackground( | 355 void MobileConfig::ReadConfigInBackground( |
356 const base::FilePath& global_config_file, | 356 const base::FilePath& global_config_file, |
357 const base::FilePath& local_config_file) { | 357 const base::FilePath& local_config_file) { |
358 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::FILE)); | 358 DCHECK_CURRENTLY_ON(BrowserThread::FILE); |
359 std::string global_config; | 359 std::string global_config; |
360 std::string local_config; | 360 std::string local_config; |
361 if (!base::ReadFileToString(global_config_file, &global_config)) { | 361 if (!base::ReadFileToString(global_config_file, &global_config)) { |
362 VLOG(1) << "Failed to load global mobile config from: " | 362 VLOG(1) << "Failed to load global mobile config from: " |
363 << global_config_file.value(); | 363 << global_config_file.value(); |
364 } | 364 } |
365 if (!base::ReadFileToString(local_config_file, &local_config)) { | 365 if (!base::ReadFileToString(local_config_file, &local_config)) { |
366 VLOG(1) << "Failed to load local mobile config from: " | 366 VLOG(1) << "Failed to load local mobile config from: " |
367 << local_config_file.value(); | 367 << local_config_file.value(); |
368 } | 368 } |
369 BrowserThread::PostTask(BrowserThread::UI, FROM_HERE, | 369 BrowserThread::PostTask(BrowserThread::UI, FROM_HERE, |
370 base::Bind(&MobileConfig::ProcessConfig, | 370 base::Bind(&MobileConfig::ProcessConfig, |
371 base::Unretained(this), // singleton. | 371 base::Unretained(this), // singleton. |
372 global_config, | 372 global_config, |
373 local_config)); | 373 local_config)); |
374 } | 374 } |
375 | 375 |
376 } // namespace chromeos | 376 } // namespace chromeos |
OLD | NEW |