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_PLUGINS_PLUGIN_INFOBAR_DELEGATES_H_ | 5 #ifndef CHROME_BROWSER_PLUGINS_PLUGIN_INFOBAR_DELEGATES_H_ |
6 #define CHROME_BROWSER_PLUGINS_PLUGIN_INFOBAR_DELEGATES_H_ | 6 #define CHROME_BROWSER_PLUGINS_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" |
(...skipping 167 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
178 | 178 |
179 string16 message_; | 179 string16 message_; |
180 | 180 |
181 DISALLOW_COPY_AND_ASSIGN(PluginInstallerInfoBarDelegate); | 181 DISALLOW_COPY_AND_ASSIGN(PluginInstallerInfoBarDelegate); |
182 }; | 182 }; |
183 #endif // defined(ENABLE_PLUGIN_INSTALLATION) | 183 #endif // defined(ENABLE_PLUGIN_INSTALLATION) |
184 | 184 |
185 #if defined(OS_WIN) | 185 #if defined(OS_WIN) |
186 class PluginMetroModeInfoBarDelegate : public ConfirmInfoBarDelegate { | 186 class PluginMetroModeInfoBarDelegate : public ConfirmInfoBarDelegate { |
187 public: | 187 public: |
188 // Shows an infobar asking the user to switch to desktop chrome if they | 188 // The infobar can be used for two purposes: to inform the user about a |
189 // want to use the plugin. | 189 // missing plugin or to note that a plugin only works in desktop mode. These |
| 190 // purposes require different messages, buttons, etc. |
| 191 enum Mode { |
| 192 MISSING_PLUGIN, |
| 193 DESKTOP_MODE_REQUIRED, |
| 194 }; |
| 195 |
190 PluginMetroModeInfoBarDelegate(InfoBarService* infobar_service, | 196 PluginMetroModeInfoBarDelegate(InfoBarService* infobar_service, |
191 const string16& plugin_name, | 197 Mode mode, |
192 const string16& ok_label, | 198 const string16& name); |
193 const GURL& learn_more_url, | 199 |
194 bool show_dont_ask_again_button); | |
195 private: | 200 private: |
196 virtual ~PluginMetroModeInfoBarDelegate(); | 201 virtual ~PluginMetroModeInfoBarDelegate(); |
197 | 202 |
198 // ConfirmInfoBarDelegate: | 203 // ConfirmInfoBarDelegate: |
199 virtual gfx::Image* GetIcon() const OVERRIDE; | 204 virtual gfx::Image* GetIcon() const OVERRIDE; |
200 virtual string16 GetMessageText() const OVERRIDE; | 205 virtual string16 GetMessageText() const OVERRIDE; |
201 virtual int GetButtons() const OVERRIDE; | 206 virtual int GetButtons() const OVERRIDE; |
202 virtual string16 GetButtonLabel(InfoBarButton button) const OVERRIDE; | 207 virtual string16 GetButtonLabel(InfoBarButton button) const OVERRIDE; |
203 virtual bool Accept() OVERRIDE; | 208 virtual bool Accept() OVERRIDE; |
204 virtual bool Cancel() OVERRIDE; | 209 virtual bool Cancel() OVERRIDE; |
205 virtual string16 GetLinkText() const OVERRIDE; | 210 virtual string16 GetLinkText() const OVERRIDE; |
206 virtual bool LinkClicked(WindowOpenDisposition disposition) OVERRIDE; | 211 virtual bool LinkClicked(WindowOpenDisposition disposition) OVERRIDE; |
207 | 212 |
208 const string16 message_; | 213 const Mode mode_; |
209 const string16 ok_label_; | 214 const string16 name_; |
210 const GURL learn_more_url_; | |
211 const bool show_dont_ask_again_button_; | |
212 | 215 |
213 DISALLOW_COPY_AND_ASSIGN(PluginMetroModeInfoBarDelegate); | 216 DISALLOW_COPY_AND_ASSIGN(PluginMetroModeInfoBarDelegate); |
214 }; | 217 }; |
215 #endif // defined(OS_WIN) | 218 #endif // defined(OS_WIN) |
216 | 219 |
217 #endif // CHROME_BROWSER_PLUGINS_PLUGIN_INFOBAR_DELEGATES_H_ | 220 #endif // CHROME_BROWSER_PLUGINS_PLUGIN_INFOBAR_DELEGATES_H_ |
OLD | NEW |