| 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/extensions/default_app_order.h" | 5 #include "chrome/browser/chromeos/extensions/default_app_order.h" |
| 6 | 6 |
| 7 #include <utility> | 7 #include <utility> |
| 8 | 8 |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/bind_helpers.h" | 10 #include "base/bind_helpers.h" |
| (...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 114 void GetDefault(std::vector<std::string>* app_ids) { | 114 void GetDefault(std::vector<std::string>* app_ids) { |
| 115 for (size_t i = 0; i < arraysize(kDefaultAppOrder); ++i) | 115 for (size_t i = 0; i < arraysize(kDefaultAppOrder); ++i) |
| 116 app_ids->push_back(std::string(kDefaultAppOrder[i])); | 116 app_ids->push_back(std::string(kDefaultAppOrder[i])); |
| 117 } | 117 } |
| 118 | 118 |
| 119 } // namespace | 119 } // namespace |
| 120 | 120 |
| 121 const size_t kDefaultAppOrderCount = arraysize(kDefaultAppOrder); | 121 const size_t kDefaultAppOrderCount = arraysize(kDefaultAppOrder); |
| 122 | 122 |
| 123 ExternalLoader::ExternalLoader(bool async) | 123 ExternalLoader::ExternalLoader(bool async) |
| 124 : loaded_(true /* manual_rest */, false /* initially_signaled */) { | 124 : loaded_(base::WaitableEvent::ResetPolicy::MANUAL, |
| 125 base::WaitableEvent::InitialState::NOT_SIGNALED) { |
| 125 DCHECK(!loader_instance); | 126 DCHECK(!loader_instance); |
| 126 loader_instance = this; | 127 loader_instance = this; |
| 127 | 128 |
| 128 if (async) { | 129 if (async) { |
| 129 content::BrowserThread::PostBlockingPoolTask(FROM_HERE, | 130 content::BrowserThread::PostBlockingPoolTask(FROM_HERE, |
| 130 base::Bind(&ExternalLoader::Load, base::Unretained(this))); | 131 base::Bind(&ExternalLoader::Load, base::Unretained(this))); |
| 131 } else { | 132 } else { |
| 132 Load(); | 133 Load(); |
| 133 } | 134 } |
| 134 } | 135 } |
| (...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 198 std::string GetOemAppsFolderName() { | 199 std::string GetOemAppsFolderName() { |
| 199 // |loader_instance| could be NULL for test. | 200 // |loader_instance| could be NULL for test. |
| 200 if (!loader_instance) | 201 if (!loader_instance) |
| 201 return std::string(); | 202 return std::string(); |
| 202 else | 203 else |
| 203 return loader_instance->GetOemAppsFolderName(); | 204 return loader_instance->GetOemAppsFolderName(); |
| 204 } | 205 } |
| 205 | 206 |
| 206 } // namespace default_app_order | 207 } // namespace default_app_order |
| 207 } // namespace chromeos | 208 } // namespace chromeos |
| OLD | NEW |