| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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/bind.h" | 5 #include "base/bind.h" |
| 6 #include "base/files/file_path.h" | 6 #include "base/files/file_path.h" |
| 7 #include "base/files/file_util.h" | 7 #include "base/files/file_util.h" |
| 8 #include "base/logging.h" | 8 #include "base/logging.h" |
| 9 #include "base/strings/string_util.h" | 9 #include "base/strings/string_util.h" |
| 10 #include "base/task_scheduler/post_task.h" | 10 #include "base/task_scheduler/post_task.h" |
| (...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 68 ::chromeos::system::StatisticsProvider::GetInstance(); | 68 ::chromeos::system::StatisticsProvider::GetInstance(); |
| 69 std::string brand; | 69 std::string brand; |
| 70 const bool found = provider->GetMachineStatistic( | 70 const bool found = provider->GetMachineStatistic( |
| 71 ::chromeos::system::kRlzBrandCodeKey, &brand); | 71 ::chromeos::system::kRlzBrandCodeKey, &brand); |
| 72 if (found && !brand.empty()) { | 72 if (found && !brand.empty()) { |
| 73 SetBrand(callback, brand); | 73 SetBrand(callback, brand); |
| 74 return; | 74 return; |
| 75 } | 75 } |
| 76 | 76 |
| 77 base::PostTaskWithTraitsAndReplyWithResult( | 77 base::PostTaskWithTraitsAndReplyWithResult( |
| 78 FROM_HERE, base::TaskTraits() | 78 FROM_HERE, |
| 79 .WithShutdownBehavior( | 79 {base::MayBlock(), base::TaskPriority::BACKGROUND, |
| 80 base::TaskShutdownBehavior::CONTINUE_ON_SHUTDOWN) | 80 base::TaskShutdownBehavior::CONTINUE_ON_SHUTDOWN}, |
| 81 .WithPriority(base::TaskPriority::BACKGROUND) | |
| 82 .MayBlock(), | |
| 83 base::Bind(&ReadBrandFromFile), base::Bind(&SetBrand, callback)); | 81 base::Bind(&ReadBrandFromFile), base::Bind(&SetBrand, callback)); |
| 84 } | 82 } |
| 85 | 83 |
| 86 } // namespace chromeos | 84 } // namespace chromeos |
| 87 } // namespace google_brand | 85 } // namespace google_brand |
| OLD | NEW |