| 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 #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> |
| 11 #include <vector> | 11 #include <vector> |
| 12 | 12 |
| 13 #include "base/memory/linked_ptr.h" | 13 #include "base/memory/linked_ptr.h" |
| 14 #include "base/time.h" | 14 #include "base/time.h" |
| 15 #include "base/values.h" | 15 #include "base/values.h" |
| 16 #include "chrome/browser/extensions/extension_content_settings_store.h" | 16 #include "chrome/browser/extensions/extension_content_settings_store.h" |
| 17 #include "chrome/browser/extensions/extension_prefs_scope.h" | 17 #include "chrome/browser/extensions/extension_prefs_scope.h" |
| 18 #include "chrome/browser/extensions/extension_scoped_prefs.h" | 18 #include "chrome/browser/extensions/extension_scoped_prefs.h" |
| 19 #include "chrome/common/extensions/extension.h" | 19 #include "chrome/common/extensions/extension.h" |
| 20 #include "chrome/common/string_ordinal.h" | 20 #include "chrome/common/string_ordinal.h" |
| 21 | 21 |
| 22 class ExtensionPrefValueMap; | 22 class ExtensionPrefValueMap; |
| 23 class ExtensionSorting; | 23 class ExtensionSorting; |
| 24 class PrefService; | 24 class PrefService; |
| 25 class URLPatternSet; | 25 class URLPatternSet; |
| 26 | 26 |
| 27 namespace extensions { | 27 namespace extensions { |
| 28 struct AlarmPref; | 28 struct AlarmPref; |
| 29 struct ExtensionOmniboxSuggestion; |
| 29 } | 30 } |
| 30 | 31 |
| 31 // Class for managing global and per-extension preferences. | 32 // Class for managing global and per-extension preferences. |
| 32 // | 33 // |
| 33 // This class distinguishes the following kinds of preferences: | 34 // This class distinguishes the following kinds of preferences: |
| 34 // - global preferences: | 35 // - global preferences: |
| 35 // internal state for the extension system in general, not associated | 36 // internal state for the extension system in general, not associated |
| 36 // with an individual extension, such as lastUpdateTime. | 37 // with an individual extension, such as lastUpdateTime. |
| 37 // - per-extension preferences: | 38 // - per-extension preferences: |
| 38 // meta-preferences describing properties of the extension like | 39 // meta-preferences describing properties of the extension like |
| (...skipping 225 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 264 void SetRegisteredEvents(const std::string& extension_id, | 265 void SetRegisteredEvents(const std::string& extension_id, |
| 265 const std::set<std::string>& events); | 266 const std::set<std::string>& events); |
| 266 | 267 |
| 267 // Controls a list of alarms for this extension, including the next time they | 268 // Controls a list of alarms for this extension, including the next time they |
| 268 // should run. | 269 // should run. |
| 269 std::vector<extensions::AlarmPref> GetRegisteredAlarms( | 270 std::vector<extensions::AlarmPref> GetRegisteredAlarms( |
| 270 const std::string& extension_id); | 271 const std::string& extension_id); |
| 271 void SetRegisteredAlarms(const std::string& extension_id, | 272 void SetRegisteredAlarms(const std::string& extension_id, |
| 272 const std::vector<extensions::AlarmPref>& alarms); | 273 const std::vector<extensions::AlarmPref>& alarms); |
| 273 | 274 |
| 275 // Controls the omnibox default suggestion as set by the extension. |
| 276 extensions::ExtensionOmniboxSuggestion GetOmniboxDefaultSuggestion( |
| 277 const std::string& extension_id); |
| 278 void SetOmniboxDefaultSuggestion( |
| 279 const std::string& extension_id, |
| 280 const extensions::ExtensionOmniboxSuggestion& suggestion); |
| 281 |
| 274 // Returns true if the user enabled this extension to be loaded in incognito | 282 // Returns true if the user enabled this extension to be loaded in incognito |
| 275 // mode. | 283 // mode. |
| 276 bool IsIncognitoEnabled(const std::string& extension_id); | 284 bool IsIncognitoEnabled(const std::string& extension_id); |
| 277 void SetIsIncognitoEnabled(const std::string& extension_id, bool enabled); | 285 void SetIsIncognitoEnabled(const std::string& extension_id, bool enabled); |
| 278 | 286 |
| 279 // Returns true if the user has chosen to allow this extension to inject | 287 // Returns true if the user has chosen to allow this extension to inject |
| 280 // scripts into pages with file URLs. | 288 // scripts into pages with file URLs. |
| 281 bool AllowFileAccess(const std::string& extension_id); | 289 bool AllowFileAccess(const std::string& extension_id); |
| 282 void SetAllowFileAccess(const std::string& extension_id, bool allow); | 290 void SetAllowFileAccess(const std::string& extension_id, bool allow); |
| 283 bool HasAllowFileAccessSetting(const std::string& extension_id) const; | 291 bool HasAllowFileAccessSetting(const std::string& extension_id) const; |
| (...skipping 244 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 528 // Contains all the logic for handling the order for various extension | 536 // Contains all the logic for handling the order for various extension |
| 529 // properties. | 537 // properties. |
| 530 scoped_ptr<ExtensionSorting> extension_sorting_; | 538 scoped_ptr<ExtensionSorting> extension_sorting_; |
| 531 | 539 |
| 532 scoped_refptr<ExtensionContentSettingsStore> content_settings_store_; | 540 scoped_refptr<ExtensionContentSettingsStore> content_settings_store_; |
| 533 | 541 |
| 534 DISALLOW_COPY_AND_ASSIGN(ExtensionPrefs); | 542 DISALLOW_COPY_AND_ASSIGN(ExtensionPrefs); |
| 535 }; | 543 }; |
| 536 | 544 |
| 537 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_PREFS_H_ | 545 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_PREFS_H_ |
| OLD | NEW |