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/message_loop/message_loop.h" | 7 #include "base/location.h" |
| 8 #include "base/single_thread_task_runner.h" |
| 9 #include "base/thread_task_runner_handle.h" |
8 #include "chrome/browser/chrome_notification_types.h" | 10 #include "chrome/browser/chrome_notification_types.h" |
9 #include "chrome/browser/devtools/devtools_window.h" | 11 #include "chrome/browser/devtools/devtools_window.h" |
10 #include "chrome/browser/ui/browser.h" | 12 #include "chrome/browser/ui/browser.h" |
11 #include "chrome/browser/ui/browser_tabstrip.h" | 13 #include "chrome/browser/ui/browser_tabstrip.h" |
12 #include "chrome/browser/ui/tabs/tab_strip_model.h" | 14 #include "chrome/browser/ui/tabs/tab_strip_model.h" |
13 #include "content/public/browser/notification_service.h" | 15 #include "content/public/browser/notification_service.h" |
14 #include "content/public/browser/notification_source.h" | 16 #include "content/public/browser/notification_source.h" |
15 #include "content/public/browser/notification_types.h" | 17 #include "content/public/browser/notification_types.h" |
16 #include "content/public/browser/render_view_host.h" | 18 #include "content/public/browser/render_view_host.h" |
17 #include "content/public/browser/web_contents.h" | 19 #include "content/public/browser/web_contents.h" |
(...skipping 331 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
349 } | 351 } |
350 | 352 |
351 void UnloadController::ClearUnloadState(content::WebContents* web_contents, | 353 void UnloadController::ClearUnloadState(content::WebContents* web_contents, |
352 bool process_now) { | 354 bool process_now) { |
353 if (is_attempting_to_close_browser_) { | 355 if (is_attempting_to_close_browser_) { |
354 RemoveFromSet(&tabs_needing_before_unload_fired_, web_contents); | 356 RemoveFromSet(&tabs_needing_before_unload_fired_, web_contents); |
355 RemoveFromSet(&tabs_needing_unload_fired_, web_contents); | 357 RemoveFromSet(&tabs_needing_unload_fired_, web_contents); |
356 if (process_now) { | 358 if (process_now) { |
357 ProcessPendingTabs(); | 359 ProcessPendingTabs(); |
358 } else { | 360 } else { |
359 base::MessageLoop::current()->PostTask( | 361 base::ThreadTaskRunnerHandle::Get()->PostTask( |
360 FROM_HERE, | 362 FROM_HERE, base::Bind(&UnloadController::ProcessPendingTabs, |
361 base::Bind(&UnloadController::ProcessPendingTabs, | 363 weak_factory_.GetWeakPtr())); |
362 weak_factory_.GetWeakPtr())); | |
363 } | 364 } |
364 } | 365 } |
365 } | 366 } |
366 | 367 |
367 } // namespace chrome | 368 } // namespace chrome |
OLD | NEW |