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 2553 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2564 DCHECK(selected_navigation >= 0 && | 2564 DCHECK(selected_navigation >= 0 && |
2565 selected_navigation < static_cast<int>(navigations.size())); | 2565 selected_navigation < static_cast<int>(navigations.size())); |
2566 // Create a NavigationController. This constructor creates the appropriate | 2566 // Create a NavigationController. This constructor creates the appropriate |
2567 // set of TabContents. | 2567 // set of TabContents. |
2568 TabContents* new_tab = new TabContents(profile_, NULL, | 2568 TabContents* new_tab = new TabContents(profile_, NULL, |
2569 MSG_ROUTING_NONE, NULL); | 2569 MSG_ROUTING_NONE, NULL); |
2570 new_tab->controller().RestoreFromState(navigations, selected_navigation); | 2570 new_tab->controller().RestoreFromState(navigations, selected_navigation); |
2571 return new_tab; | 2571 return new_tab; |
2572 } else { | 2572 } else { |
2573 // No navigations. Create a tab with about:blank. | 2573 // No navigations. Create a tab with about:blank. |
2574 return CreateTabContentsForURL(GURL("about:blank"), GURL(), profile_, | 2574 return CreateTabContentsForURL(GURL(chrome::kAboutBlankURL), GURL(), |
2575 PageTransition::START_PAGE, false, NULL); | 2575 profile_, PageTransition::START_PAGE, |
| 2576 false, NULL); |
2576 } | 2577 } |
2577 } | 2578 } |
2578 | 2579 |
2579 /////////////////////////////////////////////////////////////////////////////// | 2580 /////////////////////////////////////////////////////////////////////////////// |
2580 // Browser, OnBeforeUnload handling (private): | 2581 // Browser, OnBeforeUnload handling (private): |
2581 | 2582 |
2582 void Browser::ProcessPendingTabs() { | 2583 void Browser::ProcessPendingTabs() { |
2583 DCHECK(is_attempting_to_close_browser_); | 2584 DCHECK(is_attempting_to_close_browser_); |
2584 | 2585 |
2585 if (HasCompletedUnloadProcessing()) { | 2586 if (HasCompletedUnloadProcessing()) { |
(...skipping 312 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2898 /////////////////////////////////////////////////////////////////////////////// | 2899 /////////////////////////////////////////////////////////////////////////////// |
2899 // BrowserToolbarModel (private): | 2900 // BrowserToolbarModel (private): |
2900 | 2901 |
2901 NavigationController* Browser::BrowserToolbarModel::GetNavigationController() { | 2902 NavigationController* Browser::BrowserToolbarModel::GetNavigationController() { |
2902 // This |current_tab| can be NULL during the initialization of the | 2903 // This |current_tab| can be NULL during the initialization of the |
2903 // toolbar during window creation (i.e. before any tabs have been added | 2904 // toolbar during window creation (i.e. before any tabs have been added |
2904 // to the window). | 2905 // to the window). |
2905 TabContents* current_tab = browser_->GetSelectedTabContents(); | 2906 TabContents* current_tab = browser_->GetSelectedTabContents(); |
2906 return current_tab ? ¤t_tab->controller() : NULL; | 2907 return current_tab ? ¤t_tab->controller() : NULL; |
2907 } | 2908 } |
OLD | NEW |