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 "components/infobars/core/confirm_infobar_delegate.h" | 9 #include "components/infobars/core/confirm_infobar_delegate.h" |
10 #include "url/gurl.h" | 10 #include "url/gurl.h" |
(...skipping 26 matching lines...) Expand all Loading... |
37 private: | 37 private: |
38 // ConfirmInfoBarDelegate: | 38 // ConfirmInfoBarDelegate: |
39 int GetIconID() const override; | 39 int GetIconID() const override; |
40 base::string16 GetLinkText() const override; | 40 base::string16 GetLinkText() const override; |
41 | 41 |
42 std::string identifier_; | 42 std::string identifier_; |
43 | 43 |
44 DISALLOW_COPY_AND_ASSIGN(PluginInfoBarDelegate); | 44 DISALLOW_COPY_AND_ASSIGN(PluginInfoBarDelegate); |
45 }; | 45 }; |
46 | 46 |
47 // Infobar that's shown when a plug-in requires user authorization to run. | |
48 class UnauthorizedPluginInfoBarDelegate : public PluginInfoBarDelegate { | |
49 public: | |
50 // Creates an unauthorized plugin infobar and delegate and adds the infobar to | |
51 // |infobar_service|. | |
52 static void Create(InfoBarService* infobar_service, | |
53 HostContentSettingsMap* content_settings, | |
54 const base::string16& name, | |
55 const std::string& identifier); | |
56 | |
57 private: | |
58 UnauthorizedPluginInfoBarDelegate(HostContentSettingsMap* content_settings, | |
59 const base::string16& name, | |
60 const std::string& identifier); | |
61 ~UnauthorizedPluginInfoBarDelegate() override; | |
62 | |
63 // PluginInfoBarDelegate: | |
64 base::string16 GetMessageText() const override; | |
65 base::string16 GetButtonLabel(InfoBarButton button) const override; | |
66 bool Accept() override; | |
67 bool Cancel() override; | |
68 void InfoBarDismissed() override; | |
69 bool LinkClicked(WindowOpenDisposition disposition) override; | |
70 std::string GetLearnMoreURL() const override; | |
71 | |
72 HostContentSettingsMap* content_settings_; | |
73 base::string16 name_; | |
74 | |
75 DISALLOW_COPY_AND_ASSIGN(UnauthorizedPluginInfoBarDelegate); | |
76 }; | |
77 | |
78 #if defined(ENABLE_PLUGIN_INSTALLATION) | 47 #if defined(ENABLE_PLUGIN_INSTALLATION) |
79 // Infobar that's shown when a plug-in is out of date. | 48 // Infobar that's shown when a plug-in is out of date. |
80 class OutdatedPluginInfoBarDelegate : public PluginInfoBarDelegate, | 49 class OutdatedPluginInfoBarDelegate : public PluginInfoBarDelegate, |
81 public WeakPluginInstallerObserver { | 50 public WeakPluginInstallerObserver { |
82 public: | 51 public: |
83 // Creates an outdated plugin infobar and delegate and adds the infobar to | 52 // Creates an outdated plugin infobar and delegate and adds the infobar to |
84 // |infobar_service|. | 53 // |infobar_service|. |
85 static void Create(InfoBarService* infobar_service, | 54 static void Create(InfoBarService* infobar_service, |
86 PluginInstaller* installer, | 55 PluginInstaller* installer, |
87 scoped_ptr<PluginMetadata> metadata); | 56 scoped_ptr<PluginMetadata> metadata); |
(...skipping 131 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
219 virtual bool LinkClicked(WindowOpenDisposition disposition) override; | 188 virtual bool LinkClicked(WindowOpenDisposition disposition) override; |
220 | 189 |
221 const Mode mode_; | 190 const Mode mode_; |
222 const base::string16 name_; | 191 const base::string16 name_; |
223 | 192 |
224 DISALLOW_COPY_AND_ASSIGN(PluginMetroModeInfoBarDelegate); | 193 DISALLOW_COPY_AND_ASSIGN(PluginMetroModeInfoBarDelegate); |
225 }; | 194 }; |
226 #endif // defined(OS_WIN) | 195 #endif // defined(OS_WIN) |
227 | 196 |
228 #endif // CHROME_BROWSER_PLUGINS_PLUGIN_INFOBAR_DELEGATES_H_ | 197 #endif // CHROME_BROWSER_PLUGINS_PLUGIN_INFOBAR_DELEGATES_H_ |
OLD | NEW |