| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 #ifndef CHROME_BROWSER_CONTENT_SETTINGS_CONTENT_SETTINGS_BASE_PROVIDER_H_ | 5 #ifndef CHROME_BROWSER_CONTENT_SETTINGS_CONTENT_SETTINGS_BASE_PROVIDER_H_ |
| 6 #define CHROME_BROWSER_CONTENT_SETTINGS_CONTENT_SETTINGS_BASE_PROVIDER_H_ | 6 #define CHROME_BROWSER_CONTENT_SETTINGS_CONTENT_SETTINGS_BASE_PROVIDER_H_ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include <map> | 9 #include <map> |
| 10 #include <string> | 10 #include <string> |
| (...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 93 | 93 |
| 94 // TODO(markusheintz): LEGACY method. Will be removed in a future re-factoring | 94 // TODO(markusheintz): LEGACY method. Will be removed in a future re-factoring |
| 95 // step. | 95 // step. |
| 96 ContentSettings GetNonDefaultContentSettings(const GURL& url) const; | 96 ContentSettings GetNonDefaultContentSettings(const GURL& url) const; |
| 97 | 97 |
| 98 // Accessors | 98 // Accessors |
| 99 HostContentSettings* host_content_settings() { | 99 HostContentSettings* host_content_settings() { |
| 100 return &host_content_settings_; | 100 return &host_content_settings_; |
| 101 } | 101 } |
| 102 | 102 |
| 103 HostContentSettings* off_the_record_settings() { | 103 HostContentSettings* incognito_settings() { |
| 104 return &off_the_record_settings_; | 104 return &incognito_settings_; |
| 105 } | 105 } |
| 106 | 106 |
| 107 base::Lock& lock() const { | 107 base::Lock& lock() const { |
| 108 return lock_; | 108 return lock_; |
| 109 } | 109 } |
| 110 | 110 |
| 111 bool is_off_the_record() const { | 111 bool is_incognito() const { |
| 112 return is_off_the_record_; | 112 return is_incognito_; |
| 113 } | 113 } |
| 114 | 114 |
| 115 private: | 115 private: |
| 116 // Copies of the pref data, so that we can read it on threads other than the | 116 // Copies of the pref data, so that we can read it on threads other than the |
| 117 // UI thread. | 117 // UI thread. |
| 118 HostContentSettings host_content_settings_; | 118 HostContentSettings host_content_settings_; |
| 119 | 119 |
| 120 // Whether this settings map is for an OTR session. | 120 // Whether this settings map is for an OTR session. |
| 121 bool is_off_the_record_; | 121 bool is_incognito_; |
| 122 | 122 |
| 123 // Differences to the preference-stored host content settings for | 123 // Differences to the preference-stored host content settings for |
| 124 // incognito settings. | 124 // incognito settings. |
| 125 HostContentSettings off_the_record_settings_; | 125 HostContentSettings incognito_settings_; |
| 126 | 126 |
| 127 // Used around accesses to the content_settings_ object to guarantee | 127 // Used around accesses to the content_settings_ object to guarantee |
| 128 // thread safety. | 128 // thread safety. |
| 129 mutable base::Lock lock_; | 129 mutable base::Lock lock_; |
| 130 }; | 130 }; |
| 131 | 131 |
| 132 } // namespace content_settings | 132 } // namespace content_settings |
| 133 | 133 |
| 134 #endif // CHROME_BROWSER_CONTENT_SETTINGS_CONTENT_SETTINGS_BASE_PROVIDER_H_ | 134 #endif // CHROME_BROWSER_CONTENT_SETTINGS_CONTENT_SETTINGS_BASE_PROVIDER_H_ |
| OLD | NEW |