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/task_manager/task_manager_resource_providers.h" | 5 #include "chrome/browser/task_manager/task_manager_resource_providers.h" |
6 | 6 |
7 #include <string> | 7 #include <string> |
8 | 8 |
9 #include "base/basictypes.h" | 9 #include "base/basictypes.h" |
10 #include "base/bind.h" | 10 #include "base/bind.h" |
(...skipping 694 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
705 break; | 705 break; |
706 } | 706 } |
707 } | 707 } |
708 break; | 708 break; |
709 } | 709 } |
710 case content::NOTIFICATION_WEB_CONTENTS_DISCONNECTED: | 710 case content::NOTIFICATION_WEB_CONTENTS_DISCONNECTED: |
711 { | 711 { |
712 for (PanelResourceMap::iterator iter = resources_.begin(); | 712 for (PanelResourceMap::iterator iter = resources_.begin(); |
713 iter != resources_.end(); ++iter) { | 713 iter != resources_.end(); ++iter) { |
714 Panel* panel = iter->first; | 714 Panel* panel = iter->first; |
715 if (!panel->GetWebContents()) { | 715 WebContents* panel_contents = panel->GetWebContents(); |
| 716 if (!panel_contents || panel_contents == web_contents) { |
716 Remove(panel); | 717 Remove(panel); |
717 break; | 718 break; |
718 } | 719 } |
719 } | 720 } |
720 break; | 721 break; |
721 } | 722 } |
722 default: | 723 default: |
723 NOTREACHED() << "Unexpected notificiation."; | 724 NOTREACHED() << "Unexpected notificiation."; |
724 break; | 725 break; |
725 } | 726 } |
(...skipping 1143 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1869 case content::NOTIFICATION_WEB_CONTENTS_CONNECTED: | 1870 case content::NOTIFICATION_WEB_CONTENTS_CONNECTED: |
1870 Add(web_contents->GetRenderViewHost()); | 1871 Add(web_contents->GetRenderViewHost()); |
1871 break; | 1872 break; |
1872 case content::NOTIFICATION_WEB_CONTENTS_DISCONNECTED: | 1873 case content::NOTIFICATION_WEB_CONTENTS_DISCONNECTED: |
1873 Remove(web_contents->GetRenderViewHost()); | 1874 Remove(web_contents->GetRenderViewHost()); |
1874 break; | 1875 break; |
1875 default: | 1876 default: |
1876 NOTREACHED() << "Unexpected notification."; | 1877 NOTREACHED() << "Unexpected notification."; |
1877 } | 1878 } |
1878 } | 1879 } |
OLD | NEW |