| 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 "base/basictypes.h" | 5 #include "base/basictypes.h" |
| 6 #include "base/bind.h" | 6 #include "base/bind.h" |
| 7 #include "base/file_util.h" | 7 #include "base/file_util.h" |
| 8 #include "base/files/file_path.h" | 8 #include "base/files/file_path.h" |
| 9 #include "base/logging.h" | 9 #include "base/logging.h" |
| 10 #include "base/prefs/pref_service.h" | 10 #include "base/prefs/pref_service.h" |
| 11 #include "base/strings/string_util.h" | 11 #include "base/strings/string_util.h" |
| 12 #include "base/task_runner_util.h" | 12 #include "base/task_runner_util.h" |
| 13 #include "base/threading/worker_pool.h" | 13 #include "base/threading/worker_pool.h" |
| 14 #include "chrome/browser/browser_process.h" | 14 #include "chrome/browser/browser_process.h" |
| 15 #include "chrome/common/pref_names.h" | 15 #include "chrome/common/pref_names.h" |
| 16 #include "chromeos/system/statistics_provider.h" | 16 #include "chromeos/system/statistics_provider.h" |
| 17 #include "content/public/browser/browser_thread.h" | 17 #include "content/public/browser/browser_thread.h" |
| 18 | 18 |
| 19 namespace google_util { | 19 namespace google_brand { |
| 20 namespace chromeos { | 20 namespace chromeos { |
| 21 | 21 |
| 22 namespace { | 22 namespace { |
| 23 | 23 |
| 24 // Path to file that stores the RLZ brand code on ChromeOS. | 24 // Path to file that stores the RLZ brand code on ChromeOS. |
| 25 const base::FilePath::CharType kRLZBrandFilePath[] = | 25 const base::FilePath::CharType kRLZBrandFilePath[] = |
| 26 FILE_PATH_LITERAL("/opt/oem/etc/BRAND_CODE"); | 26 FILE_PATH_LITERAL("/opt/oem/etc/BRAND_CODE"); |
| 27 | 27 |
| 28 // Reads the brand code from file |kRLZBrandFilePath|. | 28 // Reads the brand code from file |kRLZBrandFilePath|. |
| 29 std::string ReadBrandFromFile() { | 29 std::string ReadBrandFromFile() { |
| (...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 75 } | 75 } |
| 76 | 76 |
| 77 base::PostTaskAndReplyWithResult( | 77 base::PostTaskAndReplyWithResult( |
| 78 base::WorkerPool::GetTaskRunner(false /* task_is_slow */).get(), | 78 base::WorkerPool::GetTaskRunner(false /* task_is_slow */).get(), |
| 79 FROM_HERE, | 79 FROM_HERE, |
| 80 base::Bind(&ReadBrandFromFile), | 80 base::Bind(&ReadBrandFromFile), |
| 81 base::Bind(&SetBrand, callback)); | 81 base::Bind(&SetBrand, callback)); |
| 82 } | 82 } |
| 83 | 83 |
| 84 } // namespace chromeos | 84 } // namespace chromeos |
| 85 } // namespace google_util | 85 } // namespace google_brand |
| OLD | NEW |