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

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, 2 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 1927 matching lines...) Expand 10 before | Expand all | Expand 10 after
1938 #else 1938 #else
1939 NOTIMPLEMENTED(); 1939 NOTIMPLEMENTED();
1940 #endif 1940 #endif
1941 } 1941 }
1942 1942
1943 void ChromeContentBrowserClient::RequestGeolocationPermission( 1943 void ChromeContentBrowserClient::RequestGeolocationPermission(
1944 content::WebContents* web_contents, 1944 content::WebContents* web_contents,
1945 int bridge_id, 1945 int bridge_id,
1946 const GURL& requesting_frame, 1946 const GURL& requesting_frame,
1947 bool user_gesture, 1947 bool user_gesture,
1948 base::Callback<void(bool)> result_callback, 1948 const base::Callback<void(bool)>& result_callback) {
1949 base::Closure* cancel_callback) { 1949 int render_process_id = web_contents->GetRenderProcessHost()->GetID();
1950 int render_view_id = web_contents->GetRenderViewHost()->GetRoutingID();
1951
1952 const PermissionRequestID request_id(render_process_id,
1953 render_view_id,
1954 bridge_id,
1955 requesting_frame);
1950 GeolocationPermissionContextFactory::GetForProfile( 1956 GeolocationPermissionContextFactory::GetForProfile(
1951 Profile::FromBrowserContext(web_contents->GetBrowserContext()))-> 1957 Profile::FromBrowserContext(web_contents->GetBrowserContext()))->
1952 RequestGeolocationPermission(web_contents, bridge_id, 1958 RequestPermission(web_contents, request_id,
1953 requesting_frame, user_gesture, 1959 requesting_frame.GetOrigin(), user_gesture,
1954 result_callback, cancel_callback); 1960 result_callback);
1961 }
1962
1963 void ChromeContentBrowserClient::CancelGeolocationPermissionRequest(
1964 content::WebContents* web_contents,
1965 int bridge_id,
1966 const GURL& requesting_frame) {
1967 int render_process_id = web_contents->GetRenderProcessHost()->GetID();
1968 int render_view_id = web_contents->GetRenderViewHost()->GetRoutingID();
1969
1970 const PermissionRequestID request_id(render_process_id,
1971 render_view_id,
1972 bridge_id,
1973 requesting_frame);
1974 GeolocationPermissionContextFactory::GetForProfile(
1975 Profile::FromBrowserContext(web_contents->GetBrowserContext()))->
1976 CancelPermissionRequest(web_contents, request_id);
1955 } 1977 }
1956 1978
1957 void ChromeContentBrowserClient::RequestMidiSysExPermission( 1979 void ChromeContentBrowserClient::RequestMidiSysExPermission(
1958 content::WebContents* web_contents, 1980 content::WebContents* web_contents,
1959 int bridge_id, 1981 int bridge_id,
1960 const GURL& requesting_frame, 1982 const GURL& requesting_frame,
1961 bool user_gesture, 1983 bool user_gesture,
1962 base::Callback<void(bool)> result_callback, 1984 base::Callback<void(bool)> result_callback,
1963 base::Closure* cancel_callback) { 1985 base::Closure* cancel_callback) {
1964 MidiPermissionContext* context = 1986 MidiPermissionContext* context =
(...skipping 648 matching lines...) Expand 10 before | Expand all | Expand 10 after
2613 switches::kDisableWebRtcEncryption, 2635 switches::kDisableWebRtcEncryption,
2614 }; 2636 };
2615 to_command_line->CopySwitchesFrom(from_command_line, 2637 to_command_line->CopySwitchesFrom(from_command_line,
2616 kWebRtcDevSwitchNames, 2638 kWebRtcDevSwitchNames,
2617 arraysize(kWebRtcDevSwitchNames)); 2639 arraysize(kWebRtcDevSwitchNames));
2618 } 2640 }
2619 } 2641 }
2620 #endif // defined(ENABLE_WEBRTC) 2642 #endif // defined(ENABLE_WEBRTC)
2621 2643
2622 } // namespace chrome 2644 } // namespace chrome
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698