OLD | NEW |
---|---|
1 // Copyright 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 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 1845 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1856 // Add all the existing guest WebContents. | 1856 // Add all the existing guest WebContents. |
1857 for (RenderProcessHost::iterator i( | 1857 for (RenderProcessHost::iterator i( |
1858 RenderProcessHost::AllHostsIterator()); | 1858 RenderProcessHost::AllHostsIterator()); |
1859 !i.IsAtEnd(); i.Advance()) { | 1859 !i.IsAtEnd(); i.Advance()) { |
1860 RenderProcessHost* host = i.GetCurrentValue(); | 1860 RenderProcessHost* host = i.GetCurrentValue(); |
1861 if (host->IsGuest()) { | 1861 if (host->IsGuest()) { |
1862 RenderProcessHost::RenderWidgetHostsIterator iter = | 1862 RenderProcessHost::RenderWidgetHostsIterator iter = |
1863 host->GetRenderWidgetHostsIterator(); | 1863 host->GetRenderWidgetHostsIterator(); |
1864 for (; !iter.IsAtEnd(); iter.Advance()) { | 1864 for (; !iter.IsAtEnd(); iter.Advance()) { |
1865 const RenderWidgetHost* widget = iter.GetCurrentValue(); | 1865 const RenderWidgetHost* widget = iter.GetCurrentValue(); |
1866 Add(RenderViewHost::From( | 1866 Add(RenderViewHost::From(const_cast<RenderWidgetHost*>(widget))); |
Charlie Reis
2013/01/18 05:37:07
Nit: Might as well put this back to avoid the chur
nasko
2013/01/18 19:09:42
Done.
| |
1867 const_cast<RenderWidgetHost*>(widget))); | |
1868 } | 1867 } |
1869 } | 1868 } |
1870 } | 1869 } |
1871 | 1870 |
1872 // Then we register for notifications to get new guests. | 1871 // Then we register for notifications to get new guests. |
1873 registrar_.Add(this, content::NOTIFICATION_WEB_CONTENTS_CONNECTED, | 1872 registrar_.Add(this, content::NOTIFICATION_WEB_CONTENTS_CONNECTED, |
1874 content::NotificationService::AllBrowserContextsAndSources()); | 1873 content::NotificationService::AllBrowserContextsAndSources()); |
1875 registrar_.Add(this, content::NOTIFICATION_WEB_CONTENTS_DISCONNECTED, | 1874 registrar_.Add(this, content::NOTIFICATION_WEB_CONTENTS_DISCONNECTED, |
1876 content::NotificationService::AllBrowserContextsAndSources()); | 1875 content::NotificationService::AllBrowserContextsAndSources()); |
1877 } | 1876 } |
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1926 case content::NOTIFICATION_WEB_CONTENTS_CONNECTED: | 1925 case content::NOTIFICATION_WEB_CONTENTS_CONNECTED: |
1927 Add(web_contents->GetRenderViewHost()); | 1926 Add(web_contents->GetRenderViewHost()); |
1928 break; | 1927 break; |
1929 case content::NOTIFICATION_WEB_CONTENTS_DISCONNECTED: | 1928 case content::NOTIFICATION_WEB_CONTENTS_DISCONNECTED: |
1930 Remove(web_contents->GetRenderViewHost()); | 1929 Remove(web_contents->GetRenderViewHost()); |
1931 break; | 1930 break; |
1932 default: | 1931 default: |
1933 NOTREACHED() << "Unexpected notification."; | 1932 NOTREACHED() << "Unexpected notification."; |
1934 } | 1933 } |
1935 } | 1934 } |
OLD | NEW |