NaCl: Update revision in DEPS, r12770 -> r12773
[chromium-blink-merge.git] / chrome / browser / ui / views / infobars / confirm_infobar.h
blob330f6662d1eef0407d7397065d8a83d6433c2539
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.
5 #ifndef CHROME_BROWSER_UI_VIEWS_INFOBARS_CONFIRM_INFOBAR_H_
6 #define CHROME_BROWSER_UI_VIEWS_INFOBARS_CONFIRM_INFOBAR_H_
8 #include "base/basictypes.h"
9 #include "base/compiler_specific.h"
10 #include "chrome/browser/ui/views/infobars/infobar_view.h"
11 #include "ui/views/controls/link_listener.h"
13 class ConfirmInfoBarDelegate;
15 namespace views {
16 class Label;
19 // An infobar that shows a message, up to two optional buttons, and an optional,
20 // right-aligned link. This is commonly used to do things like:
21 // "Would you like to do X? [Yes] [No] _Learn More_ [x]"
22 class ConfirmInfoBar : public InfoBarView,
23 public views::LinkListener {
24 public:
25 explicit ConfirmInfoBar(scoped_ptr<ConfirmInfoBarDelegate> delegate);
27 private:
28 virtual ~ConfirmInfoBar();
30 // InfoBarView:
31 virtual void Layout() OVERRIDE;
32 virtual void ViewHierarchyChanged(
33 const ViewHierarchyChangedDetails& details) OVERRIDE;
34 virtual void ButtonPressed(views::Button* sender,
35 const ui::Event& event) OVERRIDE;
36 virtual int ContentMinimumWidth() OVERRIDE;
38 // views::LinkListener:
39 virtual void LinkClicked(views::Link* source, int event_flags) OVERRIDE;
41 ConfirmInfoBarDelegate* GetDelegate();
43 // Returns the width of all content other than the label and link. Layout()
44 // uses this to determine how much space the label and link can take.
45 int NonLabelWidth() const;
47 views::Label* label_;
48 views::LabelButton* ok_button_;
49 views::LabelButton* cancel_button_;
50 views::Link* link_;
52 DISALLOW_COPY_AND_ASSIGN(ConfirmInfoBar);
55 #endif // CHROME_BROWSER_UI_VIEWS_INFOBARS_CONFIRM_INFOBAR_H_