| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 CHROME_BROWSER_UI_EXTENSIONS_EXTENSION_ENABLE_FLOW_H_ | 5 #ifndef CHROME_BROWSER_UI_EXTENSIONS_EXTENSION_ENABLE_FLOW_H_ |
| 6 #define CHROME_BROWSER_UI_EXTENSIONS_EXTENSION_ENABLE_FLOW_H_ | 6 #define CHROME_BROWSER_UI_EXTENSIONS_EXTENSION_ENABLE_FLOW_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
| (...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 75 // Creates an ExtensionInstallPrompt in |prompt_|. | 75 // Creates an ExtensionInstallPrompt in |prompt_|. |
| 76 void CreatePrompt(); | 76 void CreatePrompt(); |
| 77 | 77 |
| 78 // Starts/stops observing extension load notifications. | 78 // Starts/stops observing extension load notifications. |
| 79 void StartObserving(); | 79 void StartObserving(); |
| 80 void StopObserving(); | 80 void StopObserving(); |
| 81 | 81 |
| 82 // content::NotificationObserver overrides: | 82 // content::NotificationObserver overrides: |
| 83 virtual void Observe(int type, | 83 virtual void Observe(int type, |
| 84 const content::NotificationSource& source, | 84 const content::NotificationSource& source, |
| 85 const content::NotificationDetails& details) OVERRIDE; | 85 const content::NotificationDetails& details) override; |
| 86 | 86 |
| 87 // extensions::ExtensionRegistryObserver overrides: | 87 // extensions::ExtensionRegistryObserver overrides: |
| 88 virtual void OnExtensionLoaded( | 88 virtual void OnExtensionLoaded( |
| 89 content::BrowserContext* browser_context, | 89 content::BrowserContext* browser_context, |
| 90 const extensions::Extension* extension) OVERRIDE; | 90 const extensions::Extension* extension) override; |
| 91 virtual void OnExtensionUninstalled( | 91 virtual void OnExtensionUninstalled( |
| 92 content::BrowserContext* browser_context, | 92 content::BrowserContext* browser_context, |
| 93 const extensions::Extension* extension, | 93 const extensions::Extension* extension, |
| 94 extensions::UninstallReason reason) OVERRIDE; | 94 extensions::UninstallReason reason) override; |
| 95 | 95 |
| 96 // ExtensionInstallPrompt::Delegate overrides: | 96 // ExtensionInstallPrompt::Delegate overrides: |
| 97 virtual void InstallUIProceed() OVERRIDE; | 97 virtual void InstallUIProceed() override; |
| 98 virtual void InstallUIAbort(bool user_initiated) OVERRIDE; | 98 virtual void InstallUIAbort(bool user_initiated) override; |
| 99 | 99 |
| 100 // content::PageNavigator overrides: | 100 // content::PageNavigator overrides: |
| 101 virtual content::WebContents* OpenURL( | 101 virtual content::WebContents* OpenURL( |
| 102 const content::OpenURLParams& params) OVERRIDE; | 102 const content::OpenURLParams& params) override; |
| 103 | 103 |
| 104 Profile* const profile_; | 104 Profile* const profile_; |
| 105 const std::string extension_id_; | 105 const std::string extension_id_; |
| 106 ExtensionEnableFlowDelegate* const delegate_; // Not owned. | 106 ExtensionEnableFlowDelegate* const delegate_; // Not owned. |
| 107 | 107 |
| 108 // Parent web contents for ExtensionInstallPrompt that may be created during | 108 // Parent web contents for ExtensionInstallPrompt that may be created during |
| 109 // the flow. Note this is mutually exclusive with |parent_window_| below. | 109 // the flow. Note this is mutually exclusive with |parent_window_| below. |
| 110 content::WebContents* parent_contents_; | 110 content::WebContents* parent_contents_; |
| 111 | 111 |
| 112 // Parent native window for ExtensionInstallPrompt. Note this is mutually | 112 // Parent native window for ExtensionInstallPrompt. Note this is mutually |
| 113 // exclusive with |parent_contents_| above. | 113 // exclusive with |parent_contents_| above. |
| 114 gfx::NativeWindow parent_window_; | 114 gfx::NativeWindow parent_window_; |
| 115 | 115 |
| 116 // Called to acquire a parent window for the prompt. This is used for clients | 116 // Called to acquire a parent window for the prompt. This is used for clients |
| 117 // who only want to create a window if it is required. | 117 // who only want to create a window if it is required. |
| 118 base::Callback<gfx::NativeWindow(void)> window_getter_; | 118 base::Callback<gfx::NativeWindow(void)> window_getter_; |
| 119 | 119 |
| 120 scoped_ptr<ExtensionInstallPrompt> prompt_; | 120 scoped_ptr<ExtensionInstallPrompt> prompt_; |
| 121 content::NotificationRegistrar registrar_; | 121 content::NotificationRegistrar registrar_; |
| 122 | 122 |
| 123 // Listen to extension load notification. | 123 // Listen to extension load notification. |
| 124 ScopedObserver<extensions::ExtensionRegistry, | 124 ScopedObserver<extensions::ExtensionRegistry, |
| 125 extensions::ExtensionRegistryObserver> | 125 extensions::ExtensionRegistryObserver> |
| 126 extension_registry_observer_; | 126 extension_registry_observer_; |
| 127 | 127 |
| 128 DISALLOW_COPY_AND_ASSIGN(ExtensionEnableFlow); | 128 DISALLOW_COPY_AND_ASSIGN(ExtensionEnableFlow); |
| 129 }; | 129 }; |
| 130 | 130 |
| 131 #endif // CHROME_BROWSER_UI_EXTENSIONS_EXTENSION_ENABLE_FLOW_H_ | 131 #endif // CHROME_BROWSER_UI_EXTENSIONS_EXTENSION_ENABLE_FLOW_H_ |
| OLD | NEW |