Home | History | Annotate | Download | only in infobars
      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_UI_VIEWS_INFOBARS_CONFIRM_INFOBAR_H_
      6 #define CHROME_BROWSER_UI_VIEWS_INFOBARS_CONFIRM_INFOBAR_H_
      7 #pragma once
      8 
      9 #include "chrome/browser/ui/views/infobars/infobar_view.h"
     10 #include "views/controls/link.h"
     11 
     12 class ConfirmInfoBarDelegate;
     13 namespace views {
     14 class Label;
     15 class TextButton;
     16 }
     17 
     18 // An infobar that shows a message, up to two optional buttons, and an optional,
     19 // right-aligned link.  This is commonly used to do things like:
     20 // "Would you like to do X?  [Yes]  [No]               _Learn More_ [x]"
     21 class ConfirmInfoBar : public InfoBarView,
     22                        public views::LinkController {
     23  public:
     24   explicit ConfirmInfoBar(ConfirmInfoBarDelegate* delegate);
     25 
     26  private:
     27   virtual ~ConfirmInfoBar();
     28 
     29   // InfoBarView:
     30   virtual void Layout();
     31   virtual void ViewHierarchyChanged(bool is_add, View* parent, View* child);
     32   virtual void ButtonPressed(views::Button* sender, const views::Event& event);
     33   virtual int ContentMinimumWidth() const;
     34 
     35   // views::LinkController:
     36   virtual void LinkActivated(views::Link* source, int event_flags);
     37 
     38   ConfirmInfoBarDelegate* GetDelegate();
     39 
     40   views::Label* label_;
     41   views::TextButton* ok_button_;
     42   views::TextButton* cancel_button_;
     43   views::Link* link_;
     44 
     45   DISALLOW_COPY_AND_ASSIGN(ConfirmInfoBar);
     46 };
     47 
     48 #endif  // CHROME_BROWSER_UI_VIEWS_INFOBARS_CONFIRM_INFOBAR_H_
     49