Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 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 | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 #ifndef EXTENSIONS_BROWSER_EXTENSION_TEST_REGISTRY_OBSERVER_H_ | |
| 6 #define EXTENSIONS_BROWSER_EXTENSION_TEST_REGISTRY_OBSERVER_H_ | |
|
not at google - send to devlin
2014/06/15 21:20:16
+yoz, rockot
Can this file go in extensions/test?
| |
| 7 | |
| 8 #include "base/scoped_observer.h" | |
| 9 #include "content/public/test/test_utils.h" | |
| 10 #include "extensions/browser/extension_registry.h" | |
|
not at google - send to devlin
2014/06/15 21:20:16
forward declare?
limasdf
2014/06/16 18:58:53
Done.
| |
| 11 #include "extensions/browser/extension_registry_observer.h" | |
| 12 | |
| 13 namespace extensions { | |
| 14 | |
| 15 // A helper class that listen for ExtensionRegistry notifications. | |
| 16 class ExtensionTestRegistryObserver : public ExtensionRegistryObserver { | |
| 17 public: | |
| 18 explicit ExtensionTestRegistryObserver(ExtensionRegistry* registry); | |
| 19 virtual ~ExtensionTestRegistryObserver(); | |
| 20 | |
| 21 void WaitForExtensionInstalled(); | |
|
not at google - send to devlin
2014/06/15 21:20:17
This should probably be "WaitForExtensionWillBeIns
limasdf
2014/06/16 18:58:53
WaitForAnyExtensionWillBeInstalled.
| |
| 22 void WaitForExtensionUninstalled(); | |
|
not at google - send to devlin
2014/06/15 21:20:17
I expect that eventually we'll want to be checking
| |
| 23 | |
| 24 private: | |
| 25 virtual void OnExtensionWillBeInstalled( | |
| 26 content::BrowserContext* browser_context, | |
| 27 const Extension* extension, | |
| 28 bool is_update, | |
| 29 bool from_ephemeral, | |
| 30 const std::string& old_name) OVERRIDE; | |
| 31 virtual void OnExtensionUninstalled(content::BrowserContext* browser_context, | |
| 32 const Extension* extension) OVERRIDE; | |
| 33 | |
| 34 bool waiting_for_installed_; | |
| 35 bool received_installed_; | |
| 36 scoped_refptr<content::MessageLoopRunner> runner_installed_; | |
| 37 | |
| 38 bool waiting_for_uninstalled_; | |
| 39 bool received_uninstalled_; | |
| 40 scoped_refptr<content::MessageLoopRunner> runner_uninstalled_; | |
| 41 | |
| 42 ScopedObserver<ExtensionRegistry, ExtensionRegistryObserver> | |
| 43 extension_registry_observer_; | |
| 44 }; | |
| 45 | |
| 46 } // namespace extensions | |
| 47 | |
| 48 #endif // EXTENSIONS_BROWSER_EXTENSION_TEST_REGISTRY_OBSERVER_H_ | |
| OLD | NEW |