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 1232 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1243 InternalCloseTab(closing_contents, index, | 1243 InternalCloseTab(closing_contents, index, |
1244 (close_types & CLOSE_CREATE_HISTORICAL_TAB) != 0); | 1244 (close_types & CLOSE_CREATE_HISTORICAL_TAB) != 0); |
1245 } | 1245 } |
1246 | 1246 |
1247 return retval; | 1247 return retval; |
1248 } | 1248 } |
1249 | 1249 |
1250 void TabStripModel::InternalCloseTab(WebContents* contents, | 1250 void TabStripModel::InternalCloseTab(WebContents* contents, |
1251 int index, | 1251 int index, |
1252 bool create_historical_tabs) { | 1252 bool create_historical_tabs) { |
| 1253 // Reset the blocked state of the tab, and fire a notification if necessary. |
| 1254 // <http://crbug.com/336386#c4> . TODO(avi): Remove all the "blocked" code and |
| 1255 // the WebContentsModalDialogManager from TabStripModel, and move all that |
| 1256 // tracking code to the modal dialog code, where it belongs. |
| 1257 SetTabBlocked(index, false); |
| 1258 |
1253 FOR_EACH_OBSERVER(TabStripModelObserver, observers_, | 1259 FOR_EACH_OBSERVER(TabStripModelObserver, observers_, |
1254 TabClosingAt(this, contents, index)); | 1260 TabClosingAt(this, contents, index)); |
1255 | 1261 |
1256 // Ask the delegate to save an entry for this tab in the historical tab | 1262 // Ask the delegate to save an entry for this tab in the historical tab |
1257 // database if applicable. | 1263 // database if applicable. |
1258 if (create_historical_tabs) | 1264 if (create_historical_tabs) |
1259 delegate_->CreateHistoricalTab(contents); | 1265 delegate_->CreateHistoricalTab(contents); |
1260 | 1266 |
1261 // Deleting the WebContents will call back to us via | 1267 // Deleting the WebContents will call back to us via |
1262 // WebContentsData::WebContentsDestroyed and detach it. | 1268 // WebContentsData::WebContentsDestroyed and detach it. |
(...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1397 void TabStripModel::ForgetOpenersAndGroupsReferencing( | 1403 void TabStripModel::ForgetOpenersAndGroupsReferencing( |
1398 const WebContents* tab) { | 1404 const WebContents* tab) { |
1399 for (WebContentsDataVector::const_iterator i = contents_data_.begin(); | 1405 for (WebContentsDataVector::const_iterator i = contents_data_.begin(); |
1400 i != contents_data_.end(); ++i) { | 1406 i != contents_data_.end(); ++i) { |
1401 if ((*i)->group() == tab) | 1407 if ((*i)->group() == tab) |
1402 (*i)->set_group(NULL); | 1408 (*i)->set_group(NULL); |
1403 if ((*i)->opener() == tab) | 1409 if ((*i)->opener() == tab) |
1404 (*i)->set_opener(NULL); | 1410 (*i)->set_opener(NULL); |
1405 } | 1411 } |
1406 } | 1412 } |
OLD | NEW |