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 "chrome/browser/infobars/confirm_infobar_delegate.h" | 10 #include "chrome/browser/infobars/confirm_infobar_delegate.h" |
(...skipping 27 matching lines...) Expand all Loading... |
38 static void Create(content::WebContents* web_contents, | 38 static void Create(content::WebContents* web_contents, |
39 Browser* browser, | 39 Browser* browser, |
40 const extensions::Extension* extension, | 40 const extensions::Extension* extension, |
41 const GURL& url, | 41 const GURL& url, |
42 int height); | 42 int height); |
43 | 43 |
44 const extensions::Extension* extension() { return extension_; } | 44 const extensions::Extension* extension() { return extension_; } |
45 extensions::ExtensionViewHost* extension_view_host() { | 45 extensions::ExtensionViewHost* extension_view_host() { |
46 return extension_view_host_.get(); | 46 return extension_view_host_.get(); |
47 } | 47 } |
| 48 const extensions::ExtensionViewHost* extension_view_host() const { |
| 49 return extension_view_host_.get(); |
| 50 } |
| 51 |
48 int height() { return height_; } | 52 int height() { return height_; } |
49 | 53 |
50 bool closing() const { return closing_; } | 54 bool closing() const { return closing_; } |
51 | 55 |
52 // Returns the WebContents associated with the ExtensionInfoBarDelegate. | 56 // Returns the WebContents associated with the ExtensionInfoBarDelegate. |
53 content::WebContents* GetWebContents(); | 57 content::WebContents* GetWebContents(); |
54 | 58 |
55 private: | 59 private: |
56 ExtensionInfoBarDelegate(Browser* browser, | 60 ExtensionInfoBarDelegate(Browser* browser, |
57 const extensions::Extension* extension, | 61 const extensions::Extension* extension, |
58 const GURL& url, | 62 const GURL& url, |
59 content::WebContents* web_contents, | 63 content::WebContents* web_contents, |
60 int height); | 64 int height); |
61 | 65 |
62 // Returns an extension infobar that owns |delegate|. | 66 // Returns an extension infobar that owns |delegate|. |
63 static scoped_ptr<infobars::InfoBar> CreateInfoBar( | 67 static scoped_ptr<infobars::InfoBar> CreateInfoBar( |
64 scoped_ptr<ExtensionInfoBarDelegate> delegate); | 68 scoped_ptr<ExtensionInfoBarDelegate> delegate); |
65 | 69 |
66 // InfoBarDelegate. | 70 // InfoBarDelegate. |
67 virtual bool EqualsDelegate( | 71 virtual bool EqualsDelegate( |
68 infobars::InfoBarDelegate* delegate) const OVERRIDE; | 72 infobars::InfoBarDelegate* delegate) const OVERRIDE; |
69 virtual void InfoBarDismissed() OVERRIDE; | 73 virtual void InfoBarDismissed() OVERRIDE; |
70 virtual Type GetInfoBarType() const OVERRIDE; | 74 virtual Type GetInfoBarType() const OVERRIDE; |
71 virtual ExtensionInfoBarDelegate* AsExtensionInfoBarDelegate() OVERRIDE; | 75 virtual ExtensionInfoBarDelegate* AsExtensionInfoBarDelegate() OVERRIDE; |
| 76 virtual const ExtensionInfoBarDelegate* |
| 77 AsExtensionInfoBarDelegate() const OVERRIDE; |
72 | 78 |
73 // content::NotificationObserver. | 79 // content::NotificationObserver. |
74 virtual void Observe(int type, | 80 virtual void Observe(int type, |
75 const content::NotificationSource& source, | 81 const content::NotificationSource& source, |
76 const content::NotificationDetails& details) OVERRIDE; | 82 const content::NotificationDetails& details) OVERRIDE; |
77 | 83 |
78 // extensions::ExtensionRegistryObserver. | 84 // extensions::ExtensionRegistryObserver. |
79 virtual void OnExtensionUnloaded( | 85 virtual void OnExtensionUnloaded( |
80 content::BrowserContext* browser_context, | 86 content::BrowserContext* browser_context, |
81 const extensions::Extension* extension, | 87 const extensions::Extension* extension, |
(...skipping 18 matching lines...) Expand all Loading... |
100 int height_; | 106 int height_; |
101 | 107 |
102 // Whether we are currently animating to close. This is used to ignore | 108 // Whether we are currently animating to close. This is used to ignore |
103 // ExtensionView::PreferredSizeChanged notifications. | 109 // ExtensionView::PreferredSizeChanged notifications. |
104 bool closing_; | 110 bool closing_; |
105 | 111 |
106 DISALLOW_COPY_AND_ASSIGN(ExtensionInfoBarDelegate); | 112 DISALLOW_COPY_AND_ASSIGN(ExtensionInfoBarDelegate); |
107 }; | 113 }; |
108 | 114 |
109 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_INFOBAR_DELEGATE_H_ | 115 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_INFOBAR_DELEGATE_H_ |
OLD | NEW |