| OLD | NEW |
| 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/profile_io_data.h" | 5 #include "chrome/browser/profiles/profile_io_data.h" |
| 6 | 6 |
| 7 #include <string> | 7 #include <string> |
| 8 | 8 |
| 9 #include "base/basictypes.h" | 9 #include "base/basictypes.h" |
| 10 #include "base/bind.h" | 10 #include "base/bind.h" |
| (...skipping 937 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 948 bound_callback.Run(); | 948 bound_callback.Run(); |
| 949 return; | 949 return; |
| 950 } | 950 } |
| 951 // Otherwise, the InitializeSlot will run the callback asynchronously. | 951 // Otherwise, the InitializeSlot will run the callback asynchronously. |
| 952 #else | 952 #else |
| 953 callback.Run(make_scoped_ptr( | 953 callback.Run(make_scoped_ptr( |
| 954 new net::KeygenHandler(key_size_in_bits, challenge_string, url))); | 954 new net::KeygenHandler(key_size_in_bits, challenge_string, url))); |
| 955 #endif | 955 #endif |
| 956 } | 956 } |
| 957 | 957 |
| 958 bool ProfileIOData::ResourceContext::AllowMicAccess(const GURL& origin) { | |
| 959 return AllowContentAccess(origin, CONTENT_SETTINGS_TYPE_MEDIASTREAM_MIC); | |
| 960 } | |
| 961 | |
| 962 bool ProfileIOData::ResourceContext::AllowCameraAccess(const GURL& origin) { | |
| 963 return AllowContentAccess(origin, CONTENT_SETTINGS_TYPE_MEDIASTREAM_CAMERA); | |
| 964 } | |
| 965 | |
| 966 bool ProfileIOData::ResourceContext::AllowContentAccess( | |
| 967 const GURL& origin, ContentSettingsType type) { | |
| 968 HostContentSettingsMap* content_settings = | |
| 969 io_data_->GetHostContentSettingsMap(); | |
| 970 ContentSetting setting = content_settings->GetContentSetting( | |
| 971 origin, origin, type, NO_RESOURCE_IDENTIFIER); | |
| 972 return setting == CONTENT_SETTING_ALLOW; | |
| 973 } | |
| 974 | |
| 975 ResourceContext::SaltCallback | 958 ResourceContext::SaltCallback |
| 976 ProfileIOData::ResourceContext::GetMediaDeviceIDSalt() { | 959 ProfileIOData::ResourceContext::GetMediaDeviceIDSalt() { |
| 977 return io_data_->GetMediaDeviceIDSalt(); | 960 return io_data_->GetMediaDeviceIDSalt(); |
| 978 } | 961 } |
| 979 | 962 |
| 980 // static | 963 // static |
| 981 std::string ProfileIOData::GetSSLSessionCacheShard() { | 964 std::string ProfileIOData::GetSSLSessionCacheShard() { |
| 982 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); | 965 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); |
| 983 // The SSL session cache is partitioned by setting a string. This returns a | 966 // The SSL session cache is partitioned by setting a string. This returns a |
| 984 // unique string to partition the SSL session cache. Each time we create a | 967 // unique string to partition the SSL session cache. Each time we create a |
| (...skipping 315 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1300 void ProfileIOData::SetCookieSettingsForTesting( | 1283 void ProfileIOData::SetCookieSettingsForTesting( |
| 1301 CookieSettings* cookie_settings) { | 1284 CookieSettings* cookie_settings) { |
| 1302 DCHECK(!cookie_settings_.get()); | 1285 DCHECK(!cookie_settings_.get()); |
| 1303 cookie_settings_ = cookie_settings; | 1286 cookie_settings_ = cookie_settings; |
| 1304 } | 1287 } |
| 1305 | 1288 |
| 1306 void ProfileIOData::set_signin_names_for_testing( | 1289 void ProfileIOData::set_signin_names_for_testing( |
| 1307 SigninNamesOnIOThread* signin_names) { | 1290 SigninNamesOnIOThread* signin_names) { |
| 1308 signin_names_.reset(signin_names); | 1291 signin_names_.reset(signin_names); |
| 1309 } | 1292 } |
| OLD | NEW |