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

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

Issue 105733003: Move LaunchType out of ExtensionPrefs. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix indenting Created 7 years 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 7
8 #include <set> 8 #include <set>
9 #include <string> 9 #include <string>
10 #include <vector> 10 #include <vector>
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
56 // PrefValueStore::extension_prefs(), which this class populates and 56 // PrefValueStore::extension_prefs(), which this class populates and
57 // maintains as the underlying extensions change. 57 // maintains as the underlying extensions change.
58 class ExtensionPrefs : public ExtensionScopedPrefs, 58 class ExtensionPrefs : public ExtensionScopedPrefs,
59 public BrowserContextKeyedService { 59 public BrowserContextKeyedService {
60 public: 60 public:
61 typedef std::vector<linked_ptr<ExtensionInfo> > ExtensionsInfo; 61 typedef std::vector<linked_ptr<ExtensionInfo> > ExtensionsInfo;
62 62
63 // Vector containing identifiers for preferences. 63 // Vector containing identifiers for preferences.
64 typedef std::set<std::string> PrefKeySet; 64 typedef std::set<std::string> PrefKeySet;
65 65
66 // This enum is used for the launch type the user wants to use for an
67 // application.
68 // Do not remove items or re-order this enum as it is used in preferences
69 // and histograms.
70 enum LaunchType {
71 LAUNCH_TYPE_PINNED,
72 LAUNCH_TYPE_REGULAR,
73 LAUNCH_TYPE_FULLSCREEN,
74 LAUNCH_TYPE_WINDOW,
75
76 // Launch an app in the in the way a click on the NTP would,
77 // if no user pref were set. Update this constant to change
78 // the default for the NTP and chrome.management.launchApp().
79 LAUNCH_TYPE_DEFAULT = LAUNCH_TYPE_REGULAR
80 };
81
82 // This enum is used to store the reason an extension's install has been 66 // This enum is used to store the reason an extension's install has been
83 // delayed. Do not remove items or re-order this enum as it is used in 67 // delayed. Do not remove items or re-order this enum as it is used in
84 // preferences. 68 // preferences.
85 enum DelayReason { 69 enum DelayReason {
86 DELAY_REASON_NONE = 0, 70 DELAY_REASON_NONE = 0,
87 DELAY_REASON_GC = 1, 71 DELAY_REASON_GC = 1,
88 DELAY_REASON_WAIT_FOR_IDLE = 2, 72 DELAY_REASON_WAIT_FOR_IDLE = 2,
89 DELAY_REASON_WAIT_FOR_IMPORTS = 3, 73 DELAY_REASON_WAIT_FOR_IMPORTS = 3,
90 }; 74 };
91 75
(...skipping 300 matching lines...) Expand 10 before | Expand all | Expand 10 after
392 376
393 // Returns true if the user has chosen to allow this extension to inject 377 // Returns true if the user has chosen to allow this extension to inject
394 // scripts into pages with file URLs. 378 // scripts into pages with file URLs.
395 // 379 //
396 // IMPORTANT: you probably want to use extension_utils::AllowFileAccess 380 // IMPORTANT: you probably want to use extension_utils::AllowFileAccess
397 // instead of this method. 381 // instead of this method.
398 bool AllowFileAccess(const std::string& extension_id) const; 382 bool AllowFileAccess(const std::string& extension_id) const;
399 void SetAllowFileAccess(const std::string& extension_id, bool allow); 383 void SetAllowFileAccess(const std::string& extension_id, bool allow);
400 bool HasAllowFileAccessSetting(const std::string& extension_id) const; 384 bool HasAllowFileAccessSetting(const std::string& extension_id) const;
401 385
402 // Get the launch type preference. If no preference is set, return
403 // LAUNCH_DEFAULT.
404 // Returns LAUNCH_WINDOW if there's no preference and
405 // 'streamlined hosted apps' are enabled.
406 LaunchType GetLaunchType(const Extension* extension);
407
408 void SetLaunchType(const std::string& extension_id, LaunchType launch_type);
409
410 // Find the right launch container based on the launch type.
411 // If |extension|'s prefs do not have a launch type set, then the default
412 // value from GetLaunchType() is used to decide the launch container.
413 LaunchContainer GetLaunchContainer(const Extension* extension);
414
415 // Returns true if a launch container preference has been specified for
416 // |extension|. GetLaunchContainer() will still return a default value even if
417 // this returns false.
418 bool HasPreferredLaunchContainer(const Extension* extension);
419
420 // Saves ExtensionInfo for each installed extension with the path to the 386 // Saves ExtensionInfo for each installed extension with the path to the
421 // version directory and the location. Blacklisted extensions won't be saved 387 // version directory and the location. Blacklisted extensions won't be saved
422 // and neither will external extensions the user has explicitly uninstalled. 388 // and neither will external extensions the user has explicitly uninstalled.
423 // Caller takes ownership of returned structure. 389 // Caller takes ownership of returned structure.
424 scoped_ptr<ExtensionsInfo> GetInstalledExtensionsInfo() const; 390 scoped_ptr<ExtensionsInfo> GetInstalledExtensionsInfo() const;
425 391
426 // Same as above, but only includes external extensions the user has 392 // Same as above, but only includes external extensions the user has
427 // explicitly uninstalled. 393 // explicitly uninstalled.
428 scoped_ptr<ExtensionsInfo> GetUninstalledExtensionsInfo() const; 394 scoped_ptr<ExtensionsInfo> GetUninstalledExtensionsInfo() const;
429 395
(...skipping 232 matching lines...) Expand 10 before | Expand all | Expand 10 after
662 scoped_ptr<TimeProvider> time_provider_; 628 scoped_ptr<TimeProvider> time_provider_;
663 629
664 bool extensions_disabled_; 630 bool extensions_disabled_;
665 631
666 DISALLOW_COPY_AND_ASSIGN(ExtensionPrefs); 632 DISALLOW_COPY_AND_ASSIGN(ExtensionPrefs);
667 }; 633 };
668 634
669 } // namespace extensions 635 } // namespace extensions
670 636
671 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_PREFS_H_ 637 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_PREFS_H_
OLDNEW
« no previous file with comments | « chrome/browser/extensions/api/management/management_apitest.cc ('k') | chrome/browser/extensions/extension_prefs.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698