| 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 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 61 WebContents* Next(); | 61 WebContents* Next(); |
| 62 | 62 |
| 63 private: | 63 private: |
| 64 class DeletionObserver : public content::WebContentsObserver { | 64 class DeletionObserver : public content::WebContentsObserver { |
| 65 public: | 65 public: |
| 66 DeletionObserver(CloseTracker* parent, WebContents* web_contents) | 66 DeletionObserver(CloseTracker* parent, WebContents* web_contents) |
| 67 : WebContentsObserver(web_contents), | 67 : WebContentsObserver(web_contents), |
| 68 parent_(parent) { | 68 parent_(parent) { |
| 69 } | 69 } |
| 70 | 70 |
| 71 // Expose web_contents() publicly. | |
| 72 using content::WebContentsObserver::web_contents; | |
| 73 | |
| 74 private: | 71 private: |
| 75 // WebContentsObserver: | 72 // WebContentsObserver: |
| 76 virtual void WebContentsDestroyed() OVERRIDE { | 73 virtual void WebContentsDestroyed() OVERRIDE { |
| 77 parent_->OnWebContentsDestroyed(this); | 74 parent_->OnWebContentsDestroyed(this); |
| 78 } | 75 } |
| 79 | 76 |
| 80 CloseTracker* parent_; | 77 CloseTracker* parent_; |
| 81 | 78 |
| 82 DISALLOW_COPY_AND_ASSIGN(DeletionObserver); | 79 DISALLOW_COPY_AND_ASSIGN(DeletionObserver); |
| 83 }; | 80 }; |
| (...skipping 1324 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1408 void TabStripModel::ForgetOpenersAndGroupsReferencing( | 1405 void TabStripModel::ForgetOpenersAndGroupsReferencing( |
| 1409 const WebContents* tab) { | 1406 const WebContents* tab) { |
| 1410 for (WebContentsDataVector::const_iterator i = contents_data_.begin(); | 1407 for (WebContentsDataVector::const_iterator i = contents_data_.begin(); |
| 1411 i != contents_data_.end(); ++i) { | 1408 i != contents_data_.end(); ++i) { |
| 1412 if ((*i)->group() == tab) | 1409 if ((*i)->group() == tab) |
| 1413 (*i)->set_group(NULL); | 1410 (*i)->set_group(NULL); |
| 1414 if ((*i)->opener() == tab) | 1411 if ((*i)->opener() == tab) |
| 1415 (*i)->set_opener(NULL); | 1412 (*i)->set_opener(NULL); |
| 1416 } | 1413 } |
| 1417 } | 1414 } |
| OLD | NEW |