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

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: rebase Created 6 years, 3 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 1911 matching lines...) Expand 10 before | Expand all | Expand 10 after
1922 #else 1922 #else
1923 NOTIMPLEMENTED(); 1923 NOTIMPLEMENTED();
1924 #endif 1924 #endif
1925 } 1925 }
1926 1926
1927 void ChromeContentBrowserClient::RequestGeolocationPermission( 1927 void ChromeContentBrowserClient::RequestGeolocationPermission(
1928 content::WebContents* web_contents, 1928 content::WebContents* web_contents,
1929 int bridge_id, 1929 int bridge_id,
1930 const GURL& requesting_frame, 1930 const GURL& requesting_frame,
1931 bool user_gesture, 1931 bool user_gesture,
1932 base::Callback<void(bool)> result_callback, 1932 const base::Callback<void(bool)>& result_callback) {
1933 base::Closure* cancel_callback) { 1933 int render_process_id = web_contents->GetRenderProcessHost()->GetID();
1934 int render_view_id = web_contents->GetRenderViewHost()->GetRoutingID();
1935
1936 const PermissionRequestID request_id(render_process_id,
1937 render_view_id,
1938 bridge_id,
1939 requesting_frame);
1934 GeolocationPermissionContextFactory::GetForProfile( 1940 GeolocationPermissionContextFactory::GetForProfile(
1935 Profile::FromBrowserContext(web_contents->GetBrowserContext()))-> 1941 Profile::FromBrowserContext(web_contents->GetBrowserContext()))->
1936 RequestGeolocationPermission(web_contents, bridge_id, 1942 RequestPermission(web_contents, request_id,
1937 requesting_frame, user_gesture, 1943 requesting_frame.GetOrigin(), user_gesture,
1938 result_callback, cancel_callback); 1944 result_callback);
1945 }
1946
1947 void ChromeContentBrowserClient::CancelGeolocationPermissionRequest(
1948 content::WebContents* web_contents,
1949 int bridge_id,
1950 const GURL& requesting_frame) {
1951 int render_process_id = web_contents->GetRenderProcessHost()->GetID();
1952 int render_view_id = web_contents->GetRenderViewHost()->GetRoutingID();
1953
1954 const PermissionRequestID request_id(render_process_id,
1955 render_view_id,
1956 bridge_id,
1957 requesting_frame);
1958 GeolocationPermissionContextFactory::GetForProfile(
1959 Profile::FromBrowserContext(web_contents->GetBrowserContext()))->
1960 CancelPermissionRequest(web_contents, request_id);
1939 } 1961 }
1940 1962
1941 void ChromeContentBrowserClient::RequestMidiSysExPermission( 1963 void ChromeContentBrowserClient::RequestMidiSysExPermission(
1942 content::WebContents* web_contents, 1964 content::WebContents* web_contents,
1943 int bridge_id, 1965 int bridge_id,
1944 const GURL& requesting_frame, 1966 const GURL& requesting_frame,
1945 bool user_gesture, 1967 bool user_gesture,
1946 base::Callback<void(bool)> result_callback, 1968 base::Callback<void(bool)> result_callback,
1947 base::Closure* cancel_callback) { 1969 base::Closure* cancel_callback) {
1948 MidiPermissionContext* context = 1970 MidiPermissionContext* context =
(...skipping 644 matching lines...) Expand 10 before | Expand all | Expand 10 after
2593 switches::kDisableWebRtcEncryption, 2615 switches::kDisableWebRtcEncryption,
2594 }; 2616 };
2595 to_command_line->CopySwitchesFrom(from_command_line, 2617 to_command_line->CopySwitchesFrom(from_command_line,
2596 kWebRtcDevSwitchNames, 2618 kWebRtcDevSwitchNames,
2597 arraysize(kWebRtcDevSwitchNames)); 2619 arraysize(kWebRtcDevSwitchNames));
2598 } 2620 }
2599 } 2621 }
2600 #endif // defined(ENABLE_WEBRTC) 2622 #endif // defined(ENABLE_WEBRTC)
2601 2623
2602 } // namespace chrome 2624 } // namespace chrome
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698