| 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 #ifndef EXTENSIONS_BROWSER_TEST_EXTENSION_REGISTRY_OBSERVER_H_ | 5 #ifndef EXTENSIONS_BROWSER_TEST_EXTENSION_REGISTRY_OBSERVER_H_ |
| 6 #define EXTENSIONS_BROWSER_TEST_EXTENSION_REGISTRY_OBSERVER_H_ | 6 #define EXTENSIONS_BROWSER_TEST_EXTENSION_REGISTRY_OBSERVER_H_ |
| 7 | 7 |
| 8 #include <memory> |
| 8 #include <string> | 9 #include <string> |
| 9 | 10 |
| 10 #include "base/macros.h" | 11 #include "base/macros.h" |
| 11 #include "base/memory/scoped_ptr.h" | |
| 12 #include "base/scoped_observer.h" | 12 #include "base/scoped_observer.h" |
| 13 #include "extensions/browser/extension_registry_observer.h" | 13 #include "extensions/browser/extension_registry_observer.h" |
| 14 | 14 |
| 15 namespace extensions { | 15 namespace extensions { |
| 16 class ExtensionRegistry; | 16 class ExtensionRegistry; |
| 17 | 17 |
| 18 // A helper class that listen for ExtensionRegistry notifications. | 18 // A helper class that listen for ExtensionRegistry notifications. |
| 19 class TestExtensionRegistryObserver : public ExtensionRegistryObserver { | 19 class TestExtensionRegistryObserver : public ExtensionRegistryObserver { |
| 20 public: | 20 public: |
| 21 // If |extension_id| is provided, listens only to events relating to that | 21 // If |extension_id| is provided, listens only to events relating to that |
| (...skipping 20 matching lines...) Expand all Loading... |
| 42 const std::string& old_name) override; | 42 const std::string& old_name) override; |
| 43 void OnExtensionUninstalled(content::BrowserContext* browser_context, | 43 void OnExtensionUninstalled(content::BrowserContext* browser_context, |
| 44 const Extension* extension, | 44 const Extension* extension, |
| 45 extensions::UninstallReason reason) override; | 45 extensions::UninstallReason reason) override; |
| 46 void OnExtensionLoaded(content::BrowserContext* browser_context, | 46 void OnExtensionLoaded(content::BrowserContext* browser_context, |
| 47 const Extension* extension) override; | 47 const Extension* extension) override; |
| 48 void OnExtensionUnloaded(content::BrowserContext* browser_context, | 48 void OnExtensionUnloaded(content::BrowserContext* browser_context, |
| 49 const Extension* extension, | 49 const Extension* extension, |
| 50 UnloadedExtensionInfo::Reason reason) override; | 50 UnloadedExtensionInfo::Reason reason) override; |
| 51 | 51 |
| 52 const Extension* Wait(scoped_ptr<Waiter>* waiter); | 52 const Extension* Wait(std::unique_ptr<Waiter>* waiter); |
| 53 | 53 |
| 54 scoped_ptr<Waiter> will_be_installed_waiter_; | 54 std::unique_ptr<Waiter> will_be_installed_waiter_; |
| 55 scoped_ptr<Waiter> uninstalled_waiter_; | 55 std::unique_ptr<Waiter> uninstalled_waiter_; |
| 56 scoped_ptr<Waiter> loaded_waiter_; | 56 std::unique_ptr<Waiter> loaded_waiter_; |
| 57 scoped_ptr<Waiter> unloaded_waiter_; | 57 std::unique_ptr<Waiter> unloaded_waiter_; |
| 58 | 58 |
| 59 ScopedObserver<ExtensionRegistry, ExtensionRegistryObserver> | 59 ScopedObserver<ExtensionRegistry, ExtensionRegistryObserver> |
| 60 extension_registry_observer_; | 60 extension_registry_observer_; |
| 61 | 61 |
| 62 std::string extension_id_; | 62 std::string extension_id_; |
| 63 | 63 |
| 64 DISALLOW_COPY_AND_ASSIGN(TestExtensionRegistryObserver); | 64 DISALLOW_COPY_AND_ASSIGN(TestExtensionRegistryObserver); |
| 65 }; | 65 }; |
| 66 | 66 |
| 67 } // namespace extensions | 67 } // namespace extensions |
| 68 | 68 |
| 69 #endif // EXTENSIONS_BROWSER_TEST_EXTENSION_REGISTRY_OBSERVER_H_ | 69 #endif // EXTENSIONS_BROWSER_TEST_EXTENSION_REGISTRY_OBSERVER_H_ |
| OLD | NEW |