• Michael Giuffrida's avatar
    ExtensionRegistrar for enabling and disabling extensions · 023e3532
    Michael Giuffrida authored
    Classes will use ExtensionRegistrar to enable and disable extensions, as
    well as add, remove, reload, and terminate them (later CLs).
    
    Currently Chrome's ExtensionService does this, among many other things.
    A standalone class for this is preferred because:
    * Code outside //chrome uses similar steps to run extensions, so we
      should share this code in //extensions
    * ExtensionService already does too much and is very complex
    
    This CL adds EnableExtension() and DisableExtension() to
    ExtensionRegistrar. ExtensionService still does some Chrome-specific
    work, but later we'll factor that out into a delegate.
    
    Later CLs will add the other extension lifecycle methods, so eventually
    ExtensionRegistrar is the only class allowed to change the
    ExtensionRegistry (thus the name). We'll also update calls to
    ExtensionService methods to use ExtensionRegistrar directly when it
    makes sense.
    
    
    Design doc: https://goo.gl/trZKep (Google-internal).
    
    Bug: 762642
    Test: extensions_unittests: ExtensionRegistrarTest
    Change-Id: I2910a76f873122fbc405b7cc76c766b00a8b216f
    Reviewed-on: https://chromium-review.googlesource.com/671206
    Commit-Queue: Michael Giuffrida <michaelpg@chromium.org>
    Reviewed-by: default avatarDevlin <rdevlin.cronin@chromium.org>
    Cr-Commit-Position: refs/heads/master@{#505206}
    023e3532
extension_registrar_unittest.cc 5.51 KB