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/webui/options/extension_settings_handler.h" | 5 #include "chrome/browser/ui/webui/options/extension_settings_handler.h" |
6 | 6 |
7 #include "base/auto_reset.h" | 7 #include "base/auto_reset.h" |
8 #include "base/base64.h" | 8 #include "base/base64.h" |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/bind_helpers.h" | 10 #include "base/bind_helpers.h" |
(...skipping 585 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
596 // if we only listen to EXTENSION_HOST_CREATED, we'll miss extensions | 596 // if we only listen to EXTENSION_HOST_CREATED, we'll miss extensions |
597 // that don't have a process at startup. | 597 // that don't have a process at startup. |
598 // | 598 // |
599 // Doing it this way gets everything but causes the page to be rendered | 599 // Doing it this way gets everything but causes the page to be rendered |
600 // more than we need. It doesn't seem to result in any noticeable flicker. | 600 // more than we need. It doesn't seem to result in any noticeable flicker. |
601 case content::NOTIFICATION_RENDER_VIEW_HOST_DELETED: | 601 case content::NOTIFICATION_RENDER_VIEW_HOST_DELETED: |
602 deleting_rvh_ = content::Source<RenderViewHost>(source).ptr(); | 602 deleting_rvh_ = content::Source<RenderViewHost>(source).ptr(); |
603 // Fall through. | 603 // Fall through. |
604 case content::NOTIFICATION_RENDER_VIEW_HOST_CREATED: | 604 case content::NOTIFICATION_RENDER_VIEW_HOST_CREATED: |
605 source_profile = Profile::FromBrowserContext( | 605 source_profile = Profile::FromBrowserContext( |
606 content::Source<RenderViewHost>(source)->site_instance()-> | 606 content::Source<RenderViewHost>(source)->GetSiteInstance()-> |
607 GetBrowserContext()); | 607 GetBrowserContext()); |
608 if (!profile->IsSameProfile(source_profile)) | 608 if (!profile->IsSameProfile(source_profile)) |
609 return; | 609 return; |
610 MaybeUpdateAfterNotification(); | 610 MaybeUpdateAfterNotification(); |
611 break; | 611 break; |
612 case chrome::NOTIFICATION_BACKGROUND_CONTENTS_DELETED: | 612 case chrome::NOTIFICATION_BACKGROUND_CONTENTS_DELETED: |
613 deleting_rvh_ = content::Details<BackgroundContents>(details)-> | 613 deleting_rvh_ = content::Details<BackgroundContents>(details)-> |
614 web_contents()->GetRenderViewHost(); | 614 web_contents()->GetRenderViewHost(); |
615 // Fall through. | 615 // Fall through. |
616 case chrome::NOTIFICATION_BACKGROUND_CONTENTS_NAVIGATED: | 616 case chrome::NOTIFICATION_BACKGROUND_CONTENTS_NAVIGATED: |
(...skipping 143 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
760 | 760 |
761 return result; | 761 return result; |
762 } | 762 } |
763 | 763 |
764 void ExtensionSettingsHandler::GetActivePagesForExtensionProcess( | 764 void ExtensionSettingsHandler::GetActivePagesForExtensionProcess( |
765 const std::set<RenderViewHost*>& views, | 765 const std::set<RenderViewHost*>& views, |
766 std::vector<ExtensionPage> *result) { | 766 std::vector<ExtensionPage> *result) { |
767 for (std::set<RenderViewHost*>::const_iterator iter = views.begin(); | 767 for (std::set<RenderViewHost*>::const_iterator iter = views.begin(); |
768 iter != views.end(); ++iter) { | 768 iter != views.end(); ++iter) { |
769 RenderViewHost* host = *iter; | 769 RenderViewHost* host = *iter; |
770 int host_type = host->delegate()->GetRenderViewType(); | 770 int host_type = host->GetDelegate()->GetRenderViewType(); |
771 if (host == deleting_rvh_ || | 771 if (host == deleting_rvh_ || |
772 chrome::VIEW_TYPE_EXTENSION_POPUP == host_type || | 772 chrome::VIEW_TYPE_EXTENSION_POPUP == host_type || |
773 chrome::VIEW_TYPE_EXTENSION_DIALOG == host_type) | 773 chrome::VIEW_TYPE_EXTENSION_DIALOG == host_type) |
774 continue; | 774 continue; |
775 | 775 |
776 GURL url = host->delegate()->GetURL(); | 776 GURL url = host->GetDelegate()->GetURL(); |
777 content::RenderProcessHost* process = host->process(); | 777 content::RenderProcessHost* process = host->GetProcess(); |
778 result->push_back( | 778 result->push_back( |
779 ExtensionPage(url, process->GetID(), host->routing_id(), | 779 ExtensionPage(url, process->GetID(), host->GetRoutingID(), |
780 process->GetBrowserContext()->IsOffTheRecord())); | 780 process->GetBrowserContext()->IsOffTheRecord())); |
781 } | 781 } |
782 } | 782 } |
OLD | NEW |