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

Side by Side Diff: chrome/browser/profiles/off_the_record_profile_impl.cc

Issue 13548003: Prevent leaking geolocation permission from Incognito (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Added a check to the test Created 7 years, 8 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
« no previous file with comments | « chrome/browser/geolocation/geolocation_browsertest.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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/file_util.h" 10 #include "base/file_util.h"
11 #include "base/files/file_path.h" 11 #include "base/files/file_path.h"
12 #include "base/memory/scoped_ptr.h" 12 #include "base/memory/scoped_ptr.h"
13 #include "base/path_service.h" 13 #include "base/path_service.h"
14 #include "base/prefs/json_pref_store.h" 14 #include "base/prefs/json_pref_store.h"
15 #include "base/string_util.h" 15 #include "base/string_util.h"
16 #include "base/strings/string_number_conversions.h" 16 #include "base/strings/string_number_conversions.h"
17 #include "build/build_config.h" 17 #include "build/build_config.h"
18 #include "chrome/browser/background/background_contents_service_factory.h" 18 #include "chrome/browser/background/background_contents_service_factory.h"
19 #include "chrome/browser/browser_process.h" 19 #include "chrome/browser/browser_process.h"
20 #include "chrome/browser/content_settings/host_content_settings_map.h" 20 #include "chrome/browser/content_settings/host_content_settings_map.h"
21 #include "chrome/browser/download/chrome_download_manager_delegate.h" 21 #include "chrome/browser/download/chrome_download_manager_delegate.h"
22 #include "chrome/browser/download/download_service.h" 22 #include "chrome/browser/download/download_service.h"
23 #include "chrome/browser/download/download_service_factory.h" 23 #include "chrome/browser/download/download_service_factory.h"
24 #include "chrome/browser/extensions/api/web_request/web_request_api.h" 24 #include "chrome/browser/extensions/api/web_request/web_request_api.h"
25 #include "chrome/browser/extensions/extension_info_map.h" 25 #include "chrome/browser/extensions/extension_info_map.h"
26 #include "chrome/browser/extensions/extension_service.h" 26 #include "chrome/browser/extensions/extension_service.h"
27 #include "chrome/browser/extensions/extension_special_storage_policy.h" 27 #include "chrome/browser/extensions/extension_special_storage_policy.h"
28 #include "chrome/browser/extensions/extension_system.h" 28 #include "chrome/browser/extensions/extension_system.h"
29 #include "chrome/browser/geolocation/chrome_geolocation_permission_context.h"
30 #include "chrome/browser/geolocation/chrome_geolocation_permission_context_facto ry.h"
29 #include "chrome/browser/io_thread.h" 31 #include "chrome/browser/io_thread.h"
30 #include "chrome/browser/net/proxy_service_factory.h" 32 #include "chrome/browser/net/proxy_service_factory.h"
31 #include "chrome/browser/plugins/chrome_plugin_service_filter.h" 33 #include "chrome/browser/plugins/chrome_plugin_service_filter.h"
32 #include "chrome/browser/plugins/plugin_prefs.h" 34 #include "chrome/browser/plugins/plugin_prefs.h"
33 #include "chrome/browser/prefs/incognito_mode_prefs.h" 35 #include "chrome/browser/prefs/incognito_mode_prefs.h"
34 #include "chrome/browser/prefs/pref_service_syncable.h" 36 #include "chrome/browser/prefs/pref_service_syncable.h"
35 #include "chrome/browser/profiles/profile_dependency_manager.h" 37 #include "chrome/browser/profiles/profile_dependency_manager.h"
36 #include "chrome/browser/themes/theme_service.h" 38 #include "chrome/browser/themes/theme_service.h"
37 #include "chrome/browser/ui/webui/extensions/extension_icon_source.h" 39 #include "chrome/browser/ui/webui/extensions/extension_icon_source.h"
38 #include "chrome/common/chrome_constants.h" 40 #include "chrome/common/chrome_constants.h"
(...skipping 278 matching lines...) Expand 10 before | Expand all | Expand 10 after
317 ExtensionService* extension_service = GetExtensionService(); 319 ExtensionService* extension_service = GetExtensionService();
318 if (extension_service) 320 if (extension_service)
319 host_content_settings_map_->RegisterExtensionService(extension_service); 321 host_content_settings_map_->RegisterExtensionService(extension_service);
320 #endif 322 #endif
321 } 323 }
322 return host_content_settings_map_.get(); 324 return host_content_settings_map_.get();
323 } 325 }
324 326
325 content::GeolocationPermissionContext* 327 content::GeolocationPermissionContext*
326 OffTheRecordProfileImpl::GetGeolocationPermissionContext() { 328 OffTheRecordProfileImpl::GetGeolocationPermissionContext() {
327 return profile_->GetGeolocationPermissionContext(); 329 return ChromeGeolocationPermissionContextFactory::GetForProfile(this);
328 } 330 }
329 331
330 content::SpeechRecognitionPreferences* 332 content::SpeechRecognitionPreferences*
331 OffTheRecordProfileImpl::GetSpeechRecognitionPreferences() { 333 OffTheRecordProfileImpl::GetSpeechRecognitionPreferences() {
332 return profile_->GetSpeechRecognitionPreferences(); 334 return profile_->GetSpeechRecognitionPreferences();
333 } 335 }
334 336
335 quota::SpecialStoragePolicy* 337 quota::SpecialStoragePolicy*
336 OffTheRecordProfileImpl::GetSpecialStoragePolicy() { 338 OffTheRecordProfileImpl::GetSpecialStoragePolicy() {
337 return GetExtensionSpecialStoragePolicy(); 339 return GetExtensionSpecialStoragePolicy();
(...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after
473 case HostZoomMap::ZOOM_CHANGED_FOR_HOST: 475 case HostZoomMap::ZOOM_CHANGED_FOR_HOST:
474 host_zoom_map->SetZoomLevelForHost(change.host, change.zoom_level); 476 host_zoom_map->SetZoomLevelForHost(change.host, change.zoom_level);
475 return; 477 return;
476 case HostZoomMap::ZOOM_CHANGED_FOR_SCHEME_AND_HOST: 478 case HostZoomMap::ZOOM_CHANGED_FOR_SCHEME_AND_HOST:
477 host_zoom_map->SetZoomLevelForHostAndScheme(change.scheme, 479 host_zoom_map->SetZoomLevelForHostAndScheme(change.scheme,
478 change.host, 480 change.host,
479 change.zoom_level); 481 change.zoom_level);
480 return; 482 return;
481 } 483 }
482 } 484 }
OLDNEW
« no previous file with comments | « chrome/browser/geolocation/geolocation_browsertest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698