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 1097 matching lines...) Loading... |
1108 | 1108 |
1109 // We now return to our regularly scheduled shutdown procedure. | 1109 // We now return to our regularly scheduled shutdown procedure. |
1110 bool retval = true; | 1110 bool retval = true; |
1111 while (close_tracker.HasNext()) { | 1111 while (close_tracker.HasNext()) { |
1112 WebContents* closing_contents = close_tracker.Next(); | 1112 WebContents* closing_contents = close_tracker.Next(); |
1113 int index = GetIndexOfWebContents(closing_contents); | 1113 int index = GetIndexOfWebContents(closing_contents); |
1114 // Make sure we still contain the tab. | 1114 // Make sure we still contain the tab. |
1115 if (index == kNoTab) | 1115 if (index == kNoTab) |
1116 continue; | 1116 continue; |
1117 | 1117 |
1118 closing_contents->OnCloseStarted(); | 1118 CoreTabHelper* core_tab_helper = |
| 1119 CoreTabHelper::FromWebContents(closing_contents); |
| 1120 core_tab_helper->OnCloseStarted(); |
1119 | 1121 |
1120 // Update the explicitly closed state. If the unload handlers cancel the | 1122 // Update the explicitly closed state. If the unload handlers cancel the |
1121 // close the state is reset in Browser. We don't update the explicitly | 1123 // close the state is reset in Browser. We don't update the explicitly |
1122 // closed state if already marked as explicitly closed as unload handlers | 1124 // closed state if already marked as explicitly closed as unload handlers |
1123 // call back to this if the close is allowed. | 1125 // call back to this if the close is allowed. |
1124 if (!closing_contents->GetClosedByUserGesture()) { | 1126 if (!closing_contents->GetClosedByUserGesture()) { |
1125 closing_contents->SetClosedByUserGesture( | 1127 closing_contents->SetClosedByUserGesture( |
1126 close_types & CLOSE_USER_GESTURE); | 1128 close_types & CLOSE_USER_GESTURE); |
1127 } | 1129 } |
1128 | 1130 |
(...skipping 154 matching lines...) Loading... |
1283 void TabStripModel::ForgetOpenersAndGroupsReferencing( | 1285 void TabStripModel::ForgetOpenersAndGroupsReferencing( |
1284 const WebContents* tab) { | 1286 const WebContents* tab) { |
1285 for (WebContentsDataVector::const_iterator i = contents_data_.begin(); | 1287 for (WebContentsDataVector::const_iterator i = contents_data_.begin(); |
1286 i != contents_data_.end(); ++i) { | 1288 i != contents_data_.end(); ++i) { |
1287 if ((*i)->group == tab) | 1289 if ((*i)->group == tab) |
1288 (*i)->group = NULL; | 1290 (*i)->group = NULL; |
1289 if ((*i)->opener == tab) | 1291 if ((*i)->opener == tab) |
1290 (*i)->opener = NULL; | 1292 (*i)->opener = NULL; |
1291 } | 1293 } |
1292 } | 1294 } |
OLD | NEW |