OLD | NEW |
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 1922 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1933 #else | 1933 #else |
1934 NOTIMPLEMENTED(); | 1934 NOTIMPLEMENTED(); |
1935 #endif | 1935 #endif |
1936 } | 1936 } |
1937 | 1937 |
1938 void ChromeContentBrowserClient::RequestGeolocationPermission( | 1938 void ChromeContentBrowserClient::RequestGeolocationPermission( |
1939 content::WebContents* web_contents, | 1939 content::WebContents* web_contents, |
1940 int bridge_id, | 1940 int bridge_id, |
1941 const GURL& requesting_frame, | 1941 const GURL& requesting_frame, |
1942 bool user_gesture, | 1942 bool user_gesture, |
1943 base::Callback<void(bool)> result_callback, | 1943 const base::Callback<void(bool)>& result_callback) { |
1944 base::Closure* cancel_callback) { | 1944 int render_process_id = web_contents->GetRenderProcessHost()->GetID(); |
| 1945 int render_view_id = web_contents->GetRenderViewHost()->GetRoutingID(); |
| 1946 |
| 1947 const PermissionRequestID request_id(render_process_id, |
| 1948 render_view_id, |
| 1949 bridge_id, |
| 1950 requesting_frame); |
1945 GeolocationPermissionContextFactory::GetForProfile( | 1951 GeolocationPermissionContextFactory::GetForProfile( |
1946 Profile::FromBrowserContext(web_contents->GetBrowserContext()))-> | 1952 Profile::FromBrowserContext(web_contents->GetBrowserContext()))-> |
1947 RequestGeolocationPermission(web_contents, bridge_id, | 1953 RequestPermission(web_contents, request_id, |
1948 requesting_frame, user_gesture, | 1954 requesting_frame.GetOrigin(), user_gesture, |
1949 result_callback, cancel_callback); | 1955 result_callback); |
| 1956 } |
| 1957 |
| 1958 void ChromeContentBrowserClient::CancelGeolocationPermissionRequest( |
| 1959 content::WebContents* web_contents, |
| 1960 int bridge_id, |
| 1961 const GURL& requesting_frame) { |
| 1962 int render_process_id = web_contents->GetRenderProcessHost()->GetID(); |
| 1963 int render_view_id = web_contents->GetRenderViewHost()->GetRoutingID(); |
| 1964 |
| 1965 const PermissionRequestID request_id(render_process_id, |
| 1966 render_view_id, |
| 1967 bridge_id, |
| 1968 requesting_frame); |
| 1969 GeolocationPermissionContextFactory::GetForProfile( |
| 1970 Profile::FromBrowserContext(web_contents->GetBrowserContext()))-> |
| 1971 CancelPermissionRequest(web_contents, request_id); |
1950 } | 1972 } |
1951 | 1973 |
1952 void ChromeContentBrowserClient::RequestMidiSysExPermission( | 1974 void ChromeContentBrowserClient::RequestMidiSysExPermission( |
1953 content::WebContents* web_contents, | 1975 content::WebContents* web_contents, |
1954 int bridge_id, | 1976 int bridge_id, |
1955 const GURL& requesting_frame, | 1977 const GURL& requesting_frame, |
1956 bool user_gesture, | 1978 bool user_gesture, |
1957 base::Callback<void(bool)> result_callback, | 1979 base::Callback<void(bool)> result_callback, |
1958 base::Closure* cancel_callback) { | 1980 base::Closure* cancel_callback) { |
1959 MidiPermissionContext* context = | 1981 MidiPermissionContext* context = |
(...skipping 680 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2640 switches::kDisableWebRtcEncryption, | 2662 switches::kDisableWebRtcEncryption, |
2641 }; | 2663 }; |
2642 to_command_line->CopySwitchesFrom(from_command_line, | 2664 to_command_line->CopySwitchesFrom(from_command_line, |
2643 kWebRtcDevSwitchNames, | 2665 kWebRtcDevSwitchNames, |
2644 arraysize(kWebRtcDevSwitchNames)); | 2666 arraysize(kWebRtcDevSwitchNames)); |
2645 } | 2667 } |
2646 } | 2668 } |
2647 #endif // defined(ENABLE_WEBRTC) | 2669 #endif // defined(ENABLE_WEBRTC) |
2648 | 2670 |
2649 } // namespace chrome | 2671 } // namespace chrome |
OLD | NEW |