| 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 2466 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2477 // TODO(ojan): We should add a call to browser_shutdown::OnShutdownStarting | 2477 // TODO(ojan): We should add a call to browser_shutdown::OnShutdownStarting |
| 2478 // somewhere around here so that we have accurate measurements of shutdown | 2478 // somewhere around here so that we have accurate measurements of shutdown |
| 2479 // time. | 2479 // time. |
| 2480 // TODO(ojan): We can probably fire all the unload events in parallel and | 2480 // TODO(ojan): We can probably fire all the unload events in parallel and |
| 2481 // get a perf benefit from that in the cases where the tab hangs in it's | 2481 // get a perf benefit from that in the cases where the tab hangs in it's |
| 2482 // unload handler or takes a long time to page in. | 2482 // unload handler or takes a long time to page in. |
| 2483 TabContents* tab = *(tabs_needing_unload_fired_.begin()); | 2483 TabContents* tab = *(tabs_needing_unload_fired_.begin()); |
| 2484 // Null check render_view_host here as this gets called on a PostTask and | 2484 // Null check render_view_host here as this gets called on a PostTask and |
| 2485 // the tab's render_view_host may have been nulled out. | 2485 // the tab's render_view_host may have been nulled out. |
| 2486 if (tab->render_view_host()) { | 2486 if (tab->render_view_host()) { |
| 2487 tab->render_view_host()->FirePageUnload(); | 2487 tab->render_view_host()->ClosePage(false, -1, -1); |
| 2488 } else { | 2488 } else { |
| 2489 ClearUnloadState(tab); | 2489 ClearUnloadState(tab); |
| 2490 } | 2490 } |
| 2491 } else { | 2491 } else { |
| 2492 NOTREACHED(); | 2492 NOTREACHED(); |
| 2493 } | 2493 } |
| 2494 } | 2494 } |
| 2495 | 2495 |
| 2496 bool Browser::HasCompletedUnloadProcessing() const { | 2496 bool Browser::HasCompletedUnloadProcessing() const { |
| 2497 return is_attempting_to_close_browser_ && | 2497 return is_attempting_to_close_browser_ && |
| (...skipping 269 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2767 /////////////////////////////////////////////////////////////////////////////// | 2767 /////////////////////////////////////////////////////////////////////////////// |
| 2768 // BrowserToolbarModel (private): | 2768 // BrowserToolbarModel (private): |
| 2769 | 2769 |
| 2770 NavigationController* Browser::BrowserToolbarModel::GetNavigationController() { | 2770 NavigationController* Browser::BrowserToolbarModel::GetNavigationController() { |
| 2771 // This |current_tab| can be NULL during the initialization of the | 2771 // This |current_tab| can be NULL during the initialization of the |
| 2772 // toolbar during window creation (i.e. before any tabs have been added | 2772 // toolbar during window creation (i.e. before any tabs have been added |
| 2773 // to the window). | 2773 // to the window). |
| 2774 TabContents* current_tab = browser_->GetSelectedTabContents(); | 2774 TabContents* current_tab = browser_->GetSelectedTabContents(); |
| 2775 return current_tab ? ¤t_tab->controller() : NULL; | 2775 return current_tab ? ¤t_tab->controller() : NULL; |
| 2776 } | 2776 } |
| OLD | NEW |