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

Side by Side Diff: chrome/browser/chrome_content_browser_client.cc

Issue 459953002: Migrate geolocation permissions to the new common permission class. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 4 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 | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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/chrome_content_browser_client.h" 5 #include "chrome/browser/chrome_content_browser_client.h"
6 6
7 #include <set> 7 #include <set>
8 #include <utility> 8 #include <utility>
9 #include <vector> 9 #include <vector>
10 10
(...skipping 1913 matching lines...) Expand 10 before | Expand all | Expand 10 after
1924 #else 1924 #else
1925 NOTIMPLEMENTED(); 1925 NOTIMPLEMENTED();
1926 #endif 1926 #endif
1927 } 1927 }
1928 1928
1929 void ChromeContentBrowserClient::RequestGeolocationPermission( 1929 void ChromeContentBrowserClient::RequestGeolocationPermission(
1930 content::WebContents* web_contents, 1930 content::WebContents* web_contents,
1931 int bridge_id, 1931 int bridge_id,
1932 const GURL& requesting_frame, 1932 const GURL& requesting_frame,
1933 bool user_gesture, 1933 bool user_gesture,
1934 base::Callback<void(bool)> result_callback, 1934 const base::Callback<void(bool)>& result_callback) {
1935 base::Closure* cancel_callback) { 1935 int render_process_id = web_contents->GetRenderProcessHost()->GetID();
1936 int render_view_id = web_contents->GetRenderViewHost()->GetRoutingID();
1937
1938 const PermissionRequestID request_id(render_process_id,
1939 render_view_id,
1940 bridge_id,
1941 requesting_frame);
1936 GeolocationPermissionContextFactory::GetForProfile( 1942 GeolocationPermissionContextFactory::GetForProfile(
1937 Profile::FromBrowserContext(web_contents->GetBrowserContext()))-> 1943 Profile::FromBrowserContext(web_contents->GetBrowserContext()))->
1938 RequestGeolocationPermission(web_contents, bridge_id, 1944 RequestPermission(web_contents, request_id,
1939 requesting_frame, user_gesture, 1945 requesting_frame.GetOrigin(), user_gesture,
1940 result_callback, cancel_callback); 1946 result_callback);
1947 }
1948
1949 void ChromeContentBrowserClient::CancelGeolocationPermissionRequest(
1950 content::WebContents* web_contents,
1951 int bridge_id,
1952 const GURL& requesting_frame) {
1953 int render_process_id = web_contents->GetRenderProcessHost()->GetID();
1954 int render_view_id = web_contents->GetRenderViewHost()->GetRoutingID();
1955
1956 const PermissionRequestID request_id(render_process_id,
1957 render_view_id,
1958 bridge_id,
1959 requesting_frame);
1960 GeolocationPermissionContextFactory::GetForProfile(
1961 Profile::FromBrowserContext(web_contents->GetBrowserContext()))->
1962 CancelPermissionRequest(web_contents, request_id);
1941 } 1963 }
1942 1964
1943 void ChromeContentBrowserClient::RequestMidiSysExPermission( 1965 void ChromeContentBrowserClient::RequestMidiSysExPermission(
1944 content::WebContents* web_contents, 1966 content::WebContents* web_contents,
1945 int bridge_id, 1967 int bridge_id,
1946 const GURL& requesting_frame, 1968 const GURL& requesting_frame,
1947 bool user_gesture, 1969 bool user_gesture,
1948 base::Callback<void(bool)> result_callback, 1970 base::Callback<void(bool)> result_callback,
1949 base::Closure* cancel_callback) { 1971 base::Closure* cancel_callback) {
1950 MidiPermissionContext* context = 1972 MidiPermissionContext* context =
(...skipping 680 matching lines...) Expand 10 before | Expand all | Expand 10 after
2631 switches::kDisableWebRtcEncryption, 2653 switches::kDisableWebRtcEncryption,
2632 }; 2654 };
2633 to_command_line->CopySwitchesFrom(from_command_line, 2655 to_command_line->CopySwitchesFrom(from_command_line,
2634 kWebRtcDevSwitchNames, 2656 kWebRtcDevSwitchNames,
2635 arraysize(kWebRtcDevSwitchNames)); 2657 arraysize(kWebRtcDevSwitchNames));
2636 } 2658 }
2637 } 2659 }
2638 #endif // defined(ENABLE_WEBRTC) 2660 #endif // defined(ENABLE_WEBRTC)
2639 2661
2640 } // namespace chrome 2662 } // namespace chrome
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698