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

Side by Side Diff: content/browser/push_messaging/push_messaging_message_filter.cc

Issue 2110343002: Reintroduce plumbing for user gesture into permission system. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Nits Created 4 years, 5 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 "content/browser/push_messaging/push_messaging_message_filter.h" 5 #include "content/browser/push_messaging/push_messaging_message_filter.h"
6 6
7 #include <string> 7 #include <string>
8 #include <vector> 8 #include <vector>
9 9
10 #include "base/bind.h" 10 #include "base/bind.h"
(...skipping 378 matching lines...) Expand 10 before | Expand all | Expand 10 after
389 if (web_contents) { 389 if (web_contents) {
390 web_contents->GetMainFrame()->AddMessageToConsole( 390 web_contents->GetMainFrame()->AddMessageToConsole(
391 CONSOLE_MESSAGE_LEVEL_ERROR, kIncognitoPushUnsupportedMessage); 391 CONSOLE_MESSAGE_LEVEL_ERROR, kIncognitoPushUnsupportedMessage);
392 // Request push messaging permission (which will fail, since 392 // Request push messaging permission (which will fail, since
393 // notifications aren't supported in incognito), so the website can't 393 // notifications aren't supported in incognito), so the website can't
394 // detect whether incognito is active. 394 // detect whether incognito is active.
395 web_contents->GetBrowserContext() 395 web_contents->GetBrowserContext()
396 ->GetPermissionManager() 396 ->GetPermissionManager()
397 ->RequestPermission( 397 ->RequestPermission(
398 PermissionType::PUSH_MESSAGING, render_frame_host, 398 PermissionType::PUSH_MESSAGING, render_frame_host,
399 data.requesting_origin, 399 data.requesting_origin, false /* user_gesture */,
400 base::Bind(&PushMessagingMessageFilter::Core:: 400 base::Bind(&PushMessagingMessageFilter::Core::
401 DidRequestPermissionInIncognito, 401 DidRequestPermissionInIncognito,
402 weak_factory_ui_to_ui_.GetWeakPtr(), data)); 402 weak_factory_ui_to_ui_.GetWeakPtr(), data));
403 } 403 }
404 } 404 }
405 } 405 }
406 return; 406 return;
407 } 407 }
408 408
409 if (data.FromDocument()) { 409 if (data.FromDocument()) {
(...skipping 539 matching lines...) Expand 10 before | Expand all | Expand 10 after
949 PushMessagingService* PushMessagingMessageFilter::Core::service() { 949 PushMessagingService* PushMessagingMessageFilter::Core::service() {
950 DCHECK_CURRENTLY_ON(BrowserThread::UI); 950 DCHECK_CURRENTLY_ON(BrowserThread::UI);
951 RenderProcessHost* process_host = 951 RenderProcessHost* process_host =
952 RenderProcessHost::FromID(render_process_id_); 952 RenderProcessHost::FromID(render_process_id_);
953 return process_host 953 return process_host
954 ? process_host->GetBrowserContext()->GetPushMessagingService() 954 ? process_host->GetBrowserContext()->GetPushMessagingService()
955 : nullptr; 955 : nullptr;
956 } 956 }
957 957
958 } // namespace content 958 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/permissions/permission_service_impl.cc ('k') | content/public/browser/permission_manager.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698