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 13 matching lines...) Expand all Loading... |
24 #include "chrome/browser/google/google_util.h" | 24 #include "chrome/browser/google/google_util.h" |
25 #include "chrome/browser/profiles/profile.h" | 25 #include "chrome/browser/profiles/profile.h" |
26 #include "chrome/browser/tab_contents/background_contents.h" | 26 #include "chrome/browser/tab_contents/background_contents.h" |
27 #include "chrome/browser/ui/webui/extensions/extension_icon_source.h" | 27 #include "chrome/browser/ui/webui/extensions/extension_icon_source.h" |
28 #include "chrome/common/chrome_notification_types.h" | 28 #include "chrome/common/chrome_notification_types.h" |
29 #include "chrome/common/chrome_switches.h" | 29 #include "chrome/common/chrome_switches.h" |
30 #include "chrome/common/chrome_view_type.h" | 30 #include "chrome/common/chrome_view_type.h" |
31 #include "chrome/common/extensions/extension.h" | 31 #include "chrome/common/extensions/extension.h" |
32 #include "chrome/common/pref_names.h" | 32 #include "chrome/common/pref_names.h" |
33 #include "chrome/common/url_constants.h" | 33 #include "chrome/common/url_constants.h" |
34 #include "content/browser/browsing_instance.h" | |
35 #include "content/browser/renderer_host/render_view_host.h" | 34 #include "content/browser/renderer_host/render_view_host.h" |
36 #include "content/browser/site_instance.h" | 35 #include "content/browser/site_instance.h" |
37 #include "content/browser/tab_contents/tab_contents_view.h" | 36 #include "content/browser/tab_contents/tab_contents_view.h" |
38 #include "content/public/browser/notification_service.h" | 37 #include "content/public/browser/notification_service.h" |
39 #include "content/public/browser/notification_types.h" | 38 #include "content/public/browser/notification_types.h" |
40 #include "content/public/browser/web_contents.h" | 39 #include "content/public/browser/web_contents.h" |
41 #include "grit/browser_resources.h" | 40 #include "grit/browser_resources.h" |
42 #include "grit/chromium_strings.h" | 41 #include "grit/chromium_strings.h" |
43 #include "grit/generated_resources.h" | 42 #include "grit/generated_resources.h" |
44 #include "grit/theme_resources.h" | 43 #include "grit/theme_resources.h" |
(...skipping 546 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
591 // that don't have a process at startup. | 590 // that don't have a process at startup. |
592 // | 591 // |
593 // Doing it this way gets everything but causes the page to be rendered | 592 // Doing it this way gets everything but causes the page to be rendered |
594 // more than we need. It doesn't seem to result in any noticeable flicker. | 593 // more than we need. It doesn't seem to result in any noticeable flicker. |
595 case content::NOTIFICATION_RENDER_VIEW_HOST_DELETED: | 594 case content::NOTIFICATION_RENDER_VIEW_HOST_DELETED: |
596 deleting_rvh_ = content::Source<RenderViewHost>(source).ptr(); | 595 deleting_rvh_ = content::Source<RenderViewHost>(source).ptr(); |
597 // Fall through. | 596 // Fall through. |
598 case content::NOTIFICATION_RENDER_VIEW_HOST_CREATED: | 597 case content::NOTIFICATION_RENDER_VIEW_HOST_CREATED: |
599 source_profile = Profile::FromBrowserContext( | 598 source_profile = Profile::FromBrowserContext( |
600 content::Source<RenderViewHost>(source)->site_instance()-> | 599 content::Source<RenderViewHost>(source)->site_instance()-> |
601 browsing_instance()->browser_context()); | 600 GetBrowserContext()); |
602 if (!profile->IsSameProfile(source_profile)) | 601 if (!profile->IsSameProfile(source_profile)) |
603 return; | 602 return; |
604 MaybeUpdateAfterNotification(); | 603 MaybeUpdateAfterNotification(); |
605 break; | 604 break; |
606 case chrome::NOTIFICATION_BACKGROUND_CONTENTS_DELETED: | 605 case chrome::NOTIFICATION_BACKGROUND_CONTENTS_DELETED: |
607 deleting_rvh_ = content::Details<BackgroundContents>(details)-> | 606 deleting_rvh_ = content::Details<BackgroundContents>(details)-> |
608 web_contents()->GetRenderViewHost(); | 607 web_contents()->GetRenderViewHost(); |
609 // Fall through. | 608 // Fall through. |
610 case chrome::NOTIFICATION_BACKGROUND_CONTENTS_NAVIGATED: | 609 case chrome::NOTIFICATION_BACKGROUND_CONTENTS_NAVIGATED: |
611 case chrome::NOTIFICATION_EXTENSION_HOST_CREATED: | 610 case chrome::NOTIFICATION_EXTENSION_HOST_CREATED: |
(...skipping 152 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
764 chrome::VIEW_TYPE_EXTENSION_DIALOG == host_type) | 763 chrome::VIEW_TYPE_EXTENSION_DIALOG == host_type) |
765 continue; | 764 continue; |
766 | 765 |
767 GURL url = host->delegate()->GetURL(); | 766 GURL url = host->delegate()->GetURL(); |
768 content::RenderProcessHost* process = host->process(); | 767 content::RenderProcessHost* process = host->process(); |
769 result->push_back( | 768 result->push_back( |
770 ExtensionPage(url, process->GetID(), host->routing_id(), | 769 ExtensionPage(url, process->GetID(), host->routing_id(), |
771 process->GetBrowserContext()->IsOffTheRecord())); | 770 process->GetBrowserContext()->IsOffTheRecord())); |
772 } | 771 } |
773 } | 772 } |
OLD | NEW |