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

Side by Side Diff: chrome/browser/ui/views/location_bar/icon_label_bubble_view.h

Issue 678093002: Standardize usage of virtual/override/final specifiers. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase 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
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_LOCATION_BAR_ICON_LABEL_BUBBLE_VIEW_H_ 5 #ifndef CHROME_BROWSER_UI_VIEWS_LOCATION_BAR_ICON_LABEL_BUBBLE_VIEW_H_
6 #define CHROME_BROWSER_UI_VIEWS_LOCATION_BAR_ICON_LABEL_BUBBLE_VIEW_H_ 6 #define CHROME_BROWSER_UI_VIEWS_LOCATION_BAR_ICON_LABEL_BUBBLE_VIEW_H_
7 7
8 #include <string> 8 #include <string>
9 9
10 #include "base/strings/string16.h" 10 #include "base/strings/string16.h"
(...skipping 20 matching lines...) Expand all
31 public: 31 public:
32 // |hover_background_images| is an optional set of images to be used in place 32 // |hover_background_images| is an optional set of images to be used in place
33 // of |background_images| during mouse hover. 33 // of |background_images| during mouse hover.
34 IconLabelBubbleView(const int background_images[], 34 IconLabelBubbleView(const int background_images[],
35 const int hover_background_images[], 35 const int hover_background_images[],
36 int contained_image, 36 int contained_image,
37 const gfx::FontList& font_list, 37 const gfx::FontList& font_list,
38 SkColor text_color, 38 SkColor text_color,
39 SkColor parent_background_color, 39 SkColor parent_background_color,
40 bool elide_in_middle); 40 bool elide_in_middle);
41 virtual ~IconLabelBubbleView(); 41 ~IconLabelBubbleView() override;
42 42
43 void SetLabel(const base::string16& label); 43 void SetLabel(const base::string16& label);
44 void SetImage(const gfx::ImageSkia& image); 44 void SetImage(const gfx::ImageSkia& image);
45 void set_is_extension_icon(bool is_extension_icon) { 45 void set_is_extension_icon(bool is_extension_icon) {
46 is_extension_icon_ = is_extension_icon; 46 is_extension_icon_ = is_extension_icon;
47 } 47 }
48 48
49 protected: 49 protected:
50 // views::View: 50 // views::View:
51 virtual gfx::Size GetPreferredSize() const override; 51 gfx::Size GetPreferredSize() const override;
52 virtual void Layout() override; 52 void Layout() override;
53 virtual void OnMouseEntered(const ui::MouseEvent& event) override; 53 void OnMouseEntered(const ui::MouseEvent& event) override;
54 virtual void OnMouseExited(const ui::MouseEvent& event) override; 54 void OnMouseExited(const ui::MouseEvent& event) override;
55 55
56 const gfx::FontList& font_list() const { return label_->font_list(); } 56 const gfx::FontList& font_list() const { return label_->font_list(); }
57 57
58 gfx::Size GetSizeForLabelWidth(int width) const; 58 gfx::Size GetSizeForLabelWidth(int width) const;
59 59
60 private: 60 private:
61 // Amount of padding at the edges of the bubble. If |by_icon| is true, this 61 // Amount of padding at the edges of the bubble. If |by_icon| is true, this
62 // is the padding next to the icon; otherwise it's the padding next to the 62 // is the padding next to the icon; otherwise it's the padding next to the
63 // label. (We increase padding next to the label by the amount of padding 63 // label. (We increase padding next to the label by the amount of padding
64 // "built in" to the icon in order to make the bubble appear to have 64 // "built in" to the icon in order to make the bubble appear to have
65 // symmetrical padding.) 65 // symmetrical padding.)
66 static int GetBubbleOuterPadding(bool by_icon); 66 static int GetBubbleOuterPadding(bool by_icon);
67 67
68 // views::View: 68 // views::View:
69 virtual void OnPaint(gfx::Canvas* canvas) override; 69 void OnPaint(gfx::Canvas* canvas) override;
70 70
71 int GetPreLabelWidth() const; 71 int GetPreLabelWidth() const;
72 72
73 // For painting the background. 73 // For painting the background.
74 scoped_ptr<views::Painter> background_painter_; 74 scoped_ptr<views::Painter> background_painter_;
75 scoped_ptr<views::Painter> hover_background_painter_; 75 scoped_ptr<views::Painter> hover_background_painter_;
76 76
77 // The contents of the bubble. 77 // The contents of the bubble.
78 views::ImageView* image_; 78 views::ImageView* image_;
79 views::Label* label_; 79 views::Label* label_;
80 80
81 bool is_extension_icon_; 81 bool is_extension_icon_;
82 bool in_hover_; 82 bool in_hover_;
83 83
84 DISALLOW_COPY_AND_ASSIGN(IconLabelBubbleView); 84 DISALLOW_COPY_AND_ASSIGN(IconLabelBubbleView);
85 }; 85 };
86 86
87 #endif // CHROME_BROWSER_UI_VIEWS_LOCATION_BAR_ICON_LABEL_BUBBLE_VIEW_H_ 87 #endif // CHROME_BROWSER_UI_VIEWS_LOCATION_BAR_ICON_LABEL_BUBBLE_VIEW_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698