| 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/tabs/tab_strip_model.h" | 5 #include "chrome/browser/ui/tabs/tab_strip_model.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <map> | 8 #include <map> |
| 9 #include <string> | 9 #include <string> |
| 10 | 10 |
| (...skipping 261 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 272 // notification is sent even though the tab selection has changed because | 272 // notification is sent even though the tab selection has changed because |
| 273 // |old_model| is stored after calling DecrementFrom(). | 273 // |old_model| is stored after calling DecrementFrom(). |
| 274 if (was_selected) { | 274 if (was_selected) { |
| 275 FOR_EACH_OBSERVER(TabStripModelObserver, observers_, | 275 FOR_EACH_OBSERVER(TabStripModelObserver, observers_, |
| 276 TabSelectionChanged(this, old_model)); | 276 TabSelectionChanged(this, old_model)); |
| 277 } | 277 } |
| 278 } | 278 } |
| 279 return removed_contents; | 279 return removed_contents; |
| 280 } | 280 } |
| 281 | 281 |
| 282 TabContents* TabStripModel::DetachTabContentsAndCreateHistoryAt(int index) { |
| 283 TabContents* contents = DetachTabContentsAt(index); |
| 284 if (contents) |
| 285 delegate_->CreateHistoricalTab(contents->web_contents()); |
| 286 return contents; |
| 287 } |
| 288 |
| 282 void TabStripModel::ActivateTabAt(int index, bool user_gesture) { | 289 void TabStripModel::ActivateTabAt(int index, bool user_gesture) { |
| 283 DCHECK(ContainsIndex(index)); | 290 DCHECK(ContainsIndex(index)); |
| 284 TabStripSelectionModel new_model; | 291 TabStripSelectionModel new_model; |
| 285 new_model.Copy(selection_model_); | 292 new_model.Copy(selection_model_); |
| 286 new_model.SetSelectedIndex(index); | 293 new_model.SetSelectedIndex(index); |
| 287 SetSelection(new_model, user_gesture ? NOTIFY_USER_GESTURE : NOTIFY_DEFAULT); | 294 SetSelection(new_model, user_gesture ? NOTIFY_USER_GESTURE : NOTIFY_DEFAULT); |
| 288 } | 295 } |
| 289 | 296 |
| 290 void TabStripModel::AddTabAtToSelection(int index) { | 297 void TabStripModel::AddTabAtToSelection(int index) { |
| 291 DCHECK(ContainsIndex(index)); | 298 DCHECK(ContainsIndex(index)); |
| (...skipping 1009 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1301 void TabStripModel::ForgetOpenersAndGroupsReferencing( | 1308 void TabStripModel::ForgetOpenersAndGroupsReferencing( |
| 1302 const WebContents* tab) { | 1309 const WebContents* tab) { |
| 1303 for (WebContentsDataVector::const_iterator i = contents_data_.begin(); | 1310 for (WebContentsDataVector::const_iterator i = contents_data_.begin(); |
| 1304 i != contents_data_.end(); ++i) { | 1311 i != contents_data_.end(); ++i) { |
| 1305 if ((*i)->group == tab) | 1312 if ((*i)->group == tab) |
| 1306 (*i)->group = NULL; | 1313 (*i)->group = NULL; |
| 1307 if ((*i)->opener == tab) | 1314 if ((*i)->opener == tab) |
| 1308 (*i)->opener = NULL; | 1315 (*i)->opener = NULL; |
| 1309 } | 1316 } |
| 1310 } | 1317 } |
| OLD | NEW |