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

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

Issue 657333002: Use scoped_ptr::Pass instead of scoped_ptr::PassAs<T>. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 2 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
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/basictypes.h" 8 #include "base/basictypes.h"
9 #include "base/compiler_specific.h" 9 #include "base/compiler_specific.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 Label; 17 class Label;
18 } 18 }
19 19
20 // An infobar that shows a message, up to two optional buttons, and an optional, 20 // An infobar that shows a message, up to two optional buttons, and an optional,
21 // right-aligned link. This is commonly used to do things like: 21 // right-aligned link. This is commonly used to do things like:
22 // "Would you like to do X? [Yes] [No] _Learn More_ [x]" 22 // "Would you like to do X? [Yes] [No] _Learn More_ [x]"
23 class ConfirmInfoBar : public InfoBarView, 23 class ConfirmInfoBar : public InfoBarView,
24 public views::LinkListener { 24 public views::LinkListener {
25 public: 25 public:
26 explicit ConfirmInfoBar(scoped_ptr<ConfirmInfoBarDelegate> delegate); 26 explicit ConfirmInfoBar(scoped_ptr<ConfirmInfoBarDelegate> delegate);
27 virtual ~ConfirmInfoBar();
27 28
28 private: 29 private:
29 virtual ~ConfirmInfoBar();
30
31 // InfoBarView: 30 // InfoBarView:
32 virtual void Layout() override; 31 virtual void Layout() override;
33 virtual void ViewHierarchyChanged( 32 virtual void ViewHierarchyChanged(
34 const ViewHierarchyChangedDetails& details) override; 33 const ViewHierarchyChangedDetails& details) override;
35 virtual void ButtonPressed(views::Button* sender, 34 virtual void ButtonPressed(views::Button* sender,
36 const ui::Event& event) override; 35 const ui::Event& event) override;
37 virtual int ContentMinimumWidth() const override; 36 virtual int ContentMinimumWidth() const override;
38 37
39 // views::LinkListener: 38 // views::LinkListener:
40 virtual void LinkClicked(views::Link* source, int event_flags) override; 39 virtual void LinkClicked(views::Link* source, int event_flags) override;
41 40
42 ConfirmInfoBarDelegate* GetDelegate(); 41 ConfirmInfoBarDelegate* GetDelegate();
43 42
44 // Returns the width of all content other than the label and link. Layout() 43 // Returns the width of all content other than the label and link. Layout()
45 // uses this to determine how much space the label and link can take. 44 // uses this to determine how much space the label and link can take.
46 int NonLabelWidth() const; 45 int NonLabelWidth() const;
47 46
48 views::Label* label_; 47 views::Label* label_;
49 views::LabelButton* ok_button_; 48 views::LabelButton* ok_button_;
50 views::LabelButton* cancel_button_; 49 views::LabelButton* cancel_button_;
51 views::Link* link_; 50 views::Link* link_;
52 scoped_ptr<ElevationIconSetter> elevation_icon_setter_; 51 scoped_ptr<ElevationIconSetter> elevation_icon_setter_;
53 52
54 DISALLOW_COPY_AND_ASSIGN(ConfirmInfoBar); 53 DISALLOW_COPY_AND_ASSIGN(ConfirmInfoBar);
55 }; 54 };
56 55
57 #endif // CHROME_BROWSER_UI_VIEWS_INFOBARS_CONFIRM_INFOBAR_H_ 56 #endif // CHROME_BROWSER_UI_VIEWS_INFOBARS_CONFIRM_INFOBAR_H_
OLDNEW
« no previous file with comments | « chrome/browser/ui/views/infobars/alternate_nav_infobar_view.cc ('k') | chrome/browser/ui/views/infobars/confirm_infobar.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698