| 
        
       | 
      
        
  
  Remove NOTIFICATION_EXTENSION_ENABLED.
Enablement can happen for the following 3 cases:
1. New extension is added
2. User enables a disabled extension
3. An extension is reloaded or a terminated extension is reloaded
It seems we used this in two classes in
a) theme_service.cc and
b) event_router.cc
a) For themes, this can be simplified to load the theme on
OnExtensionLoaded. Themes don't have process and it can't be
terminated. We still have to remember whether the load is due
to a theme update or not (OnExtensionWillBeInstalled). It is
possible to avoid this by remembering both current theme's
id (already done) and version in the prefs. This CL does not do
that.
b) The primary reason of EventRouter code is to make sure we
are aware of new lazy events on extension upgrade, and to dispatch
onInstalled event. The CL wraps the logic to use
OnExtensionWillBeInstalled + OnExtensionLoaded into a separate
class: LazyEventDispatchUtil.
However, there are also 2 other reasons for EventRouter code in b):
b1) We also need to reconnect devtools to a reloaded event
page. That was happening through event_router. Pull that logic into
extension_service as extension_service is already responsible
for remembering orphaned devtools.
b2) A component extension reload does not go through
ExtensionRegistry::TriggerOnInstalled, so it doesn't see any
OnExtensionWillBeInstalled. Couple the logic with b1).
 TBR=benwells@chromium.org for added test in app_browsertest.cc
BUG= 723754,  411569
Test=No visible changes expected.
Review-Url:  https://codereview.chromium.org/2893693002
Cr-Commit-Position: refs/heads/master@{#477357}
Committed:  https://chromium.googlesource.com/chromium/src/+/75b9def1648c17c0edc926e7ea787519e9c59899
   
  
  
    
      Total comments: 11
      
     
  
  
  
   
  
  
  
  
  
   
  
  
  
  
  
   
  
  
  
    
      Total comments: 16
      
     
  
  
  
   
  
  
  
    
      Total comments: 8
      
     
  
  
  
   
  
  
  
    
      Total comments: 2
      
     
  
  
  
   
  
  
  
    
      Total comments: 2
      
     
  
  
  
   
  
  
  
  
  
   
  
  
  
    
      Total comments: 11
      
     
  
  
  
   
  
  
  
  
  
   
  
  
  
    
      Total comments: 4
      
     
  
  
  
   
  
  
  
  
    
  
  
    
       | 
      Unified diffs | 
      Side-by-side diffs | 
      Delta from patch set | 
      Stats (+589 lines, -162 lines) | 
      Patch | 
     
    
      
          | 
        M | 
        
          
            chrome/browser/apps/app_browsertest.cc
          
         | 
        
          
            View
          
         | 
        
        
          1
        
          2
        
          3
        
          4
        
          5
        
          6
        
          7
        
          8
        
          9
        
         | 
        
          1 chunk | 
          +18 lines, -1 line | 
        
        
          
            0 comments
            
            
          
         | 
        
          
            Download
          
         | 
       
    
      
          | 
        M | 
        
          
            chrome/browser/extensions/api/input_ime/input_ime_api.h
          
         | 
        
          
            View
          
         | 
        
        
         | 
        
          2 chunks | 
          +1 line, -4 lines | 
        
        
          
            0 comments
            
            
          
         | 
        
          
            Download
          
         | 
       
    
      
          | 
        M | 
        
          
            chrome/browser/extensions/api/signed_in_devices/signed_in_devices_manager.h
          
         | 
        
          
            View
          
         | 
        
        
         | 
        
          2 chunks | 
          +1 line, -1 line | 
        
        
          
            0 comments
            
            
          
         | 
        
          
            Download
          
         | 
       
    
      
          | 
        M | 
        
          
            chrome/browser/extensions/events_apitest.cc
          
         | 
        
          
            View
          
         | 
        
        
          1
        
          2
        
          3
        
          4
        
          5
        
         | 
        
          2 chunks | 
          +146 lines, -0 lines | 
        
        
          
            0 comments
            
            
          
         | 
        
          
            Download
          
         | 
       
    
      
          | 
        M | 
        
          
            chrome/browser/extensions/extension_service.h
          
         | 
        
          
            View
          
         | 
        
        
          1
        
          2
        
          3
        
          4
        
          5
        
          6
        
          7
        
          8
        
         | 
        
          1 chunk | 
          +4 lines, -0 lines | 
        
        
          
            0 comments
            
            
          
         | 
        
          
            Download
          
         | 
       
    
      
          | 
        M | 
        
          
            chrome/browser/extensions/extension_service.cc
          
         | 
        
          
            View
          
         | 
        
        
          1
        
          2
        
          3
        
          4
        
          5
        
          6
        
          7
        
          8
        
         | 
        
          4 chunks | 
          +30 lines, -5 lines | 
        
        
          
            0 comments
            
            
          
         | 
        
          
            Download
          
         | 
       
    
      
          | 
        M | 
        
          
            chrome/browser/themes/theme_service.cc
          
         | 
        
          
            View
          
         | 
        
        
          1
        
          2
        
          3
        
          4
        
          5
        
          6
        
          7
        
          8
        
          9
        
          10
        
         | 
        
          5 chunks | 
          +28 lines, -21 lines | 
        
        
          
            0 comments
            
            
          
         | 
        
          
            Download
          
         | 
       
    
      
          | 
        A | 
        
          
            chrome/test/data/extensions/api_test/lazy_events/new_event_in_new_version/pem.pem
          
         | 
        
          
            View
          
         | 
        
        
          1
        
          2
        
         | 
        
          1 chunk | 
          +16 lines, -0 lines | 
        
        
          
            0 comments
            
            
          
         | 
        
          
            Download
          
         | 
       
    
      
          | 
        A | 
        
          
            chrome/test/data/extensions/api_test/lazy_events/new_event_in_new_version/v1/background.js
          
         | 
        
          
            View
          
         | 
        
        
          1
        
          2
        
          3
        
          4
        
         | 
        
          1 chunk | 
          +5 lines, -0 lines | 
        
        
          
            0 comments
            
            
          
         | 
        
          
            Download
          
         | 
       
    
      
          | 
        A | 
        
          
            chrome/test/data/extensions/api_test/lazy_events/new_event_in_new_version/v1/manifest.json
          
         | 
        
          
            View
          
         | 
        
        
          1
        
          2
        
          3
        
          4
        
         | 
        
          1 chunk | 
          +5 lines, -0 lines | 
        
        
          
            0 comments
            
            
          
         | 
        
          
            Download
          
         | 
       
    
      
          | 
        A | 
        
          
            chrome/test/data/extensions/api_test/lazy_events/new_event_in_new_version/v2/background.js
          
         | 
        
          
            View
          
         | 
        
        
          1
        
          2
        
         | 
        
          1 chunk | 
          +5 lines, -0 lines | 
        
        
          
            0 comments
            
            
          
         | 
        
          
            Download
          
         | 
       
    
      
          | 
        A | 
        
          
            chrome/test/data/extensions/api_test/lazy_events/new_event_in_new_version/v2/manifest.json
          
         | 
        
          
            View
          
         | 
        
        
          1
        
          2
        
          3
        
          4
        
         | 
        
          1 chunk | 
          +5 lines, -0 lines | 
        
        
          
            0 comments
            
            
          
         | 
        
          
            Download
          
         | 
       
    
      
          | 
        A | 
        
          
            chrome/test/data/extensions/api_test/lazy_events/on_installed/pem.pem
          
         | 
        
          
            View
          
         | 
        
        
          1
        
          2
        
         | 
        
          1 chunk | 
          +16 lines, -0 lines | 
        
        
          
            0 comments
            
            
          
         | 
        
          
            Download
          
         | 
       
    
      
          | 
        A | 
        
          
            chrome/test/data/extensions/api_test/lazy_events/on_installed/v1/background.js
          
         | 
        
          
            View
          
         | 
        
        
          1
        
          2
        
         | 
        
          1 chunk | 
          +5 lines, -0 lines | 
        
        
          
            0 comments
            
            
          
         | 
        
          
            Download
          
         | 
       
    
      
          | 
        A | 
        
          
            chrome/test/data/extensions/api_test/lazy_events/on_installed/v1/manifest.json
          
         | 
        
          
            View
          
         | 
        
        
          1
        
          2
        
          3
        
          4
        
         | 
        
          1 chunk | 
          +5 lines, -0 lines | 
        
        
          
            0 comments
            
            
          
         | 
        
          
            Download
          
         | 
       
    
      
          | 
        A | 
        
          
            chrome/test/data/extensions/api_test/lazy_events/on_installed/v2/background.js
          
         | 
        
          
            View
          
         | 
        
        
          1
        
          2
        
         | 
        
          1 chunk | 
          +5 lines, -0 lines | 
        
        
          
            0 comments
            
            
          
         | 
        
          
            Download
          
         | 
       
    
      
          | 
        A | 
        
          
            chrome/test/data/extensions/api_test/lazy_events/on_installed/v2/manifest.json
          
         | 
        
          
            View
          
         | 
        
        
          1
        
          2
        
          3
        
          4
        
         | 
        
          1 chunk | 
          +5 lines, -0 lines | 
        
        
          
            0 comments
            
            
          
         | 
        
          
            Download
          
         | 
       
    
      
          | 
        A | 
        
          
            chrome/test/data/extensions/api_test/lazy_events/on_installed_permissions_increase/pem.pem
          
         | 
        
          
            View
          
         | 
        
        
          1
        
          2
        
         | 
        
          1 chunk | 
          +16 lines, -0 lines | 
        
        
          
            0 comments
            
            
          
         | 
        
          
            Download
          
         | 
       
    
      
          | 
        A | 
        
          
            chrome/test/data/extensions/api_test/lazy_events/on_installed_permissions_increase/v1/background.js
          
         | 
        
          
            View
          
         | 
        
        
          1
        
          2
        
         | 
        
          1 chunk | 
          +5 lines, -0 lines | 
        
        
          
            0 comments
            
            
          
         | 
        
          
            Download
          
         | 
       
    
      
          | 
        A | 
        
          
            chrome/test/data/extensions/api_test/lazy_events/on_installed_permissions_increase/v1/manifest.json
          
         | 
        
          
            View
          
         | 
        
        
          1
        
          2
        
          3
        
          4
        
         | 
        
          1 chunk | 
          +5 lines, -0 lines | 
        
        
          
            0 comments
            
            
          
         | 
        
          
            Download
          
         | 
       
    
      
          | 
        A | 
        
          
            chrome/test/data/extensions/api_test/lazy_events/on_installed_permissions_increase/v2/background.js
          
         | 
        
          
            View
          
         | 
        
        
          1
        
          2
        
         | 
        
          1 chunk | 
          +5 lines, -0 lines | 
        
        
          
            0 comments
            
            
          
         | 
        
          
            Download
          
         | 
       
    
      
          | 
        A | 
        
          
            chrome/test/data/extensions/api_test/lazy_events/on_installed_permissions_increase/v2/manifest.json
          
         | 
        
          
            View
          
         | 
        
        
          1
        
          2
        
          3
        
          4
        
         | 
        
          1 chunk | 
          +6 lines, -0 lines | 
        
        
          
            0 comments
            
            
          
         | 
        
          
            Download
          
         | 
       
    
      
          | 
        A | 
        
          
            chrome/test/data/extensions/platform_apps/component_reload/background.js
          
         | 
        
          
            View
          
         | 
        
        
          1
        
          2
        
          3
        
          4
        
          5
        
          6
        
          7
        
          8
        
          9
        
         | 
        
          1 chunk | 
          +8 lines, -0 lines | 
        
        
          
            0 comments
            
            
          
         | 
        
          
            Download
          
         | 
       
    
      
          | 
        A | 
        
          
            chrome/test/data/extensions/platform_apps/component_reload/manifest.json
          
         | 
        
          
            View
          
         | 
        
        
          1
        
          2
        
          3
        
          4
        
          5
        
          6
        
          7
        
          8
        
         | 
        
          1 chunk | 
          +11 lines, -0 lines | 
        
        
          
            0 comments
            
            
          
         | 
        
          
            Download
          
         | 
       
    
      
          | 
        M | 
        
          
            extensions/browser/BUILD.gn
          
         | 
        
          
            View
          
         | 
        
        
          1
        
          2
        
          3
        
          4
        
          5
        
          6
        
          7
        
         | 
        
          1 chunk | 
          +2 lines, -0 lines | 
        
        
          
            0 comments
            
            
          
         | 
        
          
            Download
          
         | 
       
    
      
          | 
        M | 
        
          
            extensions/browser/api/runtime/runtime_api.h
          
         | 
        
          
            View
          
         | 
        
        
          1
        
          2
        
          3
        
          4
        
          5
        
          6
        
          7
        
          8
        
          9
        
          10
        
          11
        
         | 
        
          4 chunks | 
          +9 lines, -13 lines | 
        
        
          
            0 comments
            
            
          
         | 
        
          
            Download
          
         | 
       
    
      
          | 
        M | 
        
          
            extensions/browser/api/runtime/runtime_api.cc
          
         | 
        
          
            View
          
         | 
        
        
          1
        
          2
        
          3
        
          4
        
          5
        
         | 
        
          7 chunks | 
          +18 lines, -79 lines | 
        
        
          
            0 comments
            
            
          
         | 
        
          
            Download
          
         | 
       
    
      
          | 
        M | 
        
          
            extensions/browser/event_router.h
          
         | 
        
          
            View
          
         | 
        
        
          1
        
          2
        
          3
        
          4
        
          5
        
         | 
        
          6 chunks | 
          +7 lines, -8 lines | 
        
        
          
            0 comments
            
            
          
         | 
        
          
            Download
          
         | 
       
    
      
          | 
        M | 
        
          
            extensions/browser/event_router.cc
          
         | 
        
          
            View
          
         | 
        
        
          1
        
          2
        
          3
        
          4
        
          5
        
          6
        
          7
        
         | 
        
          5 chunks | 
          +2 lines, -23 lines | 
        
        
          
            0 comments
            
            
          
         | 
        
          
            Download
          
         | 
       
    
      
          | 
        A | 
        
          
            extensions/browser/events/lazy_event_dispatch_util.h
          
         | 
        
          
            View
          
         | 
        
        
          1
        
          2
        
          3
        
          4
        
          5
        
          6
        
          7
        
          8
        
          9
        
          10
        
          11
        
         | 
        
          1 chunk | 
          +74 lines, -0 lines | 
        
        
          
            0 comments
            
            
          
         | 
        
          
            Download
          
         | 
       
    
      
          | 
        A | 
        
          
            extensions/browser/events/lazy_event_dispatch_util.cc
          
         | 
        
          
            View
          
         | 
        
        
          1
        
          2
        
          3
        
          4
        
          5
        
         | 
        
          1 chunk | 
          +121 lines, -0 lines | 
        
        
          
            0 comments
            
            
          
         | 
        
          
            Download
          
         | 
       
    
      
          | 
        M | 
        
          
            extensions/browser/notification_types.h
          
         | 
        
          
            View
          
         | 
        
        
         | 
        
          1 chunk | 
          +0 lines, -7 lines | 
        
        
          
            0 comments
            
            
          
         | 
        
          
            Download
          
         | 
       
    
   
  
  
 
  
   
  
    
  
  
  
    
    Total messages: 78 (49 generated)
     
  
  
       |