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

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

Issue 2054773002: Replace the WAS_INSTALLED_BY_CUSTODIAN creation flag with a pref (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix the bug of delegated installs for pre-existing extensions Created 4 years, 6 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
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 EXTENSIONS_BROWSER_EXTENSION_PREFS_H_ 5 #ifndef EXTENSIONS_BROWSER_EXTENSION_PREFS_H_
6 #define EXTENSIONS_BROWSER_EXTENSION_PREFS_H_ 6 #define EXTENSIONS_BROWSER_EXTENSION_PREFS_H_
7 7
8 #include <memory> 8 #include <memory>
9 #include <set> 9 #include <set>
10 #include <string> 10 #include <string>
(...skipping 391 matching lines...) Expand 10 before | Expand all | Expand 10 after
402 402
403 // Returns true if the user has chosen to allow this extension to inject 403 // Returns true if the user has chosen to allow this extension to inject
404 // scripts into pages with file URLs. 404 // scripts into pages with file URLs.
405 // 405 //
406 // IMPORTANT: you probably want to use extensions::util::AllowFileAccess 406 // IMPORTANT: you probably want to use extensions::util::AllowFileAccess
407 // instead of this method. 407 // instead of this method.
408 bool AllowFileAccess(const std::string& extension_id) const; 408 bool AllowFileAccess(const std::string& extension_id) const;
409 void SetAllowFileAccess(const std::string& extension_id, bool allow); 409 void SetAllowFileAccess(const std::string& extension_id, bool allow);
410 bool HasAllowFileAccessSetting(const std::string& extension_id) const; 410 bool HasAllowFileAccessSetting(const std::string& extension_id) const;
411 411
412 // Returns true if this extension has been installed by the custodian of
413 // a supervised user. It is relevant for supervised users and used to block
414 // them from uninstalling the extension for example.
415 bool IsInstalledByCustodian(const std::string& extension_id) const;
Marc Treib 2016/06/13 09:37:14 WasInstalledByCustodian please, to stay consistent
mamir 2016/06/13 11:30:17 Done. And I share the same feeling about being bot
Marc Treib 2016/06/13 12:17:09 Hm. Do we still need the creation flag? (There's a
mamir 2016/06/13 14:15:57 Well, this was my 3rd proposal to tackle this issu
Marc Treib 2016/06/13 14:36:50 Alright. If Devlin is okay with that, then I am to
416 void SetIsInstalledByCustodian(const std::string& extension_id,
417 bool installed_by_custodian);
418 bool HasIsInstalledByCustodianSetting(const std::string& extension_id) const;
419
412 // Saves ExtensionInfo for each installed extension with the path to the 420 // Saves ExtensionInfo for each installed extension with the path to the
413 // version directory and the location. Blacklisted extensions won't be saved 421 // version directory and the location. Blacklisted extensions won't be saved
414 // and neither will external extensions the user has explicitly uninstalled. 422 // and neither will external extensions the user has explicitly uninstalled.
415 // Caller takes ownership of returned structure. 423 // Caller takes ownership of returned structure.
416 std::unique_ptr<ExtensionsInfo> GetInstalledExtensionsInfo() const; 424 std::unique_ptr<ExtensionsInfo> GetInstalledExtensionsInfo() const;
417 425
418 // Same as above, but only includes external extensions the user has 426 // Same as above, but only includes external extensions the user has
419 // explicitly uninstalled. 427 // explicitly uninstalled.
420 std::unique_ptr<ExtensionsInfo> GetUninstalledExtensionsInfo() const; 428 std::unique_ptr<ExtensionsInfo> GetUninstalledExtensionsInfo() const;
421 429
(...skipping 265 matching lines...) Expand 10 before | Expand all | Expand 10 after
687 bool extensions_disabled_; 695 bool extensions_disabled_;
688 696
689 base::ObserverList<ExtensionPrefsObserver> observer_list_; 697 base::ObserverList<ExtensionPrefsObserver> observer_list_;
690 698
691 DISALLOW_COPY_AND_ASSIGN(ExtensionPrefs); 699 DISALLOW_COPY_AND_ASSIGN(ExtensionPrefs);
692 }; 700 };
693 701
694 } // namespace extensions 702 } // namespace extensions
695 703
696 #endif // EXTENSIONS_BROWSER_EXTENSION_PREFS_H_ 704 #endif // EXTENSIONS_BROWSER_EXTENSION_PREFS_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698