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 297 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
308 data->set_opener(active_contents); | 308 data->set_opener(active_contents); |
309 } else if ((add_types & ADD_INHERIT_OPENER) && active_contents) { | 309 } else if ((add_types & ADD_INHERIT_OPENER) && active_contents) { |
310 if (active) { | 310 if (active) { |
311 // Forget any existing relationships, we don't want to make things too | 311 // Forget any existing relationships, we don't want to make things too |
312 // confusing by having multiple groups active at the same time. | 312 // confusing by having multiple groups active at the same time. |
313 ForgetAllOpeners(); | 313 ForgetAllOpeners(); |
314 } | 314 } |
315 data->set_opener(active_contents); | 315 data->set_opener(active_contents); |
316 } | 316 } |
317 | 317 |
| 318 // TODO(gbillock): Needs update to PopupManager. Should probably have a method |
| 319 // there about blocking web contents, or move all blocking mgmt to the |
| 320 // PopupManager instead of here at all. |
| 321 |
318 web_modal::WebContentsModalDialogManager* modal_dialog_manager = | 322 web_modal::WebContentsModalDialogManager* modal_dialog_manager = |
319 web_modal::WebContentsModalDialogManager::FromWebContents(contents); | 323 web_modal::WebContentsModalDialogManager::FromWebContents(contents); |
320 if (modal_dialog_manager) | 324 if (modal_dialog_manager) |
321 data->set_blocked(modal_dialog_manager->IsDialogActive()); | 325 data->set_blocked(modal_dialog_manager->IsDialogActive()); |
322 | 326 |
323 contents_data_.insert(contents_data_.begin() + index, data); | 327 contents_data_.insert(contents_data_.begin() + index, data); |
324 | 328 |
325 selection_model_.IncrementFrom(index); | 329 selection_model_.IncrementFrom(index); |
326 | 330 |
327 FOR_EACH_OBSERVER(TabStripModelObserver, observers_, | 331 FOR_EACH_OBSERVER(TabStripModelObserver, observers_, |
(...skipping 1078 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1406 void TabStripModel::ForgetOpenersAndGroupsReferencing( | 1410 void TabStripModel::ForgetOpenersAndGroupsReferencing( |
1407 const WebContents* tab) { | 1411 const WebContents* tab) { |
1408 for (WebContentsDataVector::const_iterator i = contents_data_.begin(); | 1412 for (WebContentsDataVector::const_iterator i = contents_data_.begin(); |
1409 i != contents_data_.end(); ++i) { | 1413 i != contents_data_.end(); ++i) { |
1410 if ((*i)->group() == tab) | 1414 if ((*i)->group() == tab) |
1411 (*i)->set_group(NULL); | 1415 (*i)->set_group(NULL); |
1412 if ((*i)->opener() == tab) | 1416 if ((*i)->opener() == tab) |
1413 (*i)->set_opener(NULL); | 1417 (*i)->set_opener(NULL); |
1414 } | 1418 } |
1415 } | 1419 } |
OLD | NEW |