Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(47)

Side by Side Diff: chrome/browser/extensions/extension_prefs.h

Issue 10152008: Extension alarms now persist in Preferences. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: no more TimerInfo Created 8 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 {
28 struct AlarmPref;
29 }
30
27 // Class for managing global and per-extension preferences. 31 // Class for managing global and per-extension preferences.
28 // 32 //
29 // This class distinguishes the following kinds of preferences: 33 // This class distinguishes the following kinds of preferences:
30 // - global preferences: 34 // - global preferences:
31 // internal state for the extension system in general, not associated 35 // internal state for the extension system in general, not associated
32 // with an individual extension, such as lastUpdateTime. 36 // with an individual extension, such as lastUpdateTime.
33 // - per-extension preferences: 37 // - per-extension preferences:
34 // meta-preferences describing properties of the extension like 38 // meta-preferences describing properties of the extension like
35 // installation time, whether the extension is enabled, etc. 39 // installation time, whether the extension is enabled, etc.
36 // - extension controlled preferences: 40 // - extension controlled preferences:
(...skipping 216 matching lines...) Expand 10 before | Expand all | Expand 10 after
253 257
254 // Sets the active |permissions| for the extension with |extension_id|. 258 // Sets the active |permissions| for the extension with |extension_id|.
255 void SetActivePermissions(const std::string& extension_id, 259 void SetActivePermissions(const std::string& extension_id,
256 const ExtensionPermissionSet* permissions); 260 const ExtensionPermissionSet* permissions);
257 261
258 // Returns the list of events that the given extension has registered for. 262 // Returns the list of events that the given extension has registered for.
259 std::set<std::string> GetRegisteredEvents(const std::string& extension_id); 263 std::set<std::string> GetRegisteredEvents(const std::string& extension_id);
260 void SetRegisteredEvents(const std::string& extension_id, 264 void SetRegisteredEvents(const std::string& extension_id,
261 const std::set<std::string>& events); 265 const std::set<std::string>& events);
262 266
267 // Controls a list of alarms for this extension, including the next time they
268 // should run.
269 std::vector<extensions::AlarmPref> GetRegisteredAlarms(
270 const std::string& extension_id);
271 void SetRegisteredAlarms(const std::string& extension_id,
272 const std::vector<extensions::AlarmPref>& alarms);
273
263 // Returns true if the user enabled this extension to be loaded in incognito 274 // Returns true if the user enabled this extension to be loaded in incognito
264 // mode. 275 // mode.
265 bool IsIncognitoEnabled(const std::string& extension_id); 276 bool IsIncognitoEnabled(const std::string& extension_id);
266 void SetIsIncognitoEnabled(const std::string& extension_id, bool enabled); 277 void SetIsIncognitoEnabled(const std::string& extension_id, bool enabled);
267 278
268 // Returns true if the user has chosen to allow this extension to inject 279 // Returns true if the user has chosen to allow this extension to inject
269 // scripts into pages with file URLs. 280 // scripts into pages with file URLs.
270 bool AllowFileAccess(const std::string& extension_id); 281 bool AllowFileAccess(const std::string& extension_id);
271 void SetAllowFileAccess(const std::string& extension_id, bool allow); 282 void SetAllowFileAccess(const std::string& extension_id, bool allow);
272 bool HasAllowFileAccessSetting(const std::string& extension_id) const; 283 bool HasAllowFileAccessSetting(const std::string& extension_id) const;
(...skipping 244 matching lines...) Expand 10 before | Expand all | Expand 10 after
517 // Contains all the logic for handling the order for various extension 528 // Contains all the logic for handling the order for various extension
518 // properties. 529 // properties.
519 scoped_ptr<ExtensionSorting> extension_sorting_; 530 scoped_ptr<ExtensionSorting> extension_sorting_;
520 531
521 scoped_refptr<ExtensionContentSettingsStore> content_settings_store_; 532 scoped_refptr<ExtensionContentSettingsStore> content_settings_store_;
522 533
523 DISALLOW_COPY_AND_ASSIGN(ExtensionPrefs); 534 DISALLOW_COPY_AND_ASSIGN(ExtensionPrefs);
524 }; 535 };
525 536
526 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_PREFS_H_ 537 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_PREFS_H_
OLDNEW
« no previous file with comments | « chrome/browser/extensions/api/alarms/alarm_manager.cc ('k') | chrome/browser/extensions/extension_prefs.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698