OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/extensions/extension_tab_helper.h" | 5 #include "chrome/browser/extensions/extension_tab_helper.h" |
6 | 6 |
7 #include "chrome/browser/extensions/extension_service.h" | 7 #include "chrome/browser/extensions/extension_service.h" |
8 #include "chrome/browser/extensions/webstore_inline_installer.h" | 8 #include "chrome/browser/extensions/webstore_inline_installer.h" |
9 #include "chrome/browser/profiles/profile.h" | 9 #include "chrome/browser/profiles/profile.h" |
10 #include "chrome/browser/sessions/restore_tab_helper.h" | 10 #include "chrome/browser/sessions/restore_tab_helper.h" |
(...skipping 151 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
162 const std::string& client_id, | 162 const std::string& client_id, |
163 int return_route_id, | 163 int return_route_id, |
164 int callback_id) { | 164 int callback_id) { |
165 | 165 |
166 // Check for permission first. | 166 // Check for permission first. |
167 Profile* profile = | 167 Profile* profile = |
168 Profile::FromBrowserContext(tab_contents()->browser_context()); | 168 Profile::FromBrowserContext(tab_contents()->browser_context()); |
169 ExtensionService* extension_service = profile->GetExtensionService(); | 169 ExtensionService* extension_service = profile->GetExtensionService(); |
170 extensions::ProcessMap* process_map = extension_service->process_map(); | 170 extensions::ProcessMap* process_map = extension_service->process_map(); |
171 content::RenderProcessHost* process = | 171 content::RenderProcessHost* process = |
172 tab_contents_wrapper()->render_view_host()->process(); | 172 tab_contents_wrapper()->tab_contents()->render_view_host()->process(); |
173 const Extension* extension = | 173 const Extension* extension = |
174 extension_service->GetInstalledApp(requestor_url); | 174 extension_service->GetInstalledApp(requestor_url); |
175 bool allowed = | 175 bool allowed = |
176 extension && | 176 extension && |
177 extension->HasAPIPermission( | 177 extension->HasAPIPermission( |
178 ExtensionAPIPermission::kAppNotifications) && | 178 ExtensionAPIPermission::kAppNotifications) && |
179 process_map->Contains(extension->id(), process->GetID()); | 179 process_map->Contains(extension->id(), process->GetID()); |
180 if (!allowed) { | 180 if (!allowed) { |
181 Send(new ExtensionMsg_GetAppNotifyChannelResponse( | 181 Send(new ExtensionMsg_GetAppNotifyChannelResponse( |
182 return_route_id, "", "permission_error", callback_id)); | 182 return_route_id, "", "permission_error", callback_id)); |
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
279 } | 279 } |
280 | 280 |
281 TabContents* ExtensionTabHelper::GetAssociatedTabContents() const { | 281 TabContents* ExtensionTabHelper::GetAssociatedTabContents() const { |
282 return tab_contents(); | 282 return tab_contents(); |
283 } | 283 } |
284 | 284 |
285 gfx::NativeView ExtensionTabHelper::GetNativeViewOfHost() { | 285 gfx::NativeView ExtensionTabHelper::GetNativeViewOfHost() { |
286 RenderWidgetHostView* rwhv = tab_contents()->GetRenderWidgetHostView(); | 286 RenderWidgetHostView* rwhv = tab_contents()->GetRenderWidgetHostView(); |
287 return rwhv ? rwhv->GetNativeView() : NULL; | 287 return rwhv ? rwhv->GetNativeView() : NULL; |
288 } | 288 } |
OLD | NEW |