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

Side by Side Diff: chrome/browser/push_messaging/push_messaging_service_impl.cc

Issue 1158813002: Use RenderFrameHost for ::RequestPermission() and ::CancelPermission(). (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: build fixes Created 5 years, 6 months 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
OLDNEW
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 "chrome/browser/push_messaging/push_messaging_service_impl.h" 5 #include "chrome/browser/push_messaging/push_messaging_service_impl.h"
6 6
7 #include <vector> 7 #include <vector>
8 8
9 #include "base/barrier_closure.h" 9 #include "base/barrier_closure.h"
10 #include "base/bind.h" 10 #include "base/bind.h"
(...skipping 316 matching lines...) Expand 10 before | Expand all | Expand 10 after
327 327
328 content::WebContents* web_contents = 328 content::WebContents* web_contents =
329 content::WebContents::FromRenderFrameHost(render_frame_host); 329 content::WebContents::FromRenderFrameHost(render_frame_host);
330 if (!web_contents) 330 if (!web_contents)
331 return; 331 return;
332 332
333 // TODO(miguelg) need to send this over IPC when bubble support is 333 // TODO(miguelg) need to send this over IPC when bubble support is
334 // implemented. 334 // implemented.
335 int bridge_id = -1; 335 int bridge_id = -1;
336 336
337 const PermissionRequestID id( 337 const PermissionRequestID id(renderer_id, render_frame_id, bridge_id, GURL());
338 renderer_id, web_contents->GetRoutingID(), bridge_id, GURL());
339 338
340 PushMessagingPermissionContext* permission_context = 339 PushMessagingPermissionContext* permission_context =
341 PushMessagingPermissionContextFactory::GetForProfile(profile_); 340 PushMessagingPermissionContextFactory::GetForProfile(profile_);
342 DCHECK(permission_context); 341 DCHECK(permission_context);
343 342
344 if (!user_visible) { 343 if (!user_visible) {
345 web_contents->GetMainFrame()->AddMessageToConsole( 344 web_contents->GetMainFrame()->AddMessageToConsole(
346 content::CONSOLE_MESSAGE_LEVEL_ERROR, 345 content::CONSOLE_MESSAGE_LEVEL_ERROR,
347 kSilentPushUnsupportedMessage); 346 kSilentPushUnsupportedMessage);
348 347
(...skipping 304 matching lines...) Expand 10 before | Expand all | Expand 10 after
653 CONTENT_SETTING_ALLOW; 652 CONTENT_SETTING_ALLOW;
654 } 653 }
655 654
656 gcm::GCMDriver* PushMessagingServiceImpl::GetGCMDriver() const { 655 gcm::GCMDriver* PushMessagingServiceImpl::GetGCMDriver() const {
657 gcm::GCMProfileService* gcm_profile_service = 656 gcm::GCMProfileService* gcm_profile_service =
658 gcm::GCMProfileServiceFactory::GetForProfile(profile_); 657 gcm::GCMProfileServiceFactory::GetForProfile(profile_);
659 CHECK(gcm_profile_service); 658 CHECK(gcm_profile_service);
660 CHECK(gcm_profile_service->driver()); 659 CHECK(gcm_profile_service->driver());
661 return gcm_profile_service->driver(); 660 return gcm_profile_service->driver();
662 } 661 }
OLDNEW
« no previous file with comments | « chrome/browser/permissions/permission_manager.cc ('k') | chromecast/browser/cast_permission_manager.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698