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 // Maps hostnames to custom content settings. Written on the UI thread and read | 5 // Maps hostnames to custom content settings. Written on the UI thread and read |
6 // on any thread. One instance per profile. | 6 // on any thread. One instance per profile. |
7 | 7 |
8 #ifndef COMPONENTS_CONTENT_SETTINGS_CORE_BROWSER_HOST_CONTENT_SETTINGS_MAP_H_ | 8 #ifndef COMPONENTS_CONTENT_SETTINGS_CORE_BROWSER_HOST_CONTENT_SETTINGS_MAP_H_ |
9 #define COMPONENTS_CONTENT_SETTINGS_CORE_BROWSER_HOST_CONTENT_SETTINGS_MAP_H_ | 9 #define COMPONENTS_CONTENT_SETTINGS_CORE_BROWSER_HOST_CONTENT_SETTINGS_MAP_H_ |
10 | 10 |
(...skipping 21 matching lines...) Expand all Loading... | |
32 namespace base { | 32 namespace base { |
33 class Clock; | 33 class Clock; |
34 class Value; | 34 class Value; |
35 } | 35 } |
36 | 36 |
37 namespace content_settings { | 37 namespace content_settings { |
38 class ObservableProvider; | 38 class ObservableProvider; |
39 class ProviderInterface; | 39 class ProviderInterface; |
40 class PrefProvider; | 40 class PrefProvider; |
41 class TestUtils; | 41 class TestUtils; |
42 | |
43 // Enum describing status of migration process. This is to ensure that migration | |
raymes
2016/07/19 01:48:15
nit: Enum describing the status of domain to origi
lshang
2016/07/20 06:16:20
Done.
| |
44 // only done once. | |
45 enum ContentSettingMigrationStatus { | |
raymes
2016/07/19 01:48:15
We should be more specific about what migration th
lshang
2016/07/20 06:16:21
Done.
| |
46 // Haven't been migrated at all. | |
47 NOT_MIGRATED, | |
48 // Have done migration in the constructor of HostContentSettingsMap. | |
49 DONE_IN_HCSM, | |
raymes
2016/07/19 01:48:15
I would just differentiate MIGRATED_BEFORE_SYNC an
lshang
2016/07/19 07:45:56
I think we need to have three states here:
- have
lshang
2016/07/20 06:16:20
Done.
| |
50 // Have done migration both in HostContentSettingsMap construction and sync | |
51 // process(this is a clean up after sync). Migration is all finished at this | |
52 // stage. | |
53 DONE_IN_HCSM_AND_SYNC, | |
54 }; | |
raymes
2016/07/19 01:48:15
We could move this into the .cc file
lshang
2016/07/20 06:16:21
Done.
| |
42 } | 55 } |
43 | 56 |
44 namespace user_prefs { | 57 namespace user_prefs { |
45 class PrefRegistrySyncable; | 58 class PrefRegistrySyncable; |
46 } | 59 } |
47 | 60 |
48 class HostContentSettingsMap : public content_settings::Observer, | 61 class HostContentSettingsMap : public content_settings::Observer, |
49 public RefcountedKeyedService { | 62 public RefcountedKeyedService { |
50 public: | 63 public: |
51 enum ProviderType { | 64 enum ProviderType { |
(...skipping 345 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
397 base::ThreadChecker thread_checker_; | 410 base::ThreadChecker thread_checker_; |
398 | 411 |
399 base::ObserverList<content_settings::Observer> observers_; | 412 base::ObserverList<content_settings::Observer> observers_; |
400 | 413 |
401 base::WeakPtrFactory<HostContentSettingsMap> weak_ptr_factory_; | 414 base::WeakPtrFactory<HostContentSettingsMap> weak_ptr_factory_; |
402 | 415 |
403 DISALLOW_COPY_AND_ASSIGN(HostContentSettingsMap); | 416 DISALLOW_COPY_AND_ASSIGN(HostContentSettingsMap); |
404 }; | 417 }; |
405 | 418 |
406 #endif // COMPONENTS_CONTENT_SETTINGS_CORE_BROWSER_HOST_CONTENT_SETTINGS_MAP_H_ | 419 #endif // COMPONENTS_CONTENT_SETTINGS_CORE_BROWSER_HOST_CONTENT_SETTINGS_MAP_H_ |
OLD | NEW |