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

Unified Diff: ui/views/view_unittest.cc

Issue 679233002: Standardize usage of virtual/override/final specifiers. (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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ui/views/view_targeter_unittest.cc ('k') | ui/views/views_touch_selection_controller_factory.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/views/view_unittest.cc
diff --git a/ui/views/view_unittest.cc b/ui/views/view_unittest.cc
index 4f15a21771ad891329274b0569879f550c6e21f2..aef56325d4b22ceb4d55e014f7e9a47e21bb2f62 100644
--- a/ui/views/view_unittest.cc
+++ b/ui/views/view_unittest.cc
@@ -190,7 +190,7 @@ class TestView : public View {
delete_on_pressed_(false),
native_theme_(NULL),
can_process_events_within_subtree_(true) {}
- virtual ~TestView() {}
+ ~TestView() override {}
// Reset all test state
void Reset() {
@@ -219,23 +219,22 @@ class TestView : public View {
can_process_events_within_subtree_ = can_process;
}
- virtual bool CanProcessEventsWithinSubtree() const override {
+ bool CanProcessEventsWithinSubtree() const override {
return can_process_events_within_subtree_;
}
- virtual void OnBoundsChanged(const gfx::Rect& previous_bounds) override;
- virtual bool OnMousePressed(const ui::MouseEvent& event) override;
- virtual bool OnMouseDragged(const ui::MouseEvent& event) override;
- virtual void OnMouseReleased(const ui::MouseEvent& event) override;
- virtual void OnMouseEntered(const ui::MouseEvent& event) override;
- virtual void OnMouseExited(const ui::MouseEvent& event) override;
+ void OnBoundsChanged(const gfx::Rect& previous_bounds) override;
+ bool OnMousePressed(const ui::MouseEvent& event) override;
+ bool OnMouseDragged(const ui::MouseEvent& event) override;
+ void OnMouseReleased(const ui::MouseEvent& event) override;
+ void OnMouseEntered(const ui::MouseEvent& event) override;
+ void OnMouseExited(const ui::MouseEvent& event) override;
- virtual void Paint(gfx::Canvas* canvas, const CullSet& cull_set) override;
- virtual void SchedulePaintInRect(const gfx::Rect& rect) override;
- virtual bool AcceleratorPressed(const ui::Accelerator& accelerator) override;
+ void Paint(gfx::Canvas* canvas, const CullSet& cull_set) override;
+ void SchedulePaintInRect(const gfx::Rect& rect) override;
+ bool AcceleratorPressed(const ui::Accelerator& accelerator) override;
- virtual void OnNativeThemeChanged(const ui::NativeTheme* native_theme)
- override;
+ void OnNativeThemeChanged(const ui::NativeTheme* native_theme) override;
// OnBoundsChanged.
bool did_change_bounds_;
@@ -1490,11 +1489,10 @@ class ToplevelWidgetObserverView : public View {
public:
ToplevelWidgetObserverView() : toplevel_(NULL) {
}
- virtual ~ToplevelWidgetObserverView() {
- }
+ ~ToplevelWidgetObserverView() override {}
// View overrides:
- virtual void ViewHierarchyChanged(
+ void ViewHierarchyChanged(
const ViewHierarchyChangedDetails& details) override {
if (details.is_add) {
toplevel_ = GetWidget() ? GetWidget()->GetTopLevelWidget() : NULL;
@@ -1502,7 +1500,7 @@ class ToplevelWidgetObserverView : public View {
toplevel_ = NULL;
}
}
- virtual void NativeViewHierarchyChanged() override {
+ void NativeViewHierarchyChanged() override {
toplevel_ = GetWidget() ? GetWidget()->GetTopLevelWidget() : NULL;
}
@@ -1560,7 +1558,7 @@ TEST_F(ViewTest, NativeViewHierarchyChanged) {
class TransformPaintView : public TestView {
public:
TransformPaintView() {}
- virtual ~TransformPaintView() {}
+ ~TransformPaintView() override {}
void ClearScheduledPaintRect() {
scheduled_paint_rect_ = gfx::Rect();
@@ -1569,7 +1567,7 @@ class TransformPaintView : public TestView {
gfx::Rect scheduled_paint_rect() const { return scheduled_paint_rect_; }
// Overridden from View:
- virtual void SchedulePaintInRect(const gfx::Rect& rect) override {
+ void SchedulePaintInRect(const gfx::Rect& rect) override {
gfx::Rect xrect = ConvertRectToParent(rect);
scheduled_paint_rect_.Union(xrect);
}
@@ -1799,7 +1797,7 @@ TEST_F(ViewTest, TransformVisibleBound) {
class VisibleBoundsView : public View {
public:
VisibleBoundsView() : received_notification_(false) {}
- virtual ~VisibleBoundsView() {}
+ ~VisibleBoundsView() override {}
bool received_notification() const { return received_notification_; }
void set_received_notification(bool received) {
@@ -1808,12 +1806,10 @@ class VisibleBoundsView : public View {
private:
// Overridden from View:
- virtual bool GetNeedsNotificationWhenVisibleBoundsChange() const override {
+ bool GetNeedsNotificationWhenVisibleBoundsChange() const override {
return true;
}
- virtual void OnVisibleBoundsChanged() override {
- received_notification_ = true;
- }
+ void OnVisibleBoundsChanged() override { received_notification_ = true; }
bool received_notification_;
@@ -2215,7 +2211,7 @@ TEST_F(ViewTest, ConvertRectWithTransform) {
class ObserverView : public View {
public:
ObserverView();
- virtual ~ObserverView();
+ ~ObserverView() override;
void ResetTestState();
@@ -2232,7 +2228,7 @@ class ObserverView : public View {
private:
// View:
- virtual void ViewHierarchyChanged(
+ void ViewHierarchyChanged(
const ViewHierarchyChangedDetails& details) override;
bool has_add_details_;
@@ -2650,11 +2646,9 @@ TEST_F(ViewTest, AddExistingChild) {
class ActiveWidget : public Widget {
public:
ActiveWidget() {}
- virtual ~ActiveWidget() {}
+ ~ActiveWidget() override {}
- virtual bool IsActive() const override {
- return true;
- }
+ bool IsActive() const override { return true; }
private:
DISALLOW_COPY_AND_ASSIGN(ActiveWidget);
@@ -2718,10 +2712,10 @@ class TestLayerAnimator : public ui::LayerAnimator {
const gfx::Rect& last_bounds() const { return last_bounds_; }
// LayerAnimator.
- virtual void SetBounds(const gfx::Rect& bounds) override;
+ void SetBounds(const gfx::Rect& bounds) override;
protected:
- virtual ~TestLayerAnimator() { }
+ ~TestLayerAnimator() override {}
private:
gfx::Rect last_bounds_;
@@ -2743,15 +2737,14 @@ class ViewLayerTest : public ViewsTestBase {
public:
ViewLayerTest() : widget_(NULL) {}
- virtual ~ViewLayerTest() {
- }
+ ~ViewLayerTest() override {}
// Returns the Layer used by the RootView.
ui::Layer* GetRootLayer() {
return widget()->GetLayer();
}
- virtual void SetUp() override {
+ void SetUp() override {
ViewTest::SetUp();
widget_ = new Widget;
Widget::InitParams params = CreateParams(Widget::InitParams::TYPE_POPUP);
@@ -2761,7 +2754,7 @@ class ViewLayerTest : public ViewsTestBase {
widget_->GetRootView()->SetBounds(0, 0, 200, 200);
}
- virtual void TearDown() override {
+ void TearDown() override {
widget_->CloseNow();
ViewsTestBase::TearDown();
}
@@ -3070,9 +3063,7 @@ class PaintTrackingView : public View {
bool painted() const { return painted_; }
void set_painted(bool value) { painted_ = value; }
- virtual void OnPaint(gfx::Canvas* canvas) override {
- painted_ = true;
- }
+ void OnPaint(gfx::Canvas* canvas) override { painted_ = true; }
private:
bool painted_;
@@ -3308,8 +3299,7 @@ class BoundsTreeTestView : public View {
public:
BoundsTreeTestView() {}
- virtual void PaintChildren(gfx::Canvas* canvas,
- const CullSet& cull_set) override {
+ void PaintChildren(gfx::Canvas* canvas, const CullSet& cull_set) override {
// Save out a copy of the cull_set before calling the base implementation.
last_cull_set_.clear();
if (cull_set.cull_set_) {
« no previous file with comments | « ui/views/view_targeter_unittest.cc ('k') | ui/views/views_touch_selection_controller_factory.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698