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.h" | 7 #include "base/message_loop.h" |
8 #include "chrome/browser/ui/browser.h" | 8 #include "chrome/browser/ui/browser.h" |
9 #include "chrome/browser/ui/browser_tabstrip.h" | 9 #include "chrome/browser/ui/browser_tabstrip.h" |
10 #include "chrome/browser/ui/tabs/tab_strip_model.h" | 10 #include "chrome/browser/ui/tabs/tab_strip_model.h" |
(...skipping 229 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
240 } | 240 } |
241 | 241 |
242 void UnloadController::ClearUnloadState(content::WebContents* web_contents, | 242 void UnloadController::ClearUnloadState(content::WebContents* web_contents, |
243 bool process_now) { | 243 bool process_now) { |
244 if (is_attempting_to_close_browser_) { | 244 if (is_attempting_to_close_browser_) { |
245 RemoveFromSet(&tabs_needing_before_unload_fired_, web_contents); | 245 RemoveFromSet(&tabs_needing_before_unload_fired_, web_contents); |
246 RemoveFromSet(&tabs_needing_unload_fired_, web_contents); | 246 RemoveFromSet(&tabs_needing_unload_fired_, web_contents); |
247 if (process_now) { | 247 if (process_now) { |
248 ProcessPendingTabs(); | 248 ProcessPendingTabs(); |
249 } else { | 249 } else { |
250 MessageLoop::current()->PostTask( | 250 base::MessageLoop::current()->PostTask( |
251 FROM_HERE, | 251 FROM_HERE, |
252 base::Bind(&UnloadController::ProcessPendingTabs, | 252 base::Bind(&UnloadController::ProcessPendingTabs, |
253 weak_factory_.GetWeakPtr())); | 253 weak_factory_.GetWeakPtr())); |
254 } | 254 } |
255 } | 255 } |
256 } | 256 } |
257 | 257 |
258 } // namespace chrome | 258 } // namespace chrome |
OLD | NEW |