| OLD | NEW |
| 1 // Copyright (c) 2006-2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2009 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/browser.h" | 5 #include "chrome/browser/browser.h" |
| 6 | 6 |
| 7 #include "app/animation.h" | 7 #include "app/animation.h" |
| 8 #include "app/l10n_util.h" | 8 #include "app/l10n_util.h" |
| 9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
| 10 #include "base/idle_timer.h" | 10 #include "base/idle_timer.h" |
| (...skipping 2469 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2480 // TODO(ojan): We should add a call to browser_shutdown::OnShutdownStarting | 2480 // TODO(ojan): We should add a call to browser_shutdown::OnShutdownStarting |
| 2481 // somewhere around here so that we have accurate measurements of shutdown | 2481 // somewhere around here so that we have accurate measurements of shutdown |
| 2482 // time. | 2482 // time. |
| 2483 // TODO(ojan): We can probably fire all the unload events in parallel and | 2483 // TODO(ojan): We can probably fire all the unload events in parallel and |
| 2484 // get a perf benefit from that in the cases where the tab hangs in it's | 2484 // get a perf benefit from that in the cases where the tab hangs in it's |
| 2485 // unload handler or takes a long time to page in. | 2485 // unload handler or takes a long time to page in. |
| 2486 TabContents* tab = *(tabs_needing_unload_fired_.begin()); | 2486 TabContents* tab = *(tabs_needing_unload_fired_.begin()); |
| 2487 // Null check render_view_host here as this gets called on a PostTask and | 2487 // Null check render_view_host here as this gets called on a PostTask and |
| 2488 // the tab's render_view_host may have been nulled out. | 2488 // the tab's render_view_host may have been nulled out. |
| 2489 if (tab->render_view_host()) { | 2489 if (tab->render_view_host()) { |
| 2490 tab->render_view_host()->FirePageUnload(); | 2490 tab->render_view_host()->ClosePage(false, -1, -1); |
| 2491 } else { | 2491 } else { |
| 2492 ClearUnloadState(tab); | 2492 ClearUnloadState(tab); |
| 2493 } | 2493 } |
| 2494 } else { | 2494 } else { |
| 2495 NOTREACHED(); | 2495 NOTREACHED(); |
| 2496 } | 2496 } |
| 2497 } | 2497 } |
| 2498 | 2498 |
| 2499 bool Browser::HasCompletedUnloadProcessing() const { | 2499 bool Browser::HasCompletedUnloadProcessing() const { |
| 2500 return is_attempting_to_close_browser_ && | 2500 return is_attempting_to_close_browser_ && |
| (...skipping 269 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2770 /////////////////////////////////////////////////////////////////////////////// | 2770 /////////////////////////////////////////////////////////////////////////////// |
| 2771 // BrowserToolbarModel (private): | 2771 // BrowserToolbarModel (private): |
| 2772 | 2772 |
| 2773 NavigationController* Browser::BrowserToolbarModel::GetNavigationController() { | 2773 NavigationController* Browser::BrowserToolbarModel::GetNavigationController() { |
| 2774 // This |current_tab| can be NULL during the initialization of the | 2774 // This |current_tab| can be NULL during the initialization of the |
| 2775 // toolbar during window creation (i.e. before any tabs have been added | 2775 // toolbar during window creation (i.e. before any tabs have been added |
| 2776 // to the window). | 2776 // to the window). |
| 2777 TabContents* current_tab = browser_->GetSelectedTabContents(); | 2777 TabContents* current_tab = browser_->GetSelectedTabContents(); |
| 2778 return current_tab ? ¤t_tab->controller() : NULL; | 2778 return current_tab ? ¤t_tab->controller() : NULL; |
| 2779 } | 2779 } |
| OLD | NEW |