| 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/command_line.h" | 8 #include "base/command_line.h" |
| 9 #include "base/message_loop/message_loop.h" | 9 #include "base/message_loop/message_loop.h" |
| 10 #include "chrome/browser/profiles/profile.h" | 10 #include "chrome/browser/profiles/profile.h" |
| (...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 106 DuplicateTabAt(browser_, index); | 106 DuplicateTabAt(browser_, index); |
| 107 } | 107 } |
| 108 | 108 |
| 109 void BrowserTabStripModelDelegate::CreateHistoricalTab( | 109 void BrowserTabStripModelDelegate::CreateHistoricalTab( |
| 110 content::WebContents* contents) { | 110 content::WebContents* contents) { |
| 111 // We don't create historical tabs for incognito windows or windows without | 111 // We don't create historical tabs for incognito windows or windows without |
| 112 // profiles. | 112 // profiles. |
| 113 if (!browser_->profile() || browser_->profile()->IsOffTheRecord()) | 113 if (!browser_->profile() || browser_->profile()->IsOffTheRecord()) |
| 114 return; | 114 return; |
| 115 | 115 |
| 116 TabRestoreService* service = | 116 sessions::TabRestoreService* service = |
| 117 TabRestoreServiceFactory::GetForProfile(browser_->profile()); | 117 TabRestoreServiceFactory::GetForProfile(browser_->profile()); |
| 118 | 118 |
| 119 // We only create historical tab entries for tabbed browser windows. | 119 // We only create historical tab entries for tabbed browser windows. |
| 120 if (service && browser_->CanSupportWindowFeature(Browser::FEATURE_TABSTRIP)) { | 120 if (service && browser_->CanSupportWindowFeature(Browser::FEATURE_TABSTRIP)) { |
| 121 service->CreateHistoricalTab( | 121 service->CreateHistoricalTab( |
| 122 sessions::ContentLiveTab::FromWebContents(contents), | 122 sessions::ContentLiveTab::FromWebContents(contents), |
| 123 browser_->tab_strip_model()->GetIndexOfWebContents(contents)); | 123 browser_->tab_strip_model()->GetIndexOfWebContents(contents)); |
| 124 } | 124 } |
| 125 } | 125 } |
| 126 | 126 |
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 160 } | 160 } |
| 161 | 161 |
| 162 //////////////////////////////////////////////////////////////////////////////// | 162 //////////////////////////////////////////////////////////////////////////////// |
| 163 // BrowserTabStripModelDelegate, private: | 163 // BrowserTabStripModelDelegate, private: |
| 164 | 164 |
| 165 void BrowserTabStripModelDelegate::CloseFrame() { | 165 void BrowserTabStripModelDelegate::CloseFrame() { |
| 166 browser_->window()->Close(); | 166 browser_->window()->Close(); |
| 167 } | 167 } |
| 168 | 168 |
| 169 } // namespace chrome | 169 } // namespace chrome |
| OLD | NEW |