Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(301)

Side by Side Diff: chrome/browser/ui/views/infobars/confirm_infobar.h

Issue 1777813002: MD - use new style of text button in infobars. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: uac button cleanup Created 4 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | chrome/browser/ui/views/infobars/confirm_infobar.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 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 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef CHROME_BROWSER_UI_VIEWS_INFOBARS_CONFIRM_INFOBAR_H_ 5 #ifndef CHROME_BROWSER_UI_VIEWS_INFOBARS_CONFIRM_INFOBAR_H_
6 #define CHROME_BROWSER_UI_VIEWS_INFOBARS_CONFIRM_INFOBAR_H_ 6 #define CHROME_BROWSER_UI_VIEWS_INFOBARS_CONFIRM_INFOBAR_H_
7 7
8 #include "base/compiler_specific.h" 8 #include "base/compiler_specific.h"
9 #include "base/macros.h" 9 #include "base/macros.h"
10 #include "chrome/browser/ui/views/infobars/infobar_view.h" 10 #include "chrome/browser/ui/views/infobars/infobar_view.h"
11 #include "ui/views/controls/link_listener.h" 11 #include "ui/views/controls/link_listener.h"
12 12
13 class ConfirmInfoBarDelegate; 13 class ConfirmInfoBarDelegate;
14 class ElevationIconSetter; 14 class ElevationIconSetter;
15 15
16 namespace views { 16 namespace views {
17 class Button; 17 class Button;
18 class Label; 18 class Label;
19 class LabelButton;
19 } 20 }
20 21
21 // An infobar that shows a message, up to two optional buttons, and an optional, 22 // An infobar that shows a message, up to two optional buttons, and an optional,
22 // right-aligned link. This is commonly used to do things like: 23 // right-aligned link. This is commonly used to do things like:
23 // "Would you like to do X? [Yes] [No] _Learn More_ [x]" 24 // "Would you like to do X? [Yes] [No] _Learn More_ [x]"
24 class ConfirmInfoBar : public InfoBarView, 25 class ConfirmInfoBar : public InfoBarView,
25 public views::LinkListener { 26 public views::LinkListener {
26 public: 27 public:
27 explicit ConfirmInfoBar(scoped_ptr<ConfirmInfoBarDelegate> delegate); 28 explicit ConfirmInfoBar(scoped_ptr<ConfirmInfoBarDelegate> delegate);
28 ~ConfirmInfoBar() override; 29 ~ConfirmInfoBar() override;
29 30
30 private: 31 private:
31 // InfoBarView: 32 // InfoBarView:
32 void Layout() override; 33 void Layout() override;
33 void ViewHierarchyChanged( 34 void ViewHierarchyChanged(
34 const ViewHierarchyChangedDetails& details) override; 35 const ViewHierarchyChangedDetails& details) override;
35 void ButtonPressed(views::Button* sender, const ui::Event& event) override; 36 void ButtonPressed(views::Button* sender, const ui::Event& event) override;
36 int ContentMinimumWidth() const override; 37 int ContentMinimumWidth() const override;
37 38
38 // views::LinkListener: 39 // views::LinkListener:
39 void LinkClicked(views::Link* source, int event_flags) override; 40 void LinkClicked(views::Link* source, int event_flags) override;
40 41
41 ConfirmInfoBarDelegate* GetDelegate(); 42 ConfirmInfoBarDelegate* GetDelegate();
42 43
43 // Returns the width of all content other than the label and link. Layout() 44 // 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 // uses this to determine how much space the label and link can take.
45 int NonLabelWidth() const; 46 int NonLabelWidth() const;
46 47
47 views::Label* label_; 48 views::Label* label_;
48 views::Button* ok_button_; 49 views::LabelButton* ok_button_;
49 views::Button* cancel_button_; 50 views::Button* cancel_button_;
50 views::Link* link_; 51 views::Link* link_;
51 scoped_ptr<ElevationIconSetter> elevation_icon_setter_; 52 scoped_ptr<ElevationIconSetter> elevation_icon_setter_;
52 53
53 DISALLOW_COPY_AND_ASSIGN(ConfirmInfoBar); 54 DISALLOW_COPY_AND_ASSIGN(ConfirmInfoBar);
54 }; 55 };
55 56
56 #endif // CHROME_BROWSER_UI_VIEWS_INFOBARS_CONFIRM_INFOBAR_H_ 57 #endif // CHROME_BROWSER_UI_VIEWS_INFOBARS_CONFIRM_INFOBAR_H_
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/ui/views/infobars/confirm_infobar.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698