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

Unified Diff: ui/views/border.cc

Issue 10358013: views: Mark single-argument constructors as explicit. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 8 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | ui/views/bubble/bubble_frame_view_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/views/border.cc
diff --git a/ui/views/border.cc b/ui/views/border.cc
index dad74d7dce20f5c65368d25df8ec948daad1cf7e..1cfb037d0cece46b08cb0df13bb495d3cb8bdf35 100644
--- a/ui/views/border.cc
+++ b/ui/views/border.cc
@@ -17,8 +17,9 @@ class SidedSolidBorder : public Border {
public:
SidedSolidBorder(int top, int left, int bottom, int right, SkColor color);
- virtual void Paint(const View& view, gfx::Canvas* canvas) const;
- virtual void GetInsets(gfx::Insets* insets) const;
+ // Overridden from Border:
+ virtual void Paint(const View& view, gfx::Canvas* canvas) const OVERRIDE;
+ virtual void GetInsets(gfx::Insets* insets) const OVERRIDE;
private:
int top_, left_, bottom_, right_;
@@ -72,9 +73,10 @@ class EmptyBorder : public Border {
EmptyBorder(int top, int left, int bottom, int right)
: top_(top), left_(left), bottom_(bottom), right_(right) {}
- virtual void Paint(const View& view, gfx::Canvas* canvas) const {}
+ // Overridden from Border:
+ virtual void Paint(const View& view, gfx::Canvas* canvas) const OVERRIDE {}
- virtual void GetInsets(gfx::Insets* insets) const {
+ virtual void GetInsets(gfx::Insets* insets) const OVERRIDE {
DCHECK(insets);
insets->Set(top_, left_, bottom_, right_);
}
@@ -90,20 +92,22 @@ class EmptyBorder : public Border {
class BorderPainter : public Border {
public:
- BorderPainter(Painter* painter)
+ explicit BorderPainter(Painter* painter)
: painter_(painter) {
DCHECK(painter);
}
virtual ~BorderPainter() {
delete painter_;
+ painter_ = NULL;
}
- void Paint(const View& view, gfx::Canvas* canvas) const {
+ // Overridden from Border:
+ virtual void Paint(const View& view, gfx::Canvas* canvas) const OVERRIDE {
Painter::PaintPainterAt(canvas, painter_, view.GetLocalBounds());
}
- virtual void GetInsets(gfx::Insets* insets) const {
+ virtual void GetInsets(gfx::Insets* insets) const OVERRIDE {
DCHECK(insets);
insets->Set(0, 0, 0, 0);
}
« no previous file with comments | « no previous file | ui/views/bubble/bubble_frame_view_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698