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/ui/unload_controller.h" | 5 #include "chrome/browser/ui/unload_controller.h" |
6 | 6 |
7 #include "base/location.h" | 7 #include "base/location.h" |
8 #include "base/single_thread_task_runner.h" | 8 #include "base/single_thread_task_runner.h" |
9 #include "base/threading/thread_task_runner_handle.h" | 9 #include "base/threading/thread_task_runner_handle.h" |
10 #include "chrome/browser/chrome_notification_types.h" | 10 #include "chrome/browser/chrome_notification_types.h" |
(...skipping 376 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
387 if (is_attempting_to_close_browser_) { | 387 if (is_attempting_to_close_browser_) { |
388 RemoveFromSet(&tabs_needing_before_unload_fired_, web_contents); | 388 RemoveFromSet(&tabs_needing_before_unload_fired_, web_contents); |
389 RemoveFromSet(&tabs_needing_unload_fired_, web_contents); | 389 RemoveFromSet(&tabs_needing_unload_fired_, web_contents); |
390 if (process_now) { | 390 if (process_now) { |
391 ProcessPendingTabs(false); | 391 ProcessPendingTabs(false); |
392 } else { | 392 } else { |
393 // Do not post a new task if there is already any. | 393 // Do not post a new task if there is already any. |
394 if (weak_factory_.HasWeakPtrs()) | 394 if (weak_factory_.HasWeakPtrs()) |
395 return; | 395 return; |
396 base::ThreadTaskRunnerHandle::Get()->PostTask( | 396 base::ThreadTaskRunnerHandle::Get()->PostTask( |
397 FROM_HERE, base::Bind(&UnloadController::ProcessPendingTabs, | 397 FROM_HERE, base::BindOnce(&UnloadController::ProcessPendingTabs, |
398 weak_factory_.GetWeakPtr(), false)); | 398 weak_factory_.GetWeakPtr(), false)); |
399 } | 399 } |
400 } | 400 } |
401 } | 401 } |
402 | 402 |
403 } // namespace chrome | 403 } // namespace chrome |
OLD | NEW |