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 | 7 |
8 #include <set> | 8 #include <set> |
9 #include <string> | 9 #include <string> |
10 #include <vector> | 10 #include <vector> |
11 | 11 |
12 #include "base/memory/linked_ptr.h" | 12 #include "base/memory/linked_ptr.h" |
13 #include "base/time.h" | 13 #include "base/time.h" |
14 #include "base/values.h" | 14 #include "base/values.h" |
15 #include "chrome/browser/extensions/api/content_settings/content_settings_store.
h" | 15 #include "chrome/browser/extensions/api/content_settings/content_settings_store.
h" |
16 #include "chrome/browser/extensions/extension_prefs_scope.h" | 16 #include "chrome/browser/extensions/extension_prefs_scope.h" |
17 #include "chrome/browser/extensions/extension_scoped_prefs.h" | 17 #include "chrome/browser/extensions/extension_scoped_prefs.h" |
18 #include "chrome/browser/extensions/management_policy.h" | 18 #include "chrome/browser/extensions/management_policy.h" |
| 19 #include "chrome/browser/media_gallery/media_galleries_preferences.h" |
19 #include "chrome/common/extensions/extension.h" | 20 #include "chrome/common/extensions/extension.h" |
20 #include "chrome/common/extensions/url_pattern_set.h" | 21 #include "chrome/common/extensions/url_pattern_set.h" |
21 #include "chrome/common/string_ordinal.h" | 22 #include "chrome/common/string_ordinal.h" |
22 | 23 |
23 class ExtensionPrefValueMap; | 24 class ExtensionPrefValueMap; |
24 class ExtensionSorting; | 25 class ExtensionSorting; |
25 class PrefService; | 26 class PrefService; |
26 class URLPatternSet; | 27 class URLPatternSet; |
27 | 28 |
28 namespace extensions { | 29 namespace extensions { |
(...skipping 285 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
314 | 315 |
315 void SetLaunchType(const std::string& extension_id, LaunchType launch_type); | 316 void SetLaunchType(const std::string& extension_id, LaunchType launch_type); |
316 | 317 |
317 // Find the right launch container based on the launch type. | 318 // Find the right launch container based on the launch type. |
318 // If |extension|'s prefs do not have a launch type set, then | 319 // If |extension|'s prefs do not have a launch type set, then |
319 // use |default_pref_value|. | 320 // use |default_pref_value|. |
320 extension_misc::LaunchContainer GetLaunchContainer( | 321 extension_misc::LaunchContainer GetLaunchContainer( |
321 const Extension* extension, | 322 const Extension* extension, |
322 LaunchType default_pref_value); | 323 LaunchType default_pref_value); |
323 | 324 |
| 325 // Set and retrieve permissions for media galleries as identified by the |
| 326 // gallery id. |
| 327 void SetMediaGalleryPermission(const std::string& extension_id, |
| 328 MediaGalleryPrefId gallery, bool has_access); |
| 329 std::vector<MediaGalleryPermission> GetMediaGalleryPermissions( |
| 330 const std::string& extension_id); |
| 331 void RemoveMediaGalleryPermissions(MediaGalleryPrefId gallery_id); |
| 332 |
324 // Saves ExtensionInfo for each installed extension with the path to the | 333 // Saves ExtensionInfo for each installed extension with the path to the |
325 // version directory and the location. Blacklisted extensions won't be saved | 334 // version directory and the location. Blacklisted extensions won't be saved |
326 // and neither will external extensions the user has explicitly uninstalled. | 335 // and neither will external extensions the user has explicitly uninstalled. |
327 // Caller takes ownership of returned structure. | 336 // Caller takes ownership of returned structure. |
328 ExtensionsInfo* GetInstalledExtensionsInfo(); | 337 ExtensionsInfo* GetInstalledExtensionsInfo(); |
329 | 338 |
330 // Returns the ExtensionInfo from the prefs for the given extension. If the | 339 // Returns the ExtensionInfo from the prefs for the given extension. If the |
331 // extension is not present, NULL is returned. | 340 // extension is not present, NULL is returned. |
332 ExtensionInfo* GetInstalledExtensionInfo(const std::string& extension_id); | 341 ExtensionInfo* GetInstalledExtensionInfo(const std::string& extension_id); |
333 | 342 |
(...skipping 224 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
558 scoped_ptr<ExtensionSorting> extension_sorting_; | 567 scoped_ptr<ExtensionSorting> extension_sorting_; |
559 | 568 |
560 scoped_refptr<ContentSettingsStore> content_settings_store_; | 569 scoped_refptr<ContentSettingsStore> content_settings_store_; |
561 | 570 |
562 DISALLOW_COPY_AND_ASSIGN(ExtensionPrefs); | 571 DISALLOW_COPY_AND_ASSIGN(ExtensionPrefs); |
563 }; | 572 }; |
564 | 573 |
565 } // namespace extensions | 574 } // namespace extensions |
566 | 575 |
567 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_PREFS_H_ | 576 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_PREFS_H_ |
OLD | NEW |