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_CUSTOM_HANDLERS_REGISTER_PROTOCOL_HANDLER_INFOBAR_DELEGATE_H_ 6 #define CHROME_BROWSER_CUSTOM_HANDLERS_REGISTER_PROTOCOL_HANDLER_INFOBAR_DELEGATE_H_ 7 #pragma once 8 9 #include "base/string16.h" 10 #include "chrome/browser/tab_contents/confirm_infobar_delegate.h" 11 12 class SkBitmap; 13 class ProtocolHandler; 14 class ProtocolHandlerRegistry; 15 class TabContents; 16 17 // An InfoBar delegate that enables the user to allow or deny storing credit 18 // card information gathered from a form submission. 19 class RegisterProtocolHandlerInfoBarDelegate : public ConfirmInfoBarDelegate { 20 public: 21 RegisterProtocolHandlerInfoBarDelegate(TabContents* tab_contents, 22 ProtocolHandlerRegistry* registry, 23 ProtocolHandler* handler); 24 25 // ConfirmInfoBarDelegate: 26 virtual bool ShouldExpire(const NavigationController::LoadCommittedDetails& 27 details) const OVERRIDE; 28 virtual void InfoBarClosed() OVERRIDE; 29 virtual Type GetInfoBarType() const OVERRIDE; 30 virtual string16 GetMessageText() const OVERRIDE; 31 virtual string16 GetButtonLabel(InfoBarButton button) const OVERRIDE; 32 virtual bool Accept() OVERRIDE; 33 virtual bool Cancel() OVERRIDE; 34 virtual string16 GetLinkText() OVERRIDE; 35 virtual bool LinkClicked(WindowOpenDisposition disposition) OVERRIDE; 36 37 private: 38 TabContents* tab_contents_; 39 ProtocolHandlerRegistry* registry_; 40 ProtocolHandler* handler_; 41 42 DISALLOW_COPY_AND_ASSIGN(RegisterProtocolHandlerInfoBarDelegate); 43 }; 44 45 #endif // CHROME_BROWSER_CUSTOM_HANDLERS_REGISTER_PROTOCOL_HANDLER_INFOBAR_DELEGATE_H_ 46