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( | 134 service->CreateHistoricalTab(contents->web_contents(), |
135 &contents->web_contents()->GetController(), | |
136 browser_->tab_strip_model()->GetIndexOfTabContents(contents)); | 135 browser_->tab_strip_model()->GetIndexOfTabContents(contents)); |
137 } | 136 } |
138 } | 137 } |
139 | 138 |
140 bool BrowserTabStripModelDelegate::RunUnloadListenerBeforeClosing( | 139 bool BrowserTabStripModelDelegate::RunUnloadListenerBeforeClosing( |
141 TabContents* contents) { | 140 TabContents* contents) { |
142 return Browser::RunUnloadEventsHelper(contents->web_contents()); | 141 return Browser::RunUnloadEventsHelper(contents->web_contents()); |
143 } | 142 } |
144 | 143 |
145 bool BrowserTabStripModelDelegate::CanBookmarkAllTabs() const { | 144 bool BrowserTabStripModelDelegate::CanBookmarkAllTabs() const { |
(...skipping 13 matching lines...) Expand all Loading... |
159 } | 158 } |
160 | 159 |
161 //////////////////////////////////////////////////////////////////////////////// | 160 //////////////////////////////////////////////////////////////////////////////// |
162 // BrowserTabStripModelDelegate, private: | 161 // BrowserTabStripModelDelegate, private: |
163 | 162 |
164 void BrowserTabStripModelDelegate::CloseFrame() { | 163 void BrowserTabStripModelDelegate::CloseFrame() { |
165 browser_->window()->Close(); | 164 browser_->window()->Close(); |
166 } | 165 } |
167 | 166 |
168 } // namespace chrome | 167 } // namespace chrome |
OLD | NEW |