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

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

Issue 335993002: Convert MIDI permission requests to use WebContents in preparation for switching the code to using … (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 6 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 28 matching lines...) Expand all
39 #include "chrome/browser/extensions/extension_util.h" 39 #include "chrome/browser/extensions/extension_util.h"
40 #include "chrome/browser/extensions/extension_web_ui.h" 40 #include "chrome/browser/extensions/extension_web_ui.h"
41 #include "chrome/browser/extensions/extension_webkit_preferences.h" 41 #include "chrome/browser/extensions/extension_webkit_preferences.h"
42 #include "chrome/browser/extensions/suggest_permission_util.h" 42 #include "chrome/browser/extensions/suggest_permission_util.h"
43 #include "chrome/browser/geolocation/chrome_access_token_store.h" 43 #include "chrome/browser/geolocation/chrome_access_token_store.h"
44 #include "chrome/browser/geolocation/geolocation_permission_context.h" 44 #include "chrome/browser/geolocation/geolocation_permission_context.h"
45 #include "chrome/browser/geolocation/geolocation_permission_context_factory.h" 45 #include "chrome/browser/geolocation/geolocation_permission_context_factory.h"
46 #include "chrome/browser/google/google_util.h" 46 #include "chrome/browser/google/google_util.h"
47 #include "chrome/browser/media/cast_transport_host_filter.h" 47 #include "chrome/browser/media/cast_transport_host_filter.h"
48 #include "chrome/browser/media/media_capture_devices_dispatcher.h" 48 #include "chrome/browser/media/media_capture_devices_dispatcher.h"
49 #include "chrome/browser/media/midi_permission_context.h"
50 #include "chrome/browser/media/midi_permission_context_factory.h"
49 #include "chrome/browser/metrics/chrome_browser_main_extra_parts_metrics.h" 51 #include "chrome/browser/metrics/chrome_browser_main_extra_parts_metrics.h"
50 #include "chrome/browser/nacl_host/nacl_browser_delegate_impl.h" 52 #include "chrome/browser/nacl_host/nacl_browser_delegate_impl.h"
51 #include "chrome/browser/net/chrome_net_log.h" 53 #include "chrome/browser/net/chrome_net_log.h"
52 #include "chrome/browser/notifications/desktop_notification_service.h" 54 #include "chrome/browser/notifications/desktop_notification_service.h"
53 #include "chrome/browser/notifications/desktop_notification_service_factory.h" 55 #include "chrome/browser/notifications/desktop_notification_service_factory.h"
54 #include "chrome/browser/platform_util.h" 56 #include "chrome/browser/platform_util.h"
55 #include "chrome/browser/plugins/plugin_info_message_filter.h" 57 #include "chrome/browser/plugins/plugin_info_message_filter.h"
56 #include "chrome/browser/prerender/prerender_final_status.h" 58 #include "chrome/browser/prerender/prerender_final_status.h"
57 #include "chrome/browser/prerender/prerender_manager.h" 59 #include "chrome/browser/prerender/prerender_manager.h"
58 #include "chrome/browser/prerender/prerender_manager_factory.h" 60 #include "chrome/browser/prerender/prerender_manager_factory.h"
(...skipping 2092 matching lines...) Expand 10 before | Expand all | Expand 10 after
2151 bool user_gesture, 2153 bool user_gesture,
2152 base::Callback<void(bool)> result_callback, 2154 base::Callback<void(bool)> result_callback,
2153 base::Closure* cancel_callback) { 2155 base::Closure* cancel_callback) {
2154 GeolocationPermissionContextFactory::GetForProfile( 2156 GeolocationPermissionContextFactory::GetForProfile(
2155 Profile::FromBrowserContext(web_contents->GetBrowserContext()))-> 2157 Profile::FromBrowserContext(web_contents->GetBrowserContext()))->
2156 RequestGeolocationPermission(web_contents, bridge_id, 2158 RequestGeolocationPermission(web_contents, bridge_id,
2157 requesting_frame, user_gesture, 2159 requesting_frame, user_gesture,
2158 result_callback, cancel_callback); 2160 result_callback, cancel_callback);
2159 } 2161 }
2160 2162
2163 void ChromeContentBrowserClient::RequestMidiSysExPermission(
2164 content::WebContents* web_contents,
2165 int bridge_id,
2166 const GURL& requesting_frame,
2167 bool user_gesture,
2168 base::Callback<void(bool)> result_callback,
2169 base::Closure* cancel_callback) {
2170 MidiPermissionContext* context =
2171 MidiPermissionContextFactory::GetForProfile(
2172 Profile::FromBrowserContext(web_contents->GetBrowserContext()));
2173 context->RequestMidiSysExPermission(web_contents, bridge_id, requesting_frame,
2174 user_gesture, result_callback,
2175 cancel_callback);
2176 }
2177
2161 bool ChromeContentBrowserClient::CanCreateWindow( 2178 bool ChromeContentBrowserClient::CanCreateWindow(
2162 const GURL& opener_url, 2179 const GURL& opener_url,
2163 const GURL& opener_top_level_frame_url, 2180 const GURL& opener_top_level_frame_url,
2164 const GURL& source_origin, 2181 const GURL& source_origin,
2165 WindowContainerType container_type, 2182 WindowContainerType container_type,
2166 const GURL& target_url, 2183 const GURL& target_url,
2167 const content::Referrer& referrer, 2184 const content::Referrer& referrer,
2168 WindowOpenDisposition disposition, 2185 WindowOpenDisposition disposition,
2169 const WebWindowFeatures& features, 2186 const WebWindowFeatures& features,
2170 bool user_gesture, 2187 bool user_gesture,
(...skipping 625 matching lines...) Expand 10 before | Expand all | Expand 10 after
2796 switches::kDisableWebRtcEncryption, 2813 switches::kDisableWebRtcEncryption,
2797 }; 2814 };
2798 to_command_line->CopySwitchesFrom(from_command_line, 2815 to_command_line->CopySwitchesFrom(from_command_line,
2799 kWebRtcDevSwitchNames, 2816 kWebRtcDevSwitchNames,
2800 arraysize(kWebRtcDevSwitchNames)); 2817 arraysize(kWebRtcDevSwitchNames));
2801 } 2818 }
2802 } 2819 }
2803 #endif // defined(ENABLE_WEBRTC) 2820 #endif // defined(ENABLE_WEBRTC)
2804 2821
2805 } // namespace chrome 2822 } // namespace chrome
OLDNEW
« no previous file with comments | « chrome/browser/chrome_content_browser_client.h ('k') | chrome/browser/media/chrome_midi_permission_context.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698