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_EXTENSIONS_EXTENSION_INFOBAR_DELEGATE_H_ | 5 #ifndef CHROME_BROWSER_EXTENSIONS_EXTENSION_INFOBAR_DELEGATE_H_ |
6 #define CHROME_BROWSER_EXTENSIONS_EXTENSION_INFOBAR_DELEGATE_H_ | 6 #define CHROME_BROWSER_EXTENSIONS_EXTENSION_INFOBAR_DELEGATE_H_ |
7 | 7 |
8 #include "base/memory/scoped_ptr.h" | 8 #include "base/memory/scoped_ptr.h" |
9 #include "base/scoped_observer.h" | 9 #include "base/scoped_observer.h" |
10 #include "components/infobars/core/confirm_infobar_delegate.h" | 10 #include "components/infobars/core/confirm_infobar_delegate.h" |
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
62 const GURL& url, | 62 const GURL& url, |
63 content::WebContents* web_contents, | 63 content::WebContents* web_contents, |
64 int height); | 64 int height); |
65 | 65 |
66 // Returns an extension infobar that owns |delegate|. | 66 // Returns an extension infobar that owns |delegate|. |
67 static scoped_ptr<infobars::InfoBar> CreateInfoBar( | 67 static scoped_ptr<infobars::InfoBar> CreateInfoBar( |
68 scoped_ptr<ExtensionInfoBarDelegate> delegate); | 68 scoped_ptr<ExtensionInfoBarDelegate> delegate); |
69 | 69 |
70 // InfoBarDelegate. | 70 // InfoBarDelegate. |
71 virtual bool EqualsDelegate( | 71 virtual bool EqualsDelegate( |
72 infobars::InfoBarDelegate* delegate) const OVERRIDE; | 72 infobars::InfoBarDelegate* delegate) const override; |
73 virtual void InfoBarDismissed() OVERRIDE; | 73 virtual void InfoBarDismissed() override; |
74 virtual Type GetInfoBarType() const OVERRIDE; | 74 virtual Type GetInfoBarType() const override; |
75 virtual ExtensionInfoBarDelegate* AsExtensionInfoBarDelegate() OVERRIDE; | 75 virtual ExtensionInfoBarDelegate* AsExtensionInfoBarDelegate() override; |
76 | 76 |
77 // content::NotificationObserver. | 77 // content::NotificationObserver. |
78 virtual void Observe(int type, | 78 virtual void Observe(int type, |
79 const content::NotificationSource& source, | 79 const content::NotificationSource& source, |
80 const content::NotificationDetails& details) OVERRIDE; | 80 const content::NotificationDetails& details) override; |
81 | 81 |
82 // extensions::ExtensionRegistryObserver. | 82 // extensions::ExtensionRegistryObserver. |
83 virtual void OnExtensionUnloaded( | 83 virtual void OnExtensionUnloaded( |
84 content::BrowserContext* browser_context, | 84 content::BrowserContext* browser_context, |
85 const extensions::Extension* extension, | 85 const extensions::Extension* extension, |
86 extensions::UnloadedExtensionInfo::Reason reason) OVERRIDE; | 86 extensions::UnloadedExtensionInfo::Reason reason) override; |
87 | 87 |
88 #if defined(TOOLKIT_VIEWS) | 88 #if defined(TOOLKIT_VIEWS) |
89 Browser* browser_; // We pass this to the ExtensionInfoBar. | 89 Browser* browser_; // We pass this to the ExtensionInfoBar. |
90 #endif | 90 #endif |
91 | 91 |
92 // The extension host we are showing the InfoBar for. | 92 // The extension host we are showing the InfoBar for. |
93 // TODO(pkasting): Should this live on the InfoBar instead? | 93 // TODO(pkasting): Should this live on the InfoBar instead? |
94 scoped_ptr<extensions::ExtensionViewHost> extension_view_host_; | 94 scoped_ptr<extensions::ExtensionViewHost> extension_view_host_; |
95 | 95 |
96 const extensions::Extension* extension_; | 96 const extensions::Extension* extension_; |
97 content::NotificationRegistrar registrar_; | 97 content::NotificationRegistrar registrar_; |
98 | 98 |
99 ScopedObserver<extensions::ExtensionRegistry, | 99 ScopedObserver<extensions::ExtensionRegistry, |
100 extensions::ExtensionRegistryObserver> | 100 extensions::ExtensionRegistryObserver> |
101 extension_registry_observer_; | 101 extension_registry_observer_; |
102 | 102 |
103 // The requested height of the infobar (in pixels). | 103 // The requested height of the infobar (in pixels). |
104 int height_; | 104 int height_; |
105 | 105 |
106 // Whether we are currently animating to close. This is used to ignore | 106 // Whether we are currently animating to close. This is used to ignore |
107 // ExtensionView::PreferredSizeChanged notifications. | 107 // ExtensionView::PreferredSizeChanged notifications. |
108 bool closing_; | 108 bool closing_; |
109 | 109 |
110 DISALLOW_COPY_AND_ASSIGN(ExtensionInfoBarDelegate); | 110 DISALLOW_COPY_AND_ASSIGN(ExtensionInfoBarDelegate); |
111 }; | 111 }; |
112 | 112 |
113 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_INFOBAR_DELEGATE_H_ | 113 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_INFOBAR_DELEGATE_H_ |
OLD | NEW |