Chromium Code Reviews| 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_EXTENSIONS_EXTENSION_PREFS_H_ | 5 #ifndef CHROME_BROWSER_EXTENSIONS_EXTENSION_PREFS_H_ |
| 6 #define CHROME_BROWSER_EXTENSIONS_EXTENSION_PREFS_H_ | 6 #define CHROME_BROWSER_EXTENSIONS_EXTENSION_PREFS_H_ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include <set> | 9 #include <set> |
| 10 #include <string> | 10 #include <string> |
| (...skipping 153 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 164 void AcknowledgeOrphanedExtension(const std::string& extension_id); | 164 void AcknowledgeOrphanedExtension(const std::string& extension_id); |
| 165 | 165 |
| 166 // Returns true if the extension notification code has already run for the | 166 // Returns true if the extension notification code has already run for the |
| 167 // first time for this profile. Currently we use this flag to mean that any | 167 // first time for this profile. Currently we use this flag to mean that any |
| 168 // extensions that would trigger notifications should get silently | 168 // extensions that would trigger notifications should get silently |
| 169 // acknowledged. This is a fuse. Calling it the first time returns false. | 169 // acknowledged. This is a fuse. Calling it the first time returns false. |
| 170 // Subsequent calls return true. It's not possible through an API to ever | 170 // Subsequent calls return true. It's not possible through an API to ever |
| 171 // reset it. Don't call it unless you mean it! | 171 // reset it. Don't call it unless you mean it! |
| 172 bool SetAlertSystemFirstRun(); | 172 bool SetAlertSystemFirstRun(); |
| 173 | 173 |
| 174 // Whether the notifications initial setup is done for the given extension. | |
|
asargent_no_longer_on_chrome
2011/10/27 16:52:21
change "given extension" to "given app" in the com
Munjal (Google)
2011/10/27 18:35:05
Done.
| |
| 175 bool IsNotificationsInitialSetupDone(const std::string& extension_id) const; | |
| 176 void SetNotificationsInitialSetupDone(const std::string& extension_id, | |
|
asargent_no_longer_on_chrome
2011/10/27 16:52:21
Suggest changing names to:
IsAppNotificationSetup
Munjal (Google)
2011/10/27 18:35:05
Done.
| |
| 177 bool value); | |
| 178 | |
| 179 // Whether notifications are disabled for the given extension. | |
|
asargent_no_longer_on_chrome
2011/10/27 16:52:21
change "given extension" to "given app" in the com
Munjal (Google)
2011/10/27 18:35:05
Done.
| |
| 180 bool IsNotificationsDisabled(const std::string& extension_id) const; | |
| 181 void SetNotificationsDisabled(const std::string& extension_id, bool value); | |
|
asargent_no_longer_on_chrome
2011/10/27 16:52:21
Suggest changing names to:
IsAppNotificationDisab
Munjal (Google)
2011/10/27 18:35:05
Done.
| |
| 182 | |
| 174 // Is the extension with |extension_id| allowed by policy (checking both | 183 // Is the extension with |extension_id| allowed by policy (checking both |
| 175 // whitelist and blacklist). | 184 // whitelist and blacklist). |
| 176 bool IsExtensionAllowedByPolicy(const std::string& extension_id); | 185 bool IsExtensionAllowedByPolicy(const std::string& extension_id); |
| 177 | 186 |
| 178 // Returns the last value set via SetLastPingDay. If there isn't such a | 187 // Returns the last value set via SetLastPingDay. If there isn't such a |
| 179 // pref, the returned Time will return true for is_null(). | 188 // pref, the returned Time will return true for is_null(). |
| 180 base::Time LastPingDay(const std::string& extension_id) const; | 189 base::Time LastPingDay(const std::string& extension_id) const; |
| 181 | 190 |
| 182 // The time stored is based on the server's perspective of day start time, not | 191 // The time stored is based on the server's perspective of day start time, not |
| 183 // the client's. | 192 // the client's. |
| (...skipping 238 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 422 // Deletes the pref dictionary for extension |id|. | 431 // Deletes the pref dictionary for extension |id|. |
| 423 void DeleteExtensionPrefs(const std::string& id); | 432 void DeleteExtensionPrefs(const std::string& id); |
| 424 | 433 |
| 425 // Reads a boolean pref from |ext| with key |pref_key|. | 434 // Reads a boolean pref from |ext| with key |pref_key|. |
| 426 // Return false if the value is false or |pref_key| does not exist. | 435 // Return false if the value is false or |pref_key| does not exist. |
| 427 static bool ReadBooleanFromPref(const base::DictionaryValue* ext, | 436 static bool ReadBooleanFromPref(const base::DictionaryValue* ext, |
| 428 const std::string& pref_key); | 437 const std::string& pref_key); |
| 429 | 438 |
| 430 // Reads a boolean pref |pref_key| from extension with id |extension_id|. | 439 // Reads a boolean pref |pref_key| from extension with id |extension_id|. |
| 431 bool ReadExtensionPrefBoolean(const std::string& extension_id, | 440 bool ReadExtensionPrefBoolean(const std::string& extension_id, |
| 432 const std::string& pref_key); | 441 const std::string& pref_key) const; |
| 433 | 442 |
| 434 // Reads an integer pref from |ext| with key |pref_key|. | 443 // Reads an integer pref from |ext| with key |pref_key|. |
| 435 // Return false if the value does not exist. | 444 // Return false if the value does not exist. |
| 436 static bool ReadIntegerFromPref(const base::DictionaryValue* ext, | 445 static bool ReadIntegerFromPref(const base::DictionaryValue* ext, |
| 437 const std::string& pref_key, | 446 const std::string& pref_key, |
| 438 int* out_value); | 447 int* out_value); |
| 439 | 448 |
| 440 // Reads an integer pref |pref_key| from extension with id |extension_id|. | 449 // Reads an integer pref |pref_key| from extension with id |extension_id|. |
| 441 bool ReadExtensionPrefInteger(const std::string& extension_id, | 450 bool ReadExtensionPrefInteger(const std::string& extension_id, |
| 442 const std::string& pref_key, | 451 const std::string& pref_key, |
| (...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 517 | 526 |
| 518 // Weak pointer, owned by Profile. | 527 // Weak pointer, owned by Profile. |
| 519 ExtensionPrefValueMap* extension_pref_value_map_; | 528 ExtensionPrefValueMap* extension_pref_value_map_; |
| 520 | 529 |
| 521 scoped_refptr<ExtensionContentSettingsStore> content_settings_store_; | 530 scoped_refptr<ExtensionContentSettingsStore> content_settings_store_; |
| 522 | 531 |
| 523 DISALLOW_COPY_AND_ASSIGN(ExtensionPrefs); | 532 DISALLOW_COPY_AND_ASSIGN(ExtensionPrefs); |
| 524 }; | 533 }; |
| 525 | 534 |
| 526 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_PREFS_H_ | 535 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_PREFS_H_ |
| OLD | NEW |