| OLD | NEW | 
|---|
| 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 #include <list> | 5 #include <list> | 
| 6 #include <set> | 6 #include <set> | 
| 7 #include <string> | 7 #include <string> | 
| 8 | 8 | 
| 9 #include "base/bind_helpers.h" | 9 #include "base/bind_helpers.h" | 
| 10 #include "base/callback_helpers.h" | 10 #include "base/callback_helpers.h" | 
| (...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 77     base::RunLoop run_loop; | 77     base::RunLoop run_loop; | 
| 78     awaited_install_id_ = id; | 78     awaited_install_id_ = id; | 
| 79     quit_closure_ = run_loop.QuitClosure(); | 79     quit_closure_ = run_loop.QuitClosure(); | 
| 80     run_loop.Run(); | 80     run_loop.Run(); | 
| 81     return base::ContainsKey(installed_, id); | 81     return base::ContainsKey(installed_, id); | 
| 82   } | 82   } | 
| 83 | 83 | 
| 84   // ExtensionRegistryObserver | 84   // ExtensionRegistryObserver | 
| 85   void OnExtensionUnloaded(content::BrowserContext* browser_context, | 85   void OnExtensionUnloaded(content::BrowserContext* browser_context, | 
| 86                            const Extension* extension, | 86                            const Extension* extension, | 
| 87                            UnloadedExtensionInfo::Reason reason) override { | 87                            UnloadedExtensionReason reason) override { | 
| 88     unloaded_.insert(extension->id()); | 88     unloaded_.insert(extension->id()); | 
| 89     if (awaited_unload_id_ == extension->id()) { | 89     if (awaited_unload_id_ == extension->id()) { | 
| 90       awaited_unload_id_.clear(); | 90       awaited_unload_id_.clear(); | 
| 91       base::ResetAndReturn(&quit_closure_).Run(); | 91       base::ResetAndReturn(&quit_closure_).Run(); | 
| 92     } | 92     } | 
| 93   } | 93   } | 
| 94 | 94 | 
| 95   void OnExtensionInstalled(content::BrowserContext* browser_context, | 95   void OnExtensionInstalled(content::BrowserContext* browser_context, | 
| 96                             const Extension* extension, | 96                             const Extension* extension, | 
| 97                             bool is_update) override { | 97                             bool is_update) override { | 
| (...skipping 805 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 903   // Remove the override and set ExtensionService to update again. The extension | 903   // Remove the override and set ExtensionService to update again. The extension | 
| 904   // should be now installed. | 904   // should be now installed. | 
| 905   PolicyExtensionReinstaller::set_policy_reinstall_action_for_test(nullptr); | 905   PolicyExtensionReinstaller::set_policy_reinstall_action_for_test(nullptr); | 
| 906   service->set_external_updates_disabled_for_test(false); | 906   service->set_external_updates_disabled_for_test(false); | 
| 907   delay_tracker.Proceed(); | 907   delay_tracker.Proceed(); | 
| 908 | 908 | 
| 909   EXPECT_TRUE(registry_observer.WaitForInstall(id_)); | 909   EXPECT_TRUE(registry_observer.WaitForInstall(id_)); | 
| 910 } | 910 } | 
| 911 | 911 | 
| 912 }  // namespace extensions | 912 }  // namespace extensions | 
| OLD | NEW | 
|---|