| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/tabs/tab_strip_model.h" | 5 #include "chrome/browser/tabs/tab_strip_model.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <map> | 8 #include <map> |
| 9 | 9 |
| 10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
| (...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 61 // TabStripModel, public: | 61 // TabStripModel, public: |
| 62 | 62 |
| 63 TabStripModel::TabStripModel(TabStripModelDelegate* delegate, Profile* profile) | 63 TabStripModel::TabStripModel(TabStripModelDelegate* delegate, Profile* profile) |
| 64 : delegate_(delegate), | 64 : delegate_(delegate), |
| 65 profile_(profile), | 65 profile_(profile), |
| 66 closing_all_(false), | 66 closing_all_(false), |
| 67 order_controller_(NULL) { | 67 order_controller_(NULL) { |
| 68 DCHECK(delegate_); | 68 DCHECK(delegate_); |
| 69 registrar_.Add(this, | 69 registrar_.Add(this, |
| 70 content::NOTIFICATION_TAB_CONTENTS_DESTROYED, | 70 content::NOTIFICATION_TAB_CONTENTS_DESTROYED, |
| 71 NotificationService::AllSources()); | 71 NotificationService::AllBrowserContextsAndSources()); |
| 72 registrar_.Add(this, | 72 registrar_.Add(this, |
| 73 chrome::NOTIFICATION_EXTENSION_UNLOADED, | 73 chrome::NOTIFICATION_EXTENSION_UNLOADED, |
| 74 Source<Profile>(profile_)); | 74 Source<Profile>(profile_)); |
| 75 order_controller_ = new TabStripModelOrderController(this); | 75 order_controller_ = new TabStripModelOrderController(this); |
| 76 } | 76 } |
| 77 | 77 |
| 78 TabStripModel::~TabStripModel() { | 78 TabStripModel::~TabStripModel() { |
| 79 FOR_EACH_OBSERVER(TabStripModelObserver, observers_, | 79 FOR_EACH_OBSERVER(TabStripModelObserver, observers_, |
| 80 TabStripModelDeleted()); | 80 TabStripModelDeleted()); |
| 81 STLDeleteContainerPointers(contents_data_.begin(), contents_data_.end()); | 81 STLDeleteContainerPointers(contents_data_.begin(), contents_data_.end()); |
| (...skipping 1236 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1318 void TabStripModel::ForgetOpenersAndGroupsReferencing( | 1318 void TabStripModel::ForgetOpenersAndGroupsReferencing( |
| 1319 const NavigationController* tab) { | 1319 const NavigationController* tab) { |
| 1320 for (TabContentsDataVector::const_iterator i = contents_data_.begin(); | 1320 for (TabContentsDataVector::const_iterator i = contents_data_.begin(); |
| 1321 i != contents_data_.end(); ++i) { | 1321 i != contents_data_.end(); ++i) { |
| 1322 if ((*i)->group == tab) | 1322 if ((*i)->group == tab) |
| 1323 (*i)->group = NULL; | 1323 (*i)->group = NULL; |
| 1324 if ((*i)->opener == tab) | 1324 if ((*i)->opener == tab) |
| 1325 (*i)->opener = NULL; | 1325 (*i)->opener = NULL; |
| 1326 } | 1326 } |
| 1327 } | 1327 } |
| OLD | NEW |