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/browser_tab_strip_model_delegate.h" | 5 #include "chrome/browser/ui/browser_tab_strip_model_delegate.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/message_loop.h" | 8 #include "base/message_loop.h" |
9 #include "chrome/browser/profiles/profile.h" | 9 #include "chrome/browser/profiles/profile.h" |
10 #include "chrome/browser/sessions/tab_restore_service.h" | 10 #include "chrome/browser/sessions/tab_restore_service.h" |
(...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
124 | 124 |
125 // We don't create historical tabs for print preview tabs. | 125 // We don't create historical tabs for print preview tabs. |
126 if (contents->web_contents()->GetURL() == GURL(kChromeUIPrintURL)) | 126 if (contents->web_contents()->GetURL() == GURL(kChromeUIPrintURL)) |
127 return; | 127 return; |
128 | 128 |
129 TabRestoreService* service = | 129 TabRestoreService* service = |
130 TabRestoreServiceFactory::GetForProfile(browser_->profile()); | 130 TabRestoreServiceFactory::GetForProfile(browser_->profile()); |
131 | 131 |
132 // We only create historical tab entries for tabbed browser windows. | 132 // We only create historical tab entries for tabbed browser windows. |
133 if (service && browser_->CanSupportWindowFeature(Browser::FEATURE_TABSTRIP)) { | 133 if (service && browser_->CanSupportWindowFeature(Browser::FEATURE_TABSTRIP)) { |
134 service->CreateHistoricalTab(contents->web_contents(), | 134 service->CreateHistoricalTab( |
| 135 &contents->web_contents()->GetController(), |
135 browser_->tab_strip_model()->GetIndexOfTabContents(contents)); | 136 browser_->tab_strip_model()->GetIndexOfTabContents(contents)); |
136 } | 137 } |
137 } | 138 } |
138 | 139 |
139 bool BrowserTabStripModelDelegate::RunUnloadListenerBeforeClosing( | 140 bool BrowserTabStripModelDelegate::RunUnloadListenerBeforeClosing( |
140 TabContents* contents) { | 141 TabContents* contents) { |
141 return Browser::RunUnloadEventsHelper(contents->web_contents()); | 142 return Browser::RunUnloadEventsHelper(contents->web_contents()); |
142 } | 143 } |
143 | 144 |
144 bool BrowserTabStripModelDelegate::CanBookmarkAllTabs() const { | 145 bool BrowserTabStripModelDelegate::CanBookmarkAllTabs() const { |
(...skipping 13 matching lines...) Expand all Loading... |
158 } | 159 } |
159 | 160 |
160 //////////////////////////////////////////////////////////////////////////////// | 161 //////////////////////////////////////////////////////////////////////////////// |
161 // BrowserTabStripModelDelegate, private: | 162 // BrowserTabStripModelDelegate, private: |
162 | 163 |
163 void BrowserTabStripModelDelegate::CloseFrame() { | 164 void BrowserTabStripModelDelegate::CloseFrame() { |
164 browser_->window()->Close(); | 165 browser_->window()->Close(); |
165 } | 166 } |
166 | 167 |
167 } // namespace chrome | 168 } // namespace chrome |
OLD | NEW |