| OLD | NEW |
| (Empty) |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | |
| 2 // Use of this source code is governed by a BSD-style license that can be | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 #ifndef CHROME_BROWSER_INFOBARS_INSECURE_CONTENT_INFOBAR_DELEGATE_H_ | |
| 6 #define CHROME_BROWSER_INFOBARS_INSECURE_CONTENT_INFOBAR_DELEGATE_H_ | |
| 7 | |
| 8 #include "base/macros.h" | |
| 9 #include "components/infobars/core/confirm_infobar_delegate.h" | |
| 10 | |
| 11 class InfoBarService; | |
| 12 | |
| 13 // Base class for delegates that show warnings on HTTPS pages which try to | |
| 14 // display or run insecure content. | |
| 15 class InsecureContentInfoBarDelegate : public ConfirmInfoBarDelegate { | |
| 16 public: | |
| 17 // Creates an insecure content infobar and delegate and adds the infobar to | |
| 18 // |infobar_service|, replacing any existing insecure content infobar. | |
| 19 static void Create(InfoBarService* infobar_service); | |
| 20 | |
| 21 private: | |
| 22 enum HistogramEvents { | |
| 23 DISPLAY_INFOBAR_SHOWN = 0, // Infobar was displayed. | |
| 24 DISPLAY_USER_OVERRIDE, // User clicked allow anyway button. | |
| 25 DISPLAY_USER_DID_NOT_LOAD, // User clicked the don't load button. | |
| 26 DISPLAY_INFOBAR_DISMISSED, // User clicked close button. | |
| 27 NUM_EVENTS | |
| 28 }; | |
| 29 | |
| 30 InsecureContentInfoBarDelegate(); | |
| 31 ~InsecureContentInfoBarDelegate() override; | |
| 32 | |
| 33 // ConfirmInfoBarDelegate: | |
| 34 infobars::InfoBarDelegate::InfoBarIdentifier GetIdentifier() const override; | |
| 35 void InfoBarDismissed() override; | |
| 36 InsecureContentInfoBarDelegate* AsInsecureContentInfoBarDelegate() override; | |
| 37 base::string16 GetMessageText() const override; | |
| 38 base::string16 GetButtonLabel(InfoBarButton button) const override; | |
| 39 bool Accept() override; | |
| 40 bool Cancel() override; | |
| 41 base::string16 GetLinkText() const override; | |
| 42 GURL GetLinkURL() const override; | |
| 43 | |
| 44 DISALLOW_COPY_AND_ASSIGN(InsecureContentInfoBarDelegate); | |
| 45 }; | |
| 46 | |
| 47 #endif // CHROME_BROWSER_INFOBARS_INSECURE_CONTENT_INFOBAR_DELEGATE_H_ | |
| 48 | |
| OLD | NEW |