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/api/content_settings/content_settings_store.
h" | 16 #include "chrome/browser/extensions/api/content_settings/content_settings_store.
h" |
17 #include "chrome/browser/extensions/extension_menu_manager.h" | 17 #include "chrome/browser/extensions/extension_menu_manager.h" |
18 #include "chrome/browser/extensions/extension_prefs_scope.h" | 18 #include "chrome/browser/extensions/extension_prefs_scope.h" |
19 #include "chrome/browser/extensions/extension_scoped_prefs.h" | 19 #include "chrome/browser/extensions/extension_scoped_prefs.h" |
20 #include "chrome/browser/extensions/management_policy.h" | 20 #include "chrome/browser/extensions/management_policy.h" |
21 #include "chrome/common/extensions/extension.h" | 21 #include "chrome/common/extensions/extension.h" |
22 #include "chrome/common/string_ordinal.h" | 22 #include "chrome/common/string_ordinal.h" |
23 | 23 |
24 class ExtensionPrefValueMap; | 24 class ExtensionPrefValueMap; |
25 class ExtensionSorting; | 25 class ExtensionSorting; |
26 class PrefService; | 26 class PrefService; |
27 class URLPatternSet; | 27 class URLPatternSet; |
28 | 28 |
29 namespace extensions { | 29 namespace extensions { |
30 struct AlarmPref; | 30 struct Alarm; |
31 struct ExtensionOmniboxSuggestion; | 31 struct ExtensionOmniboxSuggestion; |
32 } | 32 } |
33 | 33 |
34 // Class for managing global and per-extension preferences. | 34 // Class for managing global and per-extension preferences. |
35 // | 35 // |
36 // This class distinguishes the following kinds of preferences: | 36 // This class distinguishes the following kinds of preferences: |
37 // - global preferences: | 37 // - global preferences: |
38 // internal state for the extension system in general, not associated | 38 // internal state for the extension system in general, not associated |
39 // with an individual extension, such as lastUpdateTime. | 39 // with an individual extension, such as lastUpdateTime. |
40 // - per-extension preferences: | 40 // - per-extension preferences: |
(...skipping 229 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
270 void SetActivePermissions(const std::string& extension_id, | 270 void SetActivePermissions(const std::string& extension_id, |
271 const ExtensionPermissionSet* permissions); | 271 const ExtensionPermissionSet* permissions); |
272 | 272 |
273 // Returns the list of events that the given extension has registered for. | 273 // Returns the list of events that the given extension has registered for. |
274 std::set<std::string> GetRegisteredEvents(const std::string& extension_id); | 274 std::set<std::string> GetRegisteredEvents(const std::string& extension_id); |
275 void SetRegisteredEvents(const std::string& extension_id, | 275 void SetRegisteredEvents(const std::string& extension_id, |
276 const std::set<std::string>& events); | 276 const std::set<std::string>& events); |
277 | 277 |
278 // Controls a list of alarms for this extension, including the next time they | 278 // Controls a list of alarms for this extension, including the next time they |
279 // should run. | 279 // should run. |
280 std::vector<extensions::AlarmPref> GetRegisteredAlarms( | 280 std::vector<extensions::Alarm> GetRegisteredAlarms( |
281 const std::string& extension_id); | 281 const std::string& extension_id); |
282 void SetRegisteredAlarms(const std::string& extension_id, | 282 void SetRegisteredAlarms(const std::string& extension_id, |
283 const std::vector<extensions::AlarmPref>& alarms); | 283 const std::vector<extensions::Alarm>& alarms); |
284 | 284 |
285 // Controls the omnibox default suggestion as set by the extension. | 285 // Controls the omnibox default suggestion as set by the extension. |
286 extensions::ExtensionOmniboxSuggestion GetOmniboxDefaultSuggestion( | 286 extensions::ExtensionOmniboxSuggestion GetOmniboxDefaultSuggestion( |
287 const std::string& extension_id); | 287 const std::string& extension_id); |
288 void SetOmniboxDefaultSuggestion( | 288 void SetOmniboxDefaultSuggestion( |
289 const std::string& extension_id, | 289 const std::string& extension_id, |
290 const extensions::ExtensionOmniboxSuggestion& suggestion); | 290 const extensions::ExtensionOmniboxSuggestion& suggestion); |
291 | 291 |
292 // Controls the context menu items for this extension. | 292 // Controls the context menu items for this extension. |
293 ExtensionMenuItem::List GetContextMenuItems(const std::string& extension_id); | 293 ExtensionMenuItem::List GetContextMenuItems(const std::string& extension_id); |
(...skipping 258 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
552 // Contains all the logic for handling the order for various extension | 552 // Contains all the logic for handling the order for various extension |
553 // properties. | 553 // properties. |
554 scoped_ptr<ExtensionSorting> extension_sorting_; | 554 scoped_ptr<ExtensionSorting> extension_sorting_; |
555 | 555 |
556 scoped_refptr<extensions::ContentSettingsStore> content_settings_store_; | 556 scoped_refptr<extensions::ContentSettingsStore> content_settings_store_; |
557 | 557 |
558 DISALLOW_COPY_AND_ASSIGN(ExtensionPrefs); | 558 DISALLOW_COPY_AND_ASSIGN(ExtensionPrefs); |
559 }; | 559 }; |
560 | 560 |
561 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_PREFS_H_ | 561 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_PREFS_H_ |
OLD | NEW |