| 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 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 95 } | 95 } |
| 96 | 96 |
| 97 bool BrowserTabStripModelDelegate::CanDuplicateContentsAt(int index) { | 97 bool BrowserTabStripModelDelegate::CanDuplicateContentsAt(int index) { |
| 98 return CanDuplicateTabAt(browser_, index); | 98 return CanDuplicateTabAt(browser_, index); |
| 99 } | 99 } |
| 100 | 100 |
| 101 void BrowserTabStripModelDelegate::DuplicateContentsAt(int index) { | 101 void BrowserTabStripModelDelegate::DuplicateContentsAt(int index) { |
| 102 DuplicateTabAt(browser_, index); | 102 DuplicateTabAt(browser_, index); |
| 103 } | 103 } |
| 104 | 104 |
| 105 void BrowserTabStripModelDelegate::CloseFrameAfterDragSession() { | |
| 106 #if !defined(OS_MACOSX) | |
| 107 // This is scheduled to run after we return to the message loop because | |
| 108 // otherwise the frame will think the drag session is still active and ignore | |
| 109 // the request. | |
| 110 base::MessageLoop::current()->PostTask( | |
| 111 FROM_HERE, | |
| 112 base::Bind(&BrowserTabStripModelDelegate::CloseFrame, | |
| 113 weak_factory_.GetWeakPtr())); | |
| 114 #endif | |
| 115 } | |
| 116 | |
| 117 void BrowserTabStripModelDelegate::CreateHistoricalTab( | 105 void BrowserTabStripModelDelegate::CreateHistoricalTab( |
| 118 content::WebContents* contents) { | 106 content::WebContents* contents) { |
| 119 // We don't create historical tabs for incognito windows or windows without | 107 // We don't create historical tabs for incognito windows or windows without |
| 120 // profiles. | 108 // profiles. |
| 121 if (!browser_->profile() || browser_->profile()->IsOffTheRecord()) | 109 if (!browser_->profile() || browser_->profile()->IsOffTheRecord()) |
| 122 return; | 110 return; |
| 123 | 111 |
| 124 TabRestoreService* service = | 112 TabRestoreService* service = |
| 125 TabRestoreServiceFactory::GetForProfile(browser_->profile()); | 113 TabRestoreServiceFactory::GetForProfile(browser_->profile()); |
| 126 | 114 |
| (...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 168 } | 156 } |
| 169 | 157 |
| 170 //////////////////////////////////////////////////////////////////////////////// | 158 //////////////////////////////////////////////////////////////////////////////// |
| 171 // BrowserTabStripModelDelegate, private: | 159 // BrowserTabStripModelDelegate, private: |
| 172 | 160 |
| 173 void BrowserTabStripModelDelegate::CloseFrame() { | 161 void BrowserTabStripModelDelegate::CloseFrame() { |
| 174 browser_->window()->Close(); | 162 browser_->window()->Close(); |
| 175 } | 163 } |
| 176 | 164 |
| 177 } // namespace chrome | 165 } // namespace chrome |
| OLD | NEW |