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

Side by Side Diff: chrome/browser/ui/views/infobars/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 | « chrome/browser/ui/views/infobars/infobar_container_view.h ('k') | no next file » | 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) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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_INFOBAR_VIEW_H_ 5 #ifndef CHROME_BROWSER_UI_VIEWS_INFOBARS_INFOBAR_VIEW_H_
6 #define CHROME_BROWSER_UI_VIEWS_INFOBARS_INFOBAR_VIEW_H_ 6 #define CHROME_BROWSER_UI_VIEWS_INFOBARS_INFOBAR_VIEW_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 "components/infobars/core/infobar.h" 10 #include "components/infobars/core/infobar.h"
(...skipping 27 matching lines...) Expand all
38 38
39 const SkPath& fill_path() const { return fill_path_; } 39 const SkPath& fill_path() const { return fill_path_; }
40 const SkPath& stroke_path() const { return stroke_path_; } 40 const SkPath& stroke_path() const { return stroke_path_; }
41 41
42 protected: 42 protected:
43 typedef std::vector<views::Label*> Labels; 43 typedef std::vector<views::Label*> Labels;
44 44
45 static const int kButtonButtonSpacing; 45 static const int kButtonButtonSpacing;
46 static const int kEndOfLabelSpacing; 46 static const int kEndOfLabelSpacing;
47 47
48 virtual ~InfoBarView(); 48 ~InfoBarView() override;
49 49
50 // Creates a label with the appropriate font and color for an infobar. 50 // Creates a label with the appropriate font and color for an infobar.
51 views::Label* CreateLabel(const base::string16& text) const; 51 views::Label* CreateLabel(const base::string16& text) const;
52 52
53 // Creates a link with the appropriate font and color for an infobar. 53 // Creates a link with the appropriate font and color for an infobar.
54 // NOTE: Subclasses must ignore link clicks if we're unowned. 54 // NOTE: Subclasses must ignore link clicks if we're unowned.
55 views::Link* CreateLink(const base::string16& text, 55 views::Link* CreateLink(const base::string16& text,
56 views::LinkListener* listener) const; 56 views::LinkListener* listener) const;
57 57
58 // Creates a button with an infobar-specific appearance. 58 // Creates a button with an infobar-specific appearance.
59 // NOTE: Subclasses must ignore button presses if we're unowned. 59 // NOTE: Subclasses must ignore button presses if we're unowned.
60 static views::LabelButton* CreateLabelButton(views::ButtonListener* listener, 60 static views::LabelButton* CreateLabelButton(views::ButtonListener* listener,
61 const base::string16& text); 61 const base::string16& text);
62 62
63 // Given |labels| and the total |available_width| to display them in, sets 63 // Given |labels| and the total |available_width| to display them in, sets
64 // each label's size so that the longest label shrinks until it reaches the 64 // each label's size so that the longest label shrinks until it reaches the
65 // length of the next-longest label, then both shrink until reaching the 65 // length of the next-longest label, then both shrink until reaching the
66 // length of the next-longest, and so forth. 66 // length of the next-longest, and so forth.
67 static void AssignWidths(Labels* labels, int available_width); 67 static void AssignWidths(Labels* labels, int available_width);
68 68
69 // views::View: 69 // views::View:
70 virtual void Layout() override; 70 void Layout() override;
71 virtual void ViewHierarchyChanged( 71 void ViewHierarchyChanged(
72 const ViewHierarchyChangedDetails& details) override; 72 const ViewHierarchyChangedDetails& details) override;
73 73
74 // views::ButtonListener: 74 // views::ButtonListener:
75 // NOTE: This must not be called if we're unowned. (Subclasses should ignore 75 // NOTE: This must not be called if we're unowned. (Subclasses should ignore
76 // calls to ButtonPressed() in this case.) 76 // calls to ButtonPressed() in this case.)
77 virtual void ButtonPressed(views::Button* sender, 77 void ButtonPressed(views::Button* sender, const ui::Event& event) override;
78 const ui::Event& event) override;
79 78
80 // Returns the minimum width the content (that is, everything between the icon 79 // Returns the minimum width the content (that is, everything between the icon
81 // and the close button) can be shrunk to. This is used to prevent the close 80 // and the close button) can be shrunk to. This is used to prevent the close
82 // button from overlapping views that cannot be shrunk any further. 81 // button from overlapping views that cannot be shrunk any further.
83 virtual int ContentMinimumWidth() const; 82 virtual int ContentMinimumWidth() const;
84 83
85 // These return x coordinates delimiting the usable area for subclasses to lay 84 // These return x coordinates delimiting the usable area for subclasses to lay
86 // out their controls. 85 // out their controls.
87 int StartX() const; 86 int StartX() const;
88 int EndX() const; 87 int EndX() const;
(...skipping 12 matching lines...) Expand all
101 void RunMenuAt(ui::MenuModel* menu_model, 100 void RunMenuAt(ui::MenuModel* menu_model,
102 views::MenuButton* button, 101 views::MenuButton* button,
103 views::MenuAnchorPosition anchor); 102 views::MenuAnchorPosition anchor);
104 103
105 private: 104 private:
106 // Does the actual work for AssignWidths(). Assumes |labels| is sorted by 105 // Does the actual work for AssignWidths(). Assumes |labels| is sorted by
107 // decreasing preferred width. 106 // decreasing preferred width.
108 static void AssignWidthsSorted(Labels* labels, int available_width); 107 static void AssignWidthsSorted(Labels* labels, int available_width);
109 108
110 // InfoBar: 109 // InfoBar:
111 virtual void PlatformSpecificShow(bool animate) override; 110 void PlatformSpecificShow(bool animate) override;
112 virtual void PlatformSpecificHide(bool animate) override; 111 void PlatformSpecificHide(bool animate) override;
113 virtual void PlatformSpecificOnHeightsRecalculated() override; 112 void PlatformSpecificOnHeightsRecalculated() override;
114 113
115 // views::View: 114 // views::View:
116 virtual void GetAccessibleState(ui::AXViewState* state) override; 115 void GetAccessibleState(ui::AXViewState* state) override;
117 virtual gfx::Size GetPreferredSize() const override; 116 gfx::Size GetPreferredSize() const override;
118 virtual void PaintChildren(gfx::Canvas* canvas, 117 void PaintChildren(gfx::Canvas* canvas,
119 const views::CullSet& cull_set) override; 118 const views::CullSet& cull_set) override;
120 119
121 // views::ExternalFocusTracker: 120 // views::ExternalFocusTracker:
122 virtual void OnWillChangeFocus(View* focused_before, 121 void OnWillChangeFocus(View* focused_before, View* focused_now) override;
123 View* focused_now) override;
124 122
125 // The optional icon at the left edge of the InfoBar. 123 // The optional icon at the left edge of the InfoBar.
126 views::ImageView* icon_; 124 views::ImageView* icon_;
127 125
128 // The close button at the right edge of the InfoBar. 126 // The close button at the right edge of the InfoBar.
129 views::ImageButton* close_button_; 127 views::ImageButton* close_button_;
130 128
131 // The paths for the InfoBarBackground to draw, sized according to the heights 129 // The paths for the InfoBarBackground to draw, sized according to the heights
132 // above. 130 // above.
133 SkPath fill_path_; 131 SkPath fill_path_;
134 SkPath stroke_path_; 132 SkPath stroke_path_;
135 133
136 // Used to run the menu. 134 // Used to run the menu.
137 scoped_ptr<views::MenuRunner> menu_runner_; 135 scoped_ptr<views::MenuRunner> menu_runner_;
138 136
139 DISALLOW_COPY_AND_ASSIGN(InfoBarView); 137 DISALLOW_COPY_AND_ASSIGN(InfoBarView);
140 }; 138 };
141 139
142 #endif // CHROME_BROWSER_UI_VIEWS_INFOBARS_INFOBAR_VIEW_H_ 140 #endif // CHROME_BROWSER_UI_VIEWS_INFOBARS_INFOBAR_VIEW_H_
OLDNEW
« no previous file with comments | « chrome/browser/ui/views/infobars/infobar_container_view.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698