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 3 // found in the LICENSE file. 4 5 #ifndef CHROME_BROWSER_UI_PAGE_INFO_PAGE_INFO_INFOBAR_DELEGATE_H_ 6 #define CHROME_BROWSER_UI_PAGE_INFO_PAGE_INFO_INFOBAR_DELEGATE_H_ 7 8 #include "base/macros.h" 9 #include "components/infobars/core/confirm_infobar_delegate.h" 10 11 class InfoBarService; 12 13 // This class configures an infobar that is shown when the page info UI 14 // is closed and the settings for one or more site permissions have been 15 // changed. The user is shown a message indicating that a reload of the page is 16 // required for the changes to take effect, and presented a button to perform 17 // the reload right from the infobar. 18 class PageInfoInfoBarDelegate : public ConfirmInfoBarDelegate { 19 public: 20 // Creates a page info infobar and delegate and adds the infobar to 21 // |infobar_service|. 22 static void Create(InfoBarService* infobar_service); 23 24 private: 25 PageInfoInfoBarDelegate(); 26 ~PageInfoInfoBarDelegate() override; 27 28 // ConfirmInfoBarDelegate: 29 infobars::InfoBarDelegate::InfoBarIdentifier GetIdentifier() const override; 30 const gfx::VectorIcon& GetVectorIcon() const override; 31 base::string16 GetMessageText() const override; 32 int GetButtons() const override; 33 base::string16 GetButtonLabel(InfoBarButton button) const override; 34 bool Accept() override; 35 36 DISALLOW_COPY_AND_ASSIGN(PageInfoInfoBarDelegate); 37 }; 38 39 #endif // CHROME_BROWSER_UI_PAGE_INFO_PAGE_INFO_INFOBAR_DELEGATE_H_ 40