Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(555)

Side by Side Diff: chrome/browser/extensions/extension_tab_helper.cc

Issue 8515027: Define the public version of the browser side RenderProcessHost interface. This interface is not ... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 9 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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
162 const GURL& requestor_url, 162 const GURL& requestor_url,
163 const std::string& client_id, 163 const std::string& client_id,
164 int return_route_id, 164 int return_route_id,
165 int callback_id) { 165 int callback_id) {
166 166
167 // Check for permission first. 167 // Check for permission first.
168 Profile* profile = 168 Profile* profile =
169 Profile::FromBrowserContext(tab_contents()->browser_context()); 169 Profile::FromBrowserContext(tab_contents()->browser_context());
170 ExtensionService* extension_service = profile->GetExtensionService(); 170 ExtensionService* extension_service = profile->GetExtensionService();
171 extensions::ProcessMap* process_map = extension_service->process_map(); 171 extensions::ProcessMap* process_map = extension_service->process_map();
172 RenderProcessHost* process = 172 content::RenderProcessHost* process =
173 tab_contents_wrapper()->render_view_host()->process(); 173 tab_contents_wrapper()->render_view_host()->process();
174 const Extension* extension = 174 const Extension* extension =
175 extension_service->GetInstalledApp(requestor_url); 175 extension_service->GetInstalledApp(requestor_url);
176 bool allowed = 176 bool allowed =
177 extension && 177 extension &&
178 extension->HasAPIPermission( 178 extension->HasAPIPermission(
179 ExtensionAPIPermission::kExperimental) && 179 ExtensionAPIPermission::kExperimental) &&
180 process_map->Contains(extension->id(), process->id()); 180 process_map->Contains(extension->id(), process->GetID());
181 if (!allowed) { 181 if (!allowed) {
182 AppNotifyChannelSetupComplete("", "permission_error", return_route_id, 182 AppNotifyChannelSetupComplete("", "permission_error", return_route_id,
183 callback_id); 183 callback_id);
184 return; 184 return;
185 } 185 }
186 186
187 AppNotifyChannelUI* ui = new AppNotifyChannelUIImpl( 187 AppNotifyChannelUI* ui = new AppNotifyChannelUIImpl(
188 GetBrowser(), tab_contents_wrapper(), extension->name()); 188 GetBrowser(), tab_contents_wrapper(), extension->name());
189 189
190 scoped_refptr<AppNotifyChannelSetup> channel_setup( 190 scoped_refptr<AppNotifyChannelSetup> channel_setup(
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after
267 } 267 }
268 268
269 TabContents* ExtensionTabHelper::GetAssociatedTabContents() const { 269 TabContents* ExtensionTabHelper::GetAssociatedTabContents() const {
270 return tab_contents(); 270 return tab_contents();
271 } 271 }
272 272
273 gfx::NativeView ExtensionTabHelper::GetNativeViewOfHost() { 273 gfx::NativeView ExtensionTabHelper::GetNativeViewOfHost() {
274 RenderWidgetHostView* rwhv = tab_contents()->GetRenderWidgetHostView(); 274 RenderWidgetHostView* rwhv = tab_contents()->GetRenderWidgetHostView();
275 return rwhv ? rwhv->GetNativeView() : NULL; 275 return rwhv ? rwhv->GetNativeView() : NULL;
276 } 276 }
OLDNEW
« no previous file with comments | « chrome/browser/extensions/extension_service.cc ('k') | chrome/browser/extensions/extension_tab_id_map.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698