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

Side by Side Diff: content/browser/frame_host/render_frame_host_impl.cc

Issue 749213003: Include whether Notification permission was requested with a user gesture. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 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
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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/frame_host/render_frame_host_impl.h" 5 #include "content/browser/frame_host/render_frame_host_impl.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/command_line.h" 8 #include "base/command_line.h"
9 #include "base/containers/hash_tables.h" 9 #include "base/containers/hash_tables.h"
10 #include "base/lazy_instance.h" 10 #include "base/lazy_instance.h"
(...skipping 919 matching lines...) Expand 10 before | Expand all | Expand 10 after
930 bool is_reload, 930 bool is_reload,
931 IPC::Message* reply_msg) { 931 IPC::Message* reply_msg) {
932 // While a JS beforeunload dialog is showing, tabs in the same process 932 // While a JS beforeunload dialog is showing, tabs in the same process
933 // shouldn't process input events. 933 // shouldn't process input events.
934 GetProcess()->SetIgnoreInputEvents(true); 934 GetProcess()->SetIgnoreInputEvents(true);
935 render_view_host_->StopHangMonitorTimeout(); 935 render_view_host_->StopHangMonitorTimeout();
936 delegate_->RunBeforeUnloadConfirm(this, message, is_reload, reply_msg); 936 delegate_->RunBeforeUnloadConfirm(this, message, is_reload, reply_msg);
937 } 937 }
938 938
939 void RenderFrameHostImpl::OnRequestPlatformNotificationPermission( 939 void RenderFrameHostImpl::OnRequestPlatformNotificationPermission(
940 const GURL& origin, int request_id) { 940 const GURL& origin, int request_id, bool user_gesture) {
941 base::Callback<void(bool)> done_callback = base::Bind( 941 base::Callback<void(bool)> done_callback = base::Bind(
942 &RenderFrameHostImpl::PlatformNotificationPermissionRequestDone, 942 &RenderFrameHostImpl::PlatformNotificationPermissionRequestDone,
943 weak_ptr_factory_.GetWeakPtr(), 943 weak_ptr_factory_.GetWeakPtr(),
944 request_id); 944 request_id);
945 945
946 if (!delegate()->GetAsWebContents()) 946 if (!delegate()->GetAsWebContents())
947 return; 947 return;
948 948
949 // TODO(peter): plumb user_gesture and bridge_id.
950 GetContentClient()->browser()->RequestPermission( 949 GetContentClient()->browser()->RequestPermission(
951 content::PERMISSION_NOTIFICATIONS, 950 content::PERMISSION_NOTIFICATIONS,
952 delegate()->GetAsWebContents(), 951 delegate()->GetAsWebContents(),
953 routing_id_, 952 routing_id_,
954 origin, 953 origin,
955 true, // user_gesture, 954 user_gesture,
956 done_callback); 955 done_callback);
957 } 956 }
958 957
959 void RenderFrameHostImpl::OnTextSurroundingSelectionResponse( 958 void RenderFrameHostImpl::OnTextSurroundingSelectionResponse(
960 const base::string16& content, 959 const base::string16& content,
961 size_t start_offset, 960 size_t start_offset,
962 size_t end_offset) { 961 size_t end_offset) {
963 render_view_host_->OnTextSurroundingSelectionResponse( 962 render_view_host_->OnTextSurroundingSelectionResponse(
964 content, start_offset, end_offset); 963 content, start_offset, end_offset);
965 } 964 }
(...skipping 628 matching lines...) Expand 10 before | Expand all | Expand 10 after
1594 void RenderFrameHostImpl::DidUseGeolocationPermission() { 1593 void RenderFrameHostImpl::DidUseGeolocationPermission() {
1595 RenderFrameHost* top_frame = frame_tree_node()->frame_tree()->GetMainFrame(); 1594 RenderFrameHost* top_frame = frame_tree_node()->frame_tree()->GetMainFrame();
1596 GetContentClient()->browser()->RegisterPermissionUsage( 1595 GetContentClient()->browser()->RegisterPermissionUsage(
1597 PERMISSION_GEOLOCATION, 1596 PERMISSION_GEOLOCATION,
1598 delegate_->GetAsWebContents(), 1597 delegate_->GetAsWebContents(),
1599 GetLastCommittedURL().GetOrigin(), 1598 GetLastCommittedURL().GetOrigin(),
1600 top_frame->GetLastCommittedURL().GetOrigin()); 1599 top_frame->GetLastCommittedURL().GetOrigin());
1601 } 1600 }
1602 1601
1603 } // namespace content 1602 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/frame_host/render_frame_host_impl.h ('k') | content/common/platform_notification_messages.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698