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

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

Issue 2166513002: Create --disable-extensions-except switch (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fixed ExtensionServiceTest.ExternalUninstall test failing Created 4 years, 3 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 (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_SERVICE_H_ 5 #ifndef CHROME_BROWSER_EXTENSIONS_EXTENSION_SERVICE_H_
6 #define CHROME_BROWSER_EXTENSIONS_EXTENSION_SERVICE_H_ 6 #define CHROME_BROWSER_EXTENSIONS_EXTENSION_SERVICE_H_
7 7
8 #include <map> 8 #include <map>
9 #include <set> 9 #include <set>
10 #include <string> 10 #include <string>
(...skipping 440 matching lines...) Expand 10 before | Expand all | Expand 10 after
451 } 451 }
452 452
453 // Set a callback to be called when all external providers are ready and their 453 // Set a callback to be called when all external providers are ready and their
454 // extensions have been installed. 454 // extensions have been installed.
455 void set_external_updates_finished_callback_for_test( 455 void set_external_updates_finished_callback_for_test(
456 const base::Closure& callback) { 456 const base::Closure& callback) {
457 external_updates_finished_callback_ = callback; 457 external_updates_finished_callback_ = callback;
458 } 458 }
459 459
460 private: 460 private:
461 void LoadExtensionsFromCommandLineFlag(const char* switch_name);
462
461 // Reloads the specified extension, sending the onLaunched() event to it if it 463 // Reloads the specified extension, sending the onLaunched() event to it if it
462 // currently has any window showing. |be_noisy| determines whether noisy 464 // currently has any window showing. |be_noisy| determines whether noisy
463 // failures are allowed for unpacked extension installs. 465 // failures are allowed for unpacked extension installs.
464 void ReloadExtensionImpl(const std::string& extension_id, bool be_noisy); 466 void ReloadExtensionImpl(const std::string& extension_id, bool be_noisy);
465 467
466 // content::NotificationObserver implementation: 468 // content::NotificationObserver implementation:
467 void Observe(int type, 469 void Observe(int type,
468 const content::NotificationSource& source, 470 const content::NotificationSource& source,
469 const content::NotificationDetails& details) override; 471 const content::NotificationDetails& details) override;
470 472
(...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after
587 // the actual profile objects to be destroyed. 589 // the actual profile objects to be destroyed.
588 void OnProfileDestructionStarted(); 590 void OnProfileDestructionStarted();
589 591
590 // Called on file task runner thread to uninstall extension. 592 // Called on file task runner thread to uninstall extension.
591 static void UninstallExtensionOnFileThread( 593 static void UninstallExtensionOnFileThread(
592 const std::string& id, 594 const std::string& id,
593 Profile* profile, 595 Profile* profile,
594 const base::FilePath& install_dir, 596 const base::FilePath& install_dir,
595 const base::FilePath& extension_path); 597 const base::FilePath& extension_path);
596 598
599 const base::CommandLine* command_line_ = nullptr;
600
597 // The normal profile associated with this ExtensionService. 601 // The normal profile associated with this ExtensionService.
598 Profile* profile_ = nullptr; 602 Profile* profile_ = nullptr;
599 603
600 // The ExtensionSystem for the profile above. 604 // The ExtensionSystem for the profile above.
601 extensions::ExtensionSystem* system_ = nullptr; 605 extensions::ExtensionSystem* system_ = nullptr;
602 606
603 // Preferences for the owning profile. 607 // Preferences for the owning profile.
604 extensions::ExtensionPrefs* extension_prefs_ = nullptr; 608 extensions::ExtensionPrefs* extension_prefs_ = nullptr;
605 609
606 // Blacklist for the owning profile. 610 // Blacklist for the owning profile.
607 extensions::Blacklist* blacklist_ = nullptr; 611 extensions::Blacklist* blacklist_ = nullptr;
608 612
609 // Sets of enabled/disabled/terminated/blacklisted extensions. Not owned. 613 // Sets of enabled/disabled/terminated/blacklisted extensions. Not owned.
610 extensions::ExtensionRegistry* registry_ = nullptr; 614 extensions::ExtensionRegistry* registry_ = nullptr;
611 615
612 // Set of greylisted extensions. These extensions are disabled if they are 616 // Set of greylisted extensions. These extensions are disabled if they are
613 // already installed in Chromium at the time when they are added to 617 // already installed in Chromium at the time when they are added to
614 // the greylist. Unlike blacklisted extensions, greylisted ones are visible 618 // the greylist. Unlike blacklisted extensions, greylisted ones are visible
615 // to the user and if user re-enables such an extension, they remain enabled. 619 // to the user and if user re-enables such an extension, they remain enabled.
616 // 620 //
617 // These extensions should appear in registry_. 621 // These extensions should appear in registry_.
618 extensions::ExtensionSet greylist_; 622 extensions::ExtensionSet greylist_;
619 623
624 // Set of whitelisted enabled extensions loaded from the
625 // --disable-extensions-except command line flag.
626 std::set<std::string> disable_flag_exempted_extensions_;
627
620 // The list of extension installs delayed for various reasons. The reason 628 // The list of extension installs delayed for various reasons. The reason
621 // for delayed install is stored in ExtensionPrefs. These are not part of 629 // for delayed install is stored in ExtensionPrefs. These are not part of
622 // ExtensionRegistry because they are not yet installed. 630 // ExtensionRegistry because they are not yet installed.
623 extensions::ExtensionSet delayed_installs_; 631 extensions::ExtensionSet delayed_installs_;
624 632
625 // Hold the set of pending extensions. 633 // Hold the set of pending extensions.
626 extensions::PendingExtensionManager pending_extension_manager_; 634 extensions::PendingExtensionManager pending_extension_manager_;
627 635
628 // The full path to the directory where extensions are installed. 636 // The full path to the directory where extensions are installed.
629 base::FilePath install_directory_; 637 base::FilePath install_directory_;
(...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after
746 GreylistUnknownDontChange); 754 GreylistUnknownDontChange);
747 FRIEND_TEST_ALL_PREFIXES(ExtensionServiceTest, 755 FRIEND_TEST_ALL_PREFIXES(ExtensionServiceTest,
748 ManagementPolicyProhibitsEnableOnInstalled); 756 ManagementPolicyProhibitsEnableOnInstalled);
749 FRIEND_TEST_ALL_PREFIXES(ExtensionServiceTest, 757 FRIEND_TEST_ALL_PREFIXES(ExtensionServiceTest,
750 BlockAndUnblockBlacklistedExtension); 758 BlockAndUnblockBlacklistedExtension);
751 759
752 DISALLOW_COPY_AND_ASSIGN(ExtensionService); 760 DISALLOW_COPY_AND_ASSIGN(ExtensionService);
753 }; 761 };
754 762
755 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_SERVICE_H_ 763 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_SERVICE_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698