Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(32)

Side by Side Diff: chrome/browser/plugin_infobar_delegates.h

Issue 10879037: Rename InfoBarTabService -> InfoBarService. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix include guard Created 8 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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_PLUGIN_INFOBAR_DELEGATES_H_ 5 #ifndef CHROME_BROWSER_PLUGIN_INFOBAR_DELEGATES_H_
6 #define CHROME_BROWSER_PLUGIN_INFOBAR_DELEGATES_H_ 6 #define CHROME_BROWSER_PLUGIN_INFOBAR_DELEGATES_H_
7 7
8 #include "base/callback.h" 8 #include "base/callback.h"
9 #include "chrome/browser/api/infobars/confirm_infobar_delegate.h" 9 #include "chrome/browser/api/infobars/confirm_infobar_delegate.h"
10 #include "googleurl/src/gurl.h" 10 #include "googleurl/src/gurl.h"
11 11
12 #if defined(ENABLE_PLUGIN_INSTALLATION) 12 #if defined(ENABLE_PLUGIN_INSTALLATION)
13 #include "chrome/browser/plugin_installer_observer.h" 13 #include "chrome/browser/plugin_installer_observer.h"
14 #endif // defined(ENABLE_PLUGIN_INSTALLATION) 14 #endif // defined(ENABLE_PLUGIN_INSTALLATION)
15 15
16 class InfoBarTabService; 16 class InfoBarService;
17 class HostContentSettingsMap; 17 class HostContentSettingsMap;
18 class PluginObserver; 18 class PluginObserver;
19 19
20 // Base class for blocked plug-in infobars. 20 // Base class for blocked plug-in infobars.
21 class PluginInfoBarDelegate : public ConfirmInfoBarDelegate { 21 class PluginInfoBarDelegate : public ConfirmInfoBarDelegate {
22 public: 22 public:
23 PluginInfoBarDelegate(InfoBarTabService* infobar_service, 23 PluginInfoBarDelegate(InfoBarService* infobar_service,
24 const string16& name, 24 const string16& name,
25 const std::string& identifier); 25 const std::string& identifier);
26 26
27 protected: 27 protected:
28 virtual ~PluginInfoBarDelegate(); 28 virtual ~PluginInfoBarDelegate();
29 29
30 // ConfirmInfoBarDelegate: 30 // ConfirmInfoBarDelegate:
31 virtual bool LinkClicked(WindowOpenDisposition disposition) OVERRIDE; 31 virtual bool LinkClicked(WindowOpenDisposition disposition) OVERRIDE;
32 32
33 virtual std::string GetLearnMoreURL() const = 0; 33 virtual std::string GetLearnMoreURL() const = 0;
34 34
35 void LoadBlockedPlugins(); 35 void LoadBlockedPlugins();
36 36
37 string16 name_; 37 string16 name_;
38 38
39 private: 39 private:
40 // ConfirmInfoBarDelegate: 40 // ConfirmInfoBarDelegate:
41 virtual gfx::Image* GetIcon() const OVERRIDE; 41 virtual gfx::Image* GetIcon() const OVERRIDE;
42 virtual string16 GetLinkText() const OVERRIDE; 42 virtual string16 GetLinkText() const OVERRIDE;
43 43
44 std::string identifier_; 44 std::string identifier_;
45 45
46 DISALLOW_COPY_AND_ASSIGN(PluginInfoBarDelegate); 46 DISALLOW_COPY_AND_ASSIGN(PluginInfoBarDelegate);
47 }; 47 };
48 48
49 // Infobar that's shown when a plug-in requires user authorization to run. 49 // Infobar that's shown when a plug-in requires user authorization to run.
50 class UnauthorizedPluginInfoBarDelegate : public PluginInfoBarDelegate { 50 class UnauthorizedPluginInfoBarDelegate : public PluginInfoBarDelegate {
51 public: 51 public:
52 UnauthorizedPluginInfoBarDelegate(InfoBarTabService* infobar_service, 52 UnauthorizedPluginInfoBarDelegate(InfoBarService* infobar_service,
53 HostContentSettingsMap* content_settings, 53 HostContentSettingsMap* content_settings,
54 const string16& name, 54 const string16& name,
55 const std::string& identifier); 55 const std::string& identifier);
56 56
57 private: 57 private:
58 virtual ~UnauthorizedPluginInfoBarDelegate(); 58 virtual ~UnauthorizedPluginInfoBarDelegate();
59 59
60 // PluginInfoBarDelegate: 60 // PluginInfoBarDelegate:
61 virtual string16 GetMessageText() const OVERRIDE; 61 virtual string16 GetMessageText() const OVERRIDE;
62 virtual string16 GetButtonLabel(InfoBarButton button) const OVERRIDE; 62 virtual string16 GetButtonLabel(InfoBarButton button) const OVERRIDE;
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
101 virtual void DownloadFinished() OVERRIDE; 101 virtual void DownloadFinished() OVERRIDE;
102 102
103 // WeakPluginInstallerObserver: 103 // WeakPluginInstallerObserver:
104 virtual void OnlyWeakObserversLeft() OVERRIDE; 104 virtual void OnlyWeakObserversLeft() OVERRIDE;
105 105
106 // Replaces this infobar with one showing |message|. The new infobar will 106 // Replaces this infobar with one showing |message|. The new infobar will
107 // not have any buttons (and not call the callback). 107 // not have any buttons (and not call the callback).
108 void ReplaceWithInfoBar(const string16& message); 108 void ReplaceWithInfoBar(const string16& message);
109 109
110 // Has the same lifetime as TabContents, which owns us 110 // Has the same lifetime as TabContents, which owns us
111 // (transitively via InfoBarTabService). 111 // (transitively via InfoBarService).
112 PluginObserver* observer_; 112 PluginObserver* observer_;
113 113
114 string16 message_; 114 string16 message_;
115 115
116 DISALLOW_COPY_AND_ASSIGN(OutdatedPluginInfoBarDelegate); 116 DISALLOW_COPY_AND_ASSIGN(OutdatedPluginInfoBarDelegate);
117 }; 117 };
118 118
119 // The main purpose for this class is to popup/close the infobar when there is 119 // The main purpose for this class is to popup/close the infobar when there is
120 // a missing plugin. 120 // a missing plugin.
121 class PluginInstallerInfoBarDelegate : public ConfirmInfoBarDelegate, 121 class PluginInstallerInfoBarDelegate : public ConfirmInfoBarDelegate,
122 public WeakPluginInstallerObserver { 122 public WeakPluginInstallerObserver {
123 public: 123 public:
124 // Shows an infobar asking whether to install the plugin represented by 124 // Shows an infobar asking whether to install the plugin represented by
125 // |installer|. When the user accepts, |callback| is called. 125 // |installer|. When the user accepts, |callback| is called.
126 // During installation of the plug-in, the infobar will change to reflect the 126 // During installation of the plug-in, the infobar will change to reflect the
127 // installation state. 127 // installation state.
128 static InfoBarDelegate* Create(InfoBarTabService* infobar_service, 128 static InfoBarDelegate* Create(InfoBarService* infobar_service,
129 PluginInstaller* installer, 129 PluginInstaller* installer,
130 const base::Closure& callback); 130 const base::Closure& callback);
131 131
132 private: 132 private:
133 friend class OutdatedPluginInfoBarDelegate; 133 friend class OutdatedPluginInfoBarDelegate;
134 134
135 PluginInstallerInfoBarDelegate(InfoBarTabService* infobar_service, 135 PluginInstallerInfoBarDelegate(InfoBarService* infobar_service,
136 PluginInstaller* installer, 136 PluginInstaller* installer,
137 const base::Closure& callback, 137 const base::Closure& callback,
138 bool new_install, 138 bool new_install,
139 const string16& message); 139 const string16& message);
140 virtual ~PluginInstallerInfoBarDelegate(); 140 virtual ~PluginInstallerInfoBarDelegate();
141 141
142 // ConfirmInfoBarDelegate: 142 // ConfirmInfoBarDelegate:
143 virtual gfx::Image* GetIcon() const OVERRIDE; 143 virtual gfx::Image* GetIcon() const OVERRIDE;
144 virtual string16 GetMessageText() const OVERRIDE; 144 virtual string16 GetMessageText() const OVERRIDE;
145 virtual int GetButtons() const OVERRIDE; 145 virtual int GetButtons() const OVERRIDE;
(...skipping 24 matching lines...) Expand all
170 170
171 DISALLOW_COPY_AND_ASSIGN(PluginInstallerInfoBarDelegate); 171 DISALLOW_COPY_AND_ASSIGN(PluginInstallerInfoBarDelegate);
172 }; 172 };
173 #endif // defined(ENABLE_PLUGIN_INSTALLATION) 173 #endif // defined(ENABLE_PLUGIN_INSTALLATION)
174 174
175 #if defined(OS_WIN) 175 #if defined(OS_WIN)
176 class PluginMetroModeInfoBarDelegate : public ConfirmInfoBarDelegate { 176 class PluginMetroModeInfoBarDelegate : public ConfirmInfoBarDelegate {
177 public: 177 public:
178 // Shows an infobar asking the user to switch to desktop chrome if they 178 // Shows an infobar asking the user to switch to desktop chrome if they
179 // want to use the plugin. 179 // want to use the plugin.
180 static InfoBarDelegate* Create(InfoBarTabService* infobar_service, 180 static InfoBarDelegate* Create(InfoBarService* infobar_service,
181 const string16& plugin_name); 181 const string16& plugin_name);
182 private: 182 private:
183 PluginMetroModeInfoBarDelegate(InfoBarTabService* infobar_service, 183 PluginMetroModeInfoBarDelegate(InfoBarService* infobar_service,
184 const string16& message); 184 const string16& message);
185 virtual ~PluginMetroModeInfoBarDelegate(); 185 virtual ~PluginMetroModeInfoBarDelegate();
186 186
187 // ConfirmInfoBarDelegate: 187 // ConfirmInfoBarDelegate:
188 virtual gfx::Image* GetIcon() const OVERRIDE; 188 virtual gfx::Image* GetIcon() const OVERRIDE;
189 virtual string16 GetMessageText() const OVERRIDE; 189 virtual string16 GetMessageText() const OVERRIDE;
190 virtual int GetButtons() const OVERRIDE; 190 virtual int GetButtons() const OVERRIDE;
191 virtual string16 GetButtonLabel(InfoBarButton button) const OVERRIDE; 191 virtual string16 GetButtonLabel(InfoBarButton button) const OVERRIDE;
192 virtual bool Accept() OVERRIDE; 192 virtual bool Accept() OVERRIDE;
193 virtual string16 GetLinkText() const OVERRIDE; 193 virtual string16 GetLinkText() const OVERRIDE;
194 virtual bool LinkClicked(WindowOpenDisposition disposition) OVERRIDE; 194 virtual bool LinkClicked(WindowOpenDisposition disposition) OVERRIDE;
195 195
196 string16 message_; 196 string16 message_;
197 197
198 DISALLOW_COPY_AND_ASSIGN(PluginMetroModeInfoBarDelegate); 198 DISALLOW_COPY_AND_ASSIGN(PluginMetroModeInfoBarDelegate);
199 }; 199 };
200 #endif // defined(OS_WIN) 200 #endif // defined(OS_WIN)
201 201
202 #endif // CHROME_BROWSER_PLUGIN_INFOBAR_DELEGATES_H_ 202 #endif // CHROME_BROWSER_PLUGIN_INFOBAR_DELEGATES_H_
OLDNEW
« no previous file with comments | « chrome/browser/infobars/infobar_tab_helper.cc ('k') | chrome/browser/plugin_infobar_delegates.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698