OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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/extensions/api/developer_private/extension_info_generat
or.h" | 5 #include "chrome/browser/extensions/api/developer_private/extension_info_generat
or.h" |
6 | 6 |
7 #include <string> | 7 #include <string> |
8 #include <utility> | 8 #include <utility> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 242 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
253 state = developer::EXTENSION_STATE_DISABLED; | 253 state = developer::EXTENSION_STATE_DISABLED; |
254 else if ((ext = registry->terminated_extensions().GetByID(id)) != nullptr) | 254 else if ((ext = registry->terminated_extensions().GetByID(id)) != nullptr) |
255 state = developer::EXTENSION_STATE_TERMINATED; | 255 state = developer::EXTENSION_STATE_TERMINATED; |
256 | 256 |
257 if (ext && ui_util::ShouldDisplayInExtensionSettings(ext, browser_context_)) | 257 if (ext && ui_util::ShouldDisplayInExtensionSettings(ext, browser_context_)) |
258 CreateExtensionInfoHelper(*ext, state); | 258 CreateExtensionInfoHelper(*ext, state); |
259 | 259 |
260 if (pending_image_loads_ == 0) { | 260 if (pending_image_loads_ == 0) { |
261 // Don't call the callback re-entrantly. | 261 // Don't call the callback re-entrantly. |
262 base::ThreadTaskRunnerHandle::Get()->PostTask( | 262 base::ThreadTaskRunnerHandle::Get()->PostTask( |
263 FROM_HERE, base::Bind(callback, base::Passed(&list_))); | 263 FROM_HERE, base::BindOnce(callback, base::Passed(&list_))); |
264 list_.clear(); | 264 list_.clear(); |
265 } else { | 265 } else { |
266 callback_ = callback; | 266 callback_ = callback; |
267 } | 267 } |
268 } | 268 } |
269 | 269 |
270 void ExtensionInfoGenerator::CreateExtensionsInfo( | 270 void ExtensionInfoGenerator::CreateExtensionsInfo( |
271 bool include_disabled, | 271 bool include_disabled, |
272 bool include_terminated, | 272 bool include_terminated, |
273 const ExtensionInfosCallback& callback) { | 273 const ExtensionInfosCallback& callback) { |
(...skipping 17 matching lines...) Expand all Loading... |
291 developer::EXTENSION_STATE_BLACKLISTED); | 291 developer::EXTENSION_STATE_BLACKLISTED); |
292 } | 292 } |
293 if (include_terminated) { | 293 if (include_terminated) { |
294 add_to_list(registry->terminated_extensions(), | 294 add_to_list(registry->terminated_extensions(), |
295 developer::EXTENSION_STATE_TERMINATED); | 295 developer::EXTENSION_STATE_TERMINATED); |
296 } | 296 } |
297 | 297 |
298 if (pending_image_loads_ == 0) { | 298 if (pending_image_loads_ == 0) { |
299 // Don't call the callback re-entrantly. | 299 // Don't call the callback re-entrantly. |
300 base::ThreadTaskRunnerHandle::Get()->PostTask( | 300 base::ThreadTaskRunnerHandle::Get()->PostTask( |
301 FROM_HERE, base::Bind(callback, base::Passed(&list_))); | 301 FROM_HERE, base::BindOnce(callback, base::Passed(&list_))); |
302 list_.clear(); | 302 list_.clear(); |
303 } else { | 303 } else { |
304 callback_ = callback; | 304 callback_ = callback; |
305 } | 305 } |
306 } | 306 } |
307 | 307 |
308 void ExtensionInfoGenerator::CreateExtensionInfoHelper( | 308 void ExtensionInfoGenerator::CreateExtensionInfoHelper( |
309 const Extension& extension, | 309 const Extension& extension, |
310 developer::ExtensionState state) { | 310 developer::ExtensionState state) { |
311 std::unique_ptr<developer::ExtensionInfo> info( | 311 std::unique_ptr<developer::ExtensionInfo> info( |
(...skipping 326 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
638 | 638 |
639 if (pending_image_loads_ == 0) { // All done! | 639 if (pending_image_loads_ == 0) { // All done! |
640 ExtensionInfoList list = std::move(list_); | 640 ExtensionInfoList list = std::move(list_); |
641 list_.clear(); | 641 list_.clear(); |
642 base::ResetAndReturn(&callback_).Run(std::move(list)); | 642 base::ResetAndReturn(&callback_).Run(std::move(list)); |
643 // WARNING: |this| is possibly deleted after this line! | 643 // WARNING: |this| is possibly deleted after this line! |
644 } | 644 } |
645 } | 645 } |
646 | 646 |
647 } // namespace extensions | 647 } // namespace extensions |
OLD | NEW |