| 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 1653 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1664 SessionService* session_service = profile_->GetSessionService(); | 1664 SessionService* session_service = profile_->GetSessionService(); |
| 1665 if (session_service && !tabstrip_model_.closing_all()) { | 1665 if (session_service && !tabstrip_model_.closing_all()) { |
| 1666 session_service->SetSelectedTabInWindow( | 1666 session_service->SetSelectedTabInWindow( |
| 1667 session_id(), tabstrip_model_.selected_index()); | 1667 session_id(), tabstrip_model_.selected_index()); |
| 1668 } | 1668 } |
| 1669 } | 1669 } |
| 1670 } | 1670 } |
| 1671 | 1671 |
| 1672 void Browser::TabMoved(TabContents* contents, | 1672 void Browser::TabMoved(TabContents* contents, |
| 1673 int from_index, | 1673 int from_index, |
| 1674 int to_index) { | 1674 int to_index, |
| 1675 bool pinned_state_changed) { |
| 1675 DCHECK(from_index >= 0 && to_index >= 0); | 1676 DCHECK(from_index >= 0 && to_index >= 0); |
| 1676 // Notify the history service. | 1677 // Notify the history service. |
| 1677 SyncHistoryWithTabs(std::min(from_index, to_index)); | 1678 SyncHistoryWithTabs(std::min(from_index, to_index)); |
| 1678 } | 1679 } |
| 1679 | 1680 |
| 1680 void Browser::TabStripEmpty() { | 1681 void Browser::TabStripEmpty() { |
| 1681 // Close the frame after we return to the message loop (not immediately, | 1682 // Close the frame after we return to the message loop (not immediately, |
| 1682 // otherwise it will destroy this object before the stack has a chance to | 1683 // otherwise it will destroy this object before the stack has a chance to |
| 1683 // cleanly unwind.) | 1684 // cleanly unwind.) |
| 1684 // Note: This will be called several times if TabStripEmpty is called several | 1685 // Note: This will be called several times if TabStripEmpty is called several |
| (...skipping 1057 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2742 /////////////////////////////////////////////////////////////////////////////// | 2743 /////////////////////////////////////////////////////////////////////////////// |
| 2743 // BrowserToolbarModel (private): | 2744 // BrowserToolbarModel (private): |
| 2744 | 2745 |
| 2745 NavigationController* Browser::BrowserToolbarModel::GetNavigationController() { | 2746 NavigationController* Browser::BrowserToolbarModel::GetNavigationController() { |
| 2746 // This |current_tab| can be NULL during the initialization of the | 2747 // This |current_tab| can be NULL during the initialization of the |
| 2747 // toolbar during window creation (i.e. before any tabs have been added | 2748 // toolbar during window creation (i.e. before any tabs have been added |
| 2748 // to the window). | 2749 // to the window). |
| 2749 TabContents* current_tab = browser_->GetSelectedTabContents(); | 2750 TabContents* current_tab = browser_->GetSelectedTabContents(); |
| 2750 return current_tab ? ¤t_tab->controller() : NULL; | 2751 return current_tab ? ¤t_tab->controller() : NULL; |
| 2751 } | 2752 } |
| OLD | NEW |