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

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

Issue 681893002: Standardize usage of virtual/override/final specifiers. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 1 month 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.h » ('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_ALTERNATE_NAV_INFOBAR_VIEW_H_ 5 #ifndef CHROME_BROWSER_UI_VIEWS_INFOBARS_ALTERNATE_NAV_INFOBAR_VIEW_H_
6 #define CHROME_BROWSER_UI_VIEWS_INFOBARS_ALTERNATE_NAV_INFOBAR_VIEW_H_ 6 #define CHROME_BROWSER_UI_VIEWS_INFOBARS_ALTERNATE_NAV_INFOBAR_VIEW_H_
7 7
8 #include "base/memory/scoped_ptr.h" 8 #include "base/memory/scoped_ptr.h"
9 #include "chrome/browser/ui/views/infobars/infobar_view.h" 9 #include "chrome/browser/ui/views/infobars/infobar_view.h"
10 #include "ui/views/controls/link_listener.h" 10 #include "ui/views/controls/link_listener.h"
11 11
12 class AlternateNavInfoBarDelegate; 12 class AlternateNavInfoBarDelegate;
13 13
14 // An infobar that shows a string with an embedded link. 14 // An infobar that shows a string with an embedded link.
15 class AlternateNavInfoBarView : public InfoBarView, 15 class AlternateNavInfoBarView : public InfoBarView,
16 public views::LinkListener { 16 public views::LinkListener {
17 public: 17 public:
18 explicit AlternateNavInfoBarView( 18 explicit AlternateNavInfoBarView(
19 scoped_ptr<AlternateNavInfoBarDelegate> delegate); 19 scoped_ptr<AlternateNavInfoBarDelegate> delegate);
20 virtual ~AlternateNavInfoBarView(); 20 ~AlternateNavInfoBarView() override;
21 21
22 private: 22 private:
23 // Treating |labels| as pieces of one continuous string, elides to fit 23 // Treating |labels| as pieces of one continuous string, elides to fit
24 // |available_width| so as to guarantee that a trailing ellipsis is always 24 // |available_width| so as to guarantee that a trailing ellipsis is always
25 // displayed when the string is elided and there is at least room to display 25 // displayed when the string is elided and there is at least room to display
26 // a lone ellipsis. 26 // a lone ellipsis.
27 // 27 //
28 // NOTE: This may modify the text of any/all of the labels, so reset their 28 // NOTE: This may modify the text of any/all of the labels, so reset their
29 // texts when the available width changes before calling this again. 29 // texts when the available width changes before calling this again.
30 static void ElideLabels(Labels* labels, int available_width); 30 static void ElideLabels(Labels* labels, int available_width);
31 31
32 // InfoBarView: 32 // InfoBarView:
33 virtual void Layout() override; 33 void Layout() override;
34 virtual void ViewHierarchyChanged( 34 void ViewHierarchyChanged(
35 const ViewHierarchyChangedDetails& details) override; 35 const ViewHierarchyChangedDetails& details) override;
36 virtual int ContentMinimumWidth() const override; 36 int ContentMinimumWidth() const override;
37 37
38 // views::LinkListener: 38 // views::LinkListener:
39 virtual void LinkClicked(views::Link* source, int event_flags) override; 39 void LinkClicked(views::Link* source, int event_flags) override;
40 40
41 AlternateNavInfoBarDelegate* GetDelegate(); 41 AlternateNavInfoBarDelegate* GetDelegate();
42 42
43 base::string16 label_1_text_; 43 base::string16 label_1_text_;
44 base::string16 link_text_; 44 base::string16 link_text_;
45 base::string16 label_2_text_; 45 base::string16 label_2_text_;
46 46
47 views::Label* label_1_; 47 views::Label* label_1_;
48 views::Link* link_; 48 views::Link* link_;
49 views::Label* label_2_; 49 views::Label* label_2_;
50 50
51 DISALLOW_COPY_AND_ASSIGN(AlternateNavInfoBarView); 51 DISALLOW_COPY_AND_ASSIGN(AlternateNavInfoBarView);
52 }; 52 };
53 53
54 #endif // CHROME_BROWSER_UI_VIEWS_INFOBARS_ALTERNATE_NAV_INFOBAR_VIEW_H_ 54 #endif // CHROME_BROWSER_UI_VIEWS_INFOBARS_ALTERNATE_NAV_INFOBAR_VIEW_H_
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/ui/views/infobars/confirm_infobar.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698