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

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

Issue 8776022: Move app notification getChannel API out of experimental (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: another unit test fix Created 9 years 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 159 matching lines...) Expand 10 before | Expand all | Expand 10 after
170 Profile::FromBrowserContext(tab_contents()->browser_context()); 170 Profile::FromBrowserContext(tab_contents()->browser_context());
171 ExtensionService* extension_service = profile->GetExtensionService(); 171 ExtensionService* extension_service = profile->GetExtensionService();
172 extensions::ProcessMap* process_map = extension_service->process_map(); 172 extensions::ProcessMap* process_map = extension_service->process_map();
173 content::RenderProcessHost* process = 173 content::RenderProcessHost* process =
174 tab_contents_wrapper()->render_view_host()->process(); 174 tab_contents_wrapper()->render_view_host()->process();
175 const Extension* extension = 175 const Extension* extension =
176 extension_service->GetInstalledApp(requestor_url); 176 extension_service->GetInstalledApp(requestor_url);
177 bool allowed = 177 bool allowed =
178 extension && 178 extension &&
179 extension->HasAPIPermission( 179 extension->HasAPIPermission(
180 ExtensionAPIPermission::kExperimental) && 180 ExtensionAPIPermission::kAppNotifications) &&
181 process_map->Contains(extension->id(), process->GetID()); 181 process_map->Contains(extension->id(), process->GetID());
182 if (!allowed) { 182 if (!allowed) {
183 Send(new ExtensionMsg_GetAppNotifyChannelResponse( 183 Send(new ExtensionMsg_GetAppNotifyChannelResponse(
184 return_route_id, "", "permission_error", callback_id)); 184 return_route_id, "", "permission_error", callback_id));
185 return; 185 return;
186 } 186 }
187 187
188 AppNotifyChannelUI* ui = new AppNotifyChannelUIImpl( 188 AppNotifyChannelUI* ui = new AppNotifyChannelUIImpl(
189 GetBrowser(), tab_contents_wrapper(), extension->name()); 189 GetBrowser(), tab_contents_wrapper(), extension->name());
190 190
(...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after
281 } 281 }
282 282
283 TabContents* ExtensionTabHelper::GetAssociatedTabContents() const { 283 TabContents* ExtensionTabHelper::GetAssociatedTabContents() const {
284 return tab_contents(); 284 return tab_contents();
285 } 285 }
286 286
287 gfx::NativeView ExtensionTabHelper::GetNativeViewOfHost() { 287 gfx::NativeView ExtensionTabHelper::GetNativeViewOfHost() {
288 RenderWidgetHostView* rwhv = tab_contents()->GetRenderWidgetHostView(); 288 RenderWidgetHostView* rwhv = tab_contents()->GetRenderWidgetHostView();
289 return rwhv ? rwhv->GetNativeView() : NULL; 289 return rwhv ? rwhv->GetNativeView() : NULL;
290 } 290 }
OLDNEW
« no previous file with comments | « chrome/browser/extensions/app_notification_browsertest.cc ('k') | chrome/common/extensions/extension_permission_set.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698