OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 "extensions/browser/extension_web_contents_observer.h" | 5 #include "extensions/browser/extension_web_contents_observer.h" |
6 | 6 |
7 #include "content/public/browser/child_process_security_policy.h" | 7 #include "content/public/browser/child_process_security_policy.h" |
8 #include "content/public/browser/render_process_host.h" | 8 #include "content/public/browser/render_process_host.h" |
9 #include "content/public/browser/render_view_host.h" | 9 #include "content/public/browser/render_view_host.h" |
10 #include "content/public/browser/site_instance.h" | 10 #include "content/public/browser/site_instance.h" |
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
73 new ExtensionMsg_Loaded(std::vector<ExtensionMsg_Loaded_Params>( | 73 new ExtensionMsg_Loaded(std::vector<ExtensionMsg_Loaded_Params>( |
74 1, ExtensionMsg_Loaded_Params(extension)))); | 74 1, ExtensionMsg_Loaded_Params(extension)))); |
75 render_view_host->Send( | 75 render_view_host->Send( |
76 new ExtensionMsg_ActivateExtension(extension->id())); | 76 new ExtensionMsg_ActivateExtension(extension->id())); |
77 break; | 77 break; |
78 | 78 |
79 case Manifest::TYPE_UNKNOWN: | 79 case Manifest::TYPE_UNKNOWN: |
80 case Manifest::TYPE_THEME: | 80 case Manifest::TYPE_THEME: |
81 case Manifest::TYPE_SHARED_MODULE: | 81 case Manifest::TYPE_SHARED_MODULE: |
82 break; | 82 break; |
| 83 |
| 84 case Manifest::NUM_LOAD_TYPES: |
| 85 NOTREACHED(); |
83 } | 86 } |
84 } | 87 } |
85 | 88 |
86 void ExtensionWebContentsObserver::NotifyRenderViewType( | 89 void ExtensionWebContentsObserver::NotifyRenderViewType( |
87 content::RenderViewHost* render_view_host) { | 90 content::RenderViewHost* render_view_host) { |
88 if (render_view_host) { | 91 if (render_view_host) { |
89 render_view_host->Send(new ExtensionMsg_NotifyRenderViewType( | 92 render_view_host->Send(new ExtensionMsg_NotifyRenderViewType( |
90 render_view_host->GetRoutingID(), GetViewType(web_contents()))); | 93 render_view_host->GetRoutingID(), GetViewType(web_contents()))); |
91 } | 94 } |
92 } | 95 } |
(...skipping 18 matching lines...) Expand all Loading... |
111 // site, so we can ignore that wrinkle here. | 114 // site, so we can ignore that wrinkle here. |
112 const GURL& site = render_view_host->GetSiteInstance()->GetSiteURL(); | 115 const GURL& site = render_view_host->GetSiteInstance()->GetSiteURL(); |
113 | 116 |
114 if (!site.SchemeIs(kExtensionScheme)) | 117 if (!site.SchemeIs(kExtensionScheme)) |
115 return std::string(); | 118 return std::string(); |
116 | 119 |
117 return site.host(); | 120 return site.host(); |
118 } | 121 } |
119 | 122 |
120 } // namespace extensions | 123 } // namespace extensions |
OLD | NEW |