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

Side by Side Diff: chrome/browser/profiles/off_the_record_profile_impl.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/profiles/off_the_record_profile_impl.h" 5 #include "chrome/browser/profiles/off_the_record_profile_impl.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/command_line.h" 8 #include "base/command_line.h"
9 #include "base/compiler_specific.h" 9 #include "base/compiler_specific.h"
10 #include "base/files/file_path.h" 10 #include "base/files/file_path.h"
11 #include "base/memory/scoped_ptr.h" 11 #include "base/memory/scoped_ptr.h"
12 #include "base/path_service.h" 12 #include "base/path_service.h"
13 #include "base/prefs/json_pref_store.h" 13 #include "base/prefs/json_pref_store.h"
14 #include "base/strings/string_number_conversions.h" 14 #include "base/strings/string_number_conversions.h"
15 #include "base/strings/string_util.h" 15 #include "base/strings/string_util.h"
16 #include "build/build_config.h" 16 #include "build/build_config.h"
17 #include "chrome/browser/background/background_contents_service_factory.h" 17 #include "chrome/browser/background/background_contents_service_factory.h"
18 #include "chrome/browser/browser_process.h" 18 #include "chrome/browser/browser_process.h"
19 #include "chrome/browser/content_settings/host_content_settings_map.h" 19 #include "chrome/browser/content_settings/host_content_settings_map.h"
20 #include "chrome/browser/download/chrome_download_manager_delegate.h" 20 #include "chrome/browser/download/chrome_download_manager_delegate.h"
21 #include "chrome/browser/download/download_service.h" 21 #include "chrome/browser/download/download_service.h"
22 #include "chrome/browser/download/download_service_factory.h" 22 #include "chrome/browser/download/download_service_factory.h"
23 #include "chrome/browser/extensions/api/web_request/web_request_api.h" 23 #include "chrome/browser/extensions/api/web_request/web_request_api.h"
24 #include "chrome/browser/extensions/extension_service.h" 24 #include "chrome/browser/extensions/extension_service.h"
25 #include "chrome/browser/extensions/extension_special_storage_policy.h" 25 #include "chrome/browser/extensions/extension_special_storage_policy.h"
26 #include "chrome/browser/io_thread.h" 26 #include "chrome/browser/io_thread.h"
27 #include "chrome/browser/media/chrome_midi_permission_context.h"
28 #include "chrome/browser/media/chrome_midi_permission_context_factory.h"
29 #include "chrome/browser/net/pref_proxy_config_tracker.h" 27 #include "chrome/browser/net/pref_proxy_config_tracker.h"
30 #include "chrome/browser/net/proxy_service_factory.h" 28 #include "chrome/browser/net/proxy_service_factory.h"
31 #include "chrome/browser/plugins/chrome_plugin_service_filter.h" 29 #include "chrome/browser/plugins/chrome_plugin_service_filter.h"
32 #include "chrome/browser/plugins/plugin_prefs.h" 30 #include "chrome/browser/plugins/plugin_prefs.h"
33 #include "chrome/browser/prefs/incognito_mode_prefs.h" 31 #include "chrome/browser/prefs/incognito_mode_prefs.h"
34 #include "chrome/browser/prefs/pref_service_syncable.h" 32 #include "chrome/browser/prefs/pref_service_syncable.h"
35 #include "chrome/browser/themes/theme_service.h" 33 #include "chrome/browser/themes/theme_service.h"
36 #include "chrome/browser/ui/webui/extensions/extension_icon_source.h" 34 #include "chrome/browser/ui/webui/extensions/extension_icon_source.h"
37 #include "chrome/common/chrome_constants.h" 35 #include "chrome/common/chrome_constants.h"
38 #include "chrome/common/chrome_paths.h" 36 #include "chrome/common/chrome_paths.h"
(...skipping 272 matching lines...) Expand 10 before | Expand all | Expand 10 after
311 } 309 }
312 310
313 net::URLRequestContextGetter* 311 net::URLRequestContextGetter*
314 OffTheRecordProfileImpl::GetMediaRequestContextForStoragePartition( 312 OffTheRecordProfileImpl::GetMediaRequestContextForStoragePartition(
315 const base::FilePath& partition_path, 313 const base::FilePath& partition_path,
316 bool in_memory) { 314 bool in_memory) {
317 return io_data_->GetIsolatedAppRequestContextGetter(partition_path, in_memory) 315 return io_data_->GetIsolatedAppRequestContextGetter(partition_path, in_memory)
318 .get(); 316 .get();
319 } 317 }
320 318
321 void OffTheRecordProfileImpl::RequestMidiSysExPermission(
322 int render_process_id,
323 int render_view_id,
324 int bridge_id,
325 const GURL& requesting_frame,
326 bool user_gesture,
327 const MidiSysExPermissionCallback& callback) {
328 ChromeMidiPermissionContext* context =
329 ChromeMidiPermissionContextFactory::GetForProfile(this);
330 context->RequestMidiSysExPermission(render_process_id,
331 render_view_id,
332 bridge_id,
333 requesting_frame,
334 user_gesture,
335 callback);
336 }
337
338 void OffTheRecordProfileImpl::CancelMidiSysExPermissionRequest(
339 int render_process_id,
340 int render_view_id,
341 int bridge_id,
342 const GURL& requesting_frame) {
343 ChromeMidiPermissionContext* context =
344 ChromeMidiPermissionContextFactory::GetForProfile(this);
345 context->CancelMidiSysExPermissionRequest(
346 render_process_id, render_view_id, bridge_id, requesting_frame);
347 }
348
349 void OffTheRecordProfileImpl::RequestProtectedMediaIdentifierPermission( 319 void OffTheRecordProfileImpl::RequestProtectedMediaIdentifierPermission(
350 int render_process_id, 320 int render_process_id,
351 int render_view_id, 321 int render_view_id,
352 const GURL& origin, 322 const GURL& origin,
353 const ProtectedMediaIdentifierPermissionCallback& callback) { 323 const ProtectedMediaIdentifierPermissionCallback& callback) {
354 #if defined(OS_ANDROID) 324 #if defined(OS_ANDROID)
355 ProtectedMediaIdentifierPermissionContext* context = 325 ProtectedMediaIdentifierPermissionContext* context =
356 ProtectedMediaIdentifierPermissionContextFactory::GetForProfile(this); 326 ProtectedMediaIdentifierPermissionContextFactory::GetForProfile(this);
357 context->RequestProtectedMediaIdentifierPermission(render_process_id, 327 context->RequestProtectedMediaIdentifierPermission(render_process_id,
358 render_view_id, 328 render_view_id,
(...skipping 235 matching lines...) Expand 10 before | Expand all | Expand 10 after
594 PrefProxyConfigTracker* OffTheRecordProfileImpl::CreateProxyConfigTracker() { 564 PrefProxyConfigTracker* OffTheRecordProfileImpl::CreateProxyConfigTracker() {
595 #if defined(OS_CHROMEOS) 565 #if defined(OS_CHROMEOS)
596 if (chromeos::ProfileHelper::IsSigninProfile(this)) { 566 if (chromeos::ProfileHelper::IsSigninProfile(this)) {
597 return ProxyServiceFactory::CreatePrefProxyConfigTrackerOfLocalState( 567 return ProxyServiceFactory::CreatePrefProxyConfigTrackerOfLocalState(
598 g_browser_process->local_state()); 568 g_browser_process->local_state());
599 } 569 }
600 #endif // defined(OS_CHROMEOS) 570 #endif // defined(OS_CHROMEOS)
601 return ProxyServiceFactory::CreatePrefProxyConfigTrackerOfProfile( 571 return ProxyServiceFactory::CreatePrefProxyConfigTrackerOfProfile(
602 GetPrefs(), g_browser_process->local_state()); 572 GetPrefs(), g_browser_process->local_state());
603 } 573 }
OLDNEW
« no previous file with comments | « chrome/browser/profiles/off_the_record_profile_impl.h ('k') | chrome/browser/profiles/profile_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698