| OLD | NEW |
| 1 // Copyright (c) 2015 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2015 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/content_settings/content_settings_supervised_provider.h
" | 5 #include "chrome/browser/content_settings/content_settings_supervised_provider.h
" |
| 6 | 6 |
| 7 #include <string> | 7 #include <string> |
| 8 #include <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 #include "chrome/browser/supervised_user/supervised_user_constants.h" | 10 #include "chrome/browser/supervised_user/supervised_user_constants.h" |
| 11 #include "chrome/browser/supervised_user/supervised_user_settings_service.h" | 11 #include "chrome/browser/supervised_user/supervised_user_settings_service.h" |
| 12 | 12 |
| 13 namespace { | 13 namespace { |
| 14 | 14 |
| 15 struct ContentSettingsFromSupervisedSettingsEntry { | 15 struct ContentSettingsFromSupervisedSettingsEntry { |
| 16 const char* setting_name; | 16 const char* setting_name; |
| 17 ContentSettingsType content_type; | 17 ContentSettingsType content_type; |
| 18 }; | 18 }; |
| 19 | 19 |
| 20 const ContentSettingsFromSupervisedSettingsEntry | 20 const ContentSettingsFromSupervisedSettingsEntry |
| 21 kContentSettingsFromSupervisedSettingsMap[] = { | 21 kContentSettingsFromSupervisedSettingsMap[] = { |
| 22 { | 22 { |
| 23 supervised_users::kGeolocationDisabled, | 23 supervised_users::kGeolocationDisabled, |
| 24 CONTENT_SETTINGS_TYPE_GEOLOCATION, | 24 CONTENT_SETTINGS_TYPE_GEOLOCATION, |
| 25 }, { | 25 }, { |
| 26 supervised_users::kCameraMicDisabled, | 26 supervised_users::kCameraMicDisabled, |
| 27 CONTENT_SETTINGS_TYPE_MEDIASTREAM, | 27 CONTENT_SETTINGS_TYPE_MEDIASTREAM_CAMERA, |
| 28 }, { |
| 29 supervised_users::kCameraMicDisabled, |
| 30 CONTENT_SETTINGS_TYPE_MEDIASTREAM_MIC, |
| 28 } | 31 } |
| 29 }; | 32 }; |
| 30 | 33 |
| 31 } // namespace | 34 } // namespace |
| 32 | 35 |
| 33 namespace content_settings { | 36 namespace content_settings { |
| 34 | 37 |
| 35 SupervisedProvider::SupervisedProvider( | 38 SupervisedProvider::SupervisedProvider( |
| 36 SupervisedUserSettingsService* supervised_user_settings_service) | 39 SupervisedUserSettingsService* supervised_user_settings_service) |
| 37 : weak_ptr_factory_(this) { | 40 : weak_ptr_factory_(this) { |
| (...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 92 ContentSettingsType content_type) { | 95 ContentSettingsType content_type) { |
| 93 } | 96 } |
| 94 | 97 |
| 95 void SupervisedProvider::ShutdownOnUIThread() { | 98 void SupervisedProvider::ShutdownOnUIThread() { |
| 96 DCHECK(CalledOnValidThread()); | 99 DCHECK(CalledOnValidThread()); |
| 97 RemoveAllObservers(); | 100 RemoveAllObservers(); |
| 98 weak_ptr_factory_.InvalidateWeakPtrs(); | 101 weak_ptr_factory_.InvalidateWeakPtrs(); |
| 99 } | 102 } |
| 100 | 103 |
| 101 } // namespace content_settings | 104 } // namespace content_settings |
| OLD | NEW |