diff options
author | dcheng <dcheng@chromium.org> | 2014-10-27 16:57:05 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2014-10-27 23:58:04 +0000 |
commit | 1f4538e02ae35659abf7f9468639a1045924af50 (patch) | |
tree | 1e076638bbebe64689099c5ea5bd82bfa9c6b9aa /ash/touch | |
parent | e19d49ab07f57c16eb6685e7394ac4902e53382c (diff) | |
download | chromium_src-1f4538e02ae35659abf7f9468639a1045924af50.zip chromium_src-1f4538e02ae35659abf7f9468639a1045924af50.tar.gz chromium_src-1f4538e02ae35659abf7f9468639a1045924af50.tar.bz2 |
Standardize usage of virtual/override/final specifiers.
The Google C++ style guide states:
Explicitly annotate overrides of virtual functions or virtual
destructors with an override or (less frequently) final specifier.
Older (pre-C++11) code will use the virtual keyword as an inferior
alternative annotation. For clarity, use exactly one of override,
final, or virtual when declaring an override.
To better conform to these guidelines, the following constructs have
been rewritten:
- if a base class has a virtual destructor, then:
virtual ~Foo(); -> ~Foo() override;
- virtual void Foo() override; -> void Foo() override;
- virtual void Foo() override final; -> void Foo() final;
This patch was automatically generated. The clang plugin can generate
fixit hints, which are suggested edits when it is 100% sure it knows how
to fix a problem. The hints from the clang plugin were applied to the
source tree using the tool in https://codereview.chromium.org/598073004.
BUG=417463
R=derat@chromium.org
Review URL: https://codereview.chromium.org/680153002
Cr-Commit-Position: refs/heads/master@{#301490}
Diffstat (limited to 'ash/touch')
-rw-r--r-- | ash/touch/touch_hud_debug.cc | 4 | ||||
-rw-r--r-- | ash/touch/touch_hud_debug.h | 15 | ||||
-rw-r--r-- | ash/touch/touch_hud_projection.cc | 12 | ||||
-rw-r--r-- | ash/touch/touch_hud_projection.h | 11 | ||||
-rw-r--r-- | ash/touch/touch_observer_hud.h | 20 | ||||
-rw-r--r-- | ash/touch/touch_observer_hud_unittest.cc | 10 |
6 files changed, 35 insertions, 37 deletions
diff --git a/ash/touch/touch_hud_debug.cc b/ash/touch/touch_hud_debug.cc index b714edf..c7212cf 100644 --- a/ash/touch/touch_hud_debug.cc +++ b/ash/touch/touch_hud_debug.cc @@ -257,7 +257,7 @@ class TouchHudCanvas : public views::View { paint_.setStyle(SkPaint::kFill_Style); } - virtual ~TouchHudCanvas() {} + ~TouchHudCanvas() override {} void SetScale(int scale) { if (scale_ == scale) @@ -308,7 +308,7 @@ class TouchHudCanvas : public views::View { } // Overridden from views::View. - virtual void OnPaint(gfx::Canvas* canvas) override { + void OnPaint(gfx::Canvas* canvas) override { for (int i = 0; i < kMaxPaths; ++i) { if (paths_[i].countPoints() == 0) continue; diff --git a/ash/touch/touch_hud_debug.h b/ash/touch/touch_hud_debug.h index 9409243..547ab27 100644 --- a/ash/touch/touch_hud_debug.h +++ b/ash/touch/touch_hud_debug.h @@ -49,22 +49,21 @@ class ASH_EXPORT TouchHudDebug : public TouchObserverHUD { Mode mode() const { return mode_; } // Overriden from TouchObserverHUD. - virtual void Clear() override; + void Clear() override; private: - virtual ~TouchHudDebug(); + ~TouchHudDebug() override; void SetMode(Mode mode); void UpdateTouchPointLabel(int index); // Overriden from TouchObserverHUD. - virtual void OnTouchEvent(ui::TouchEvent* event) override; - virtual void OnDisplayMetricsChanged(const gfx::Display& display, - uint32_t metrics) override; - virtual void SetHudForRootWindowController( - RootWindowController* controller) override; - virtual void UnsetHudForRootWindowController( + void OnTouchEvent(ui::TouchEvent* event) override; + void OnDisplayMetricsChanged(const gfx::Display& display, + uint32_t metrics) override; + void SetHudForRootWindowController(RootWindowController* controller) override; + void UnsetHudForRootWindowController( RootWindowController* controller) override; static const int kMaxTouchPoints = 32; diff --git a/ash/touch/touch_hud_projection.cc b/ash/touch/touch_hud_projection.cc index 990345e..47fab8d 100644 --- a/ash/touch/touch_hud_projection.cc +++ b/ash/touch/touch_hud_projection.cc @@ -72,13 +72,13 @@ class TouchPointView : public views::View, } private: - virtual ~TouchPointView() { + ~TouchPointView() override { GetWidget()->RemoveObserver(this); parent()->RemoveChildView(this); } // Overridden from views::View. - virtual void OnPaint(gfx::Canvas* canvas) override { + void OnPaint(gfx::Canvas* canvas) override { int alpha = kProjectionAlpha; if (fadeout_) alpha = static_cast<int>(fadeout_->CurrentValueBetween(alpha, 0)); @@ -100,22 +100,22 @@ class TouchPointView : public views::View, } // Overridden from gfx::AnimationDelegate. - virtual void AnimationEnded(const gfx::Animation* animation) override { + void AnimationEnded(const gfx::Animation* animation) override { DCHECK_EQ(fadeout_.get(), animation); delete this; } - virtual void AnimationProgressed(const gfx::Animation* animation) override { + void AnimationProgressed(const gfx::Animation* animation) override { DCHECK_EQ(fadeout_.get(), animation); SchedulePaint(); } - virtual void AnimationCanceled(const gfx::Animation* animation) override { + void AnimationCanceled(const gfx::Animation* animation) override { AnimationEnded(animation); } // Overridden from views::WidgetObserver. - virtual void OnWidgetDestroying(views::Widget* widget) override { + void OnWidgetDestroying(views::Widget* widget) override { if (fadeout_) fadeout_->Stop(); else diff --git a/ash/touch/touch_hud_projection.h b/ash/touch/touch_hud_projection.h index cde756d..2394976 100644 --- a/ash/touch/touch_hud_projection.h +++ b/ash/touch/touch_hud_projection.h @@ -19,18 +19,17 @@ class TouchHudProjection : public TouchObserverHUD { explicit TouchHudProjection(aura::Window* initial_root); // Overriden from TouchObserverHUD. - virtual void Clear() override; + void Clear() override; private: friend class TouchHudProjectionTest; - virtual ~TouchHudProjection(); + ~TouchHudProjection() override; // Overriden from TouchObserverHUD. - virtual void OnTouchEvent(ui::TouchEvent* event) override; - virtual void SetHudForRootWindowController( - RootWindowController* controller) override; - virtual void UnsetHudForRootWindowController( + void OnTouchEvent(ui::TouchEvent* event) override; + void SetHudForRootWindowController(RootWindowController* controller) override; + void UnsetHudForRootWindowController( RootWindowController* controller) override; std::map<int, TouchPointView*> points_; diff --git a/ash/touch/touch_observer_hud.h b/ash/touch/touch_observer_hud.h index 329d7dc..e168e9f 100644 --- a/ash/touch/touch_observer_hud.h +++ b/ash/touch/touch_observer_hud.h @@ -43,7 +43,7 @@ class ASH_EXPORT TouchObserverHUD : public ui::EventHandler, protected: explicit TouchObserverHUD(aura::Window* initial_root); - virtual ~TouchObserverHUD(); + ~TouchObserverHUD() override; virtual void SetHudForRootWindowController( RootWindowController* controller) = 0; @@ -53,16 +53,16 @@ class ASH_EXPORT TouchObserverHUD : public ui::EventHandler, views::Widget* widget() { return widget_; } // Overriden from ui::EventHandler. - virtual void OnTouchEvent(ui::TouchEvent* event) override; + void OnTouchEvent(ui::TouchEvent* event) override; // Overridden from views::WidgetObserver. - virtual void OnWidgetDestroying(views::Widget* widget) override; + void OnWidgetDestroying(views::Widget* widget) override; // Overridden from gfx::DisplayObserver. - virtual void OnDisplayAdded(const gfx::Display& new_display) override; - virtual void OnDisplayRemoved(const gfx::Display& old_display) override; - virtual void OnDisplayMetricsChanged(const gfx::Display& display, - uint32_t metrics) override; + void OnDisplayAdded(const gfx::Display& new_display) override; + void OnDisplayRemoved(const gfx::Display& old_display) override; + void OnDisplayMetricsChanged(const gfx::Display& display, + uint32_t metrics) override; #if defined(OS_CHROMEOS) // Overriden from ui::DisplayConfigurator::Observer. @@ -71,9 +71,9 @@ class ASH_EXPORT TouchObserverHUD : public ui::EventHandler, #endif // defined(OS_CHROMEOS) // Overriden form DisplayController::Observer. - virtual void OnDisplaysInitialized() override; - virtual void OnDisplayConfigurationChanging() override; - virtual void OnDisplayConfigurationChanged() override; + void OnDisplaysInitialized() override; + void OnDisplayConfigurationChanging() override; + void OnDisplayConfigurationChanged() override; private: friend class TouchHudTestBase; diff --git a/ash/touch/touch_observer_hud_unittest.cc b/ash/touch/touch_observer_hud_unittest.cc index 77bfa3c..4955214 100644 --- a/ash/touch/touch_observer_hud_unittest.cc +++ b/ash/touch/touch_observer_hud_unittest.cc @@ -24,9 +24,9 @@ namespace ash { class TouchHudTestBase : public test::AshTestBase { public: TouchHudTestBase() {} - virtual ~TouchHudTestBase() {} + ~TouchHudTestBase() override {} - virtual void SetUp() override { + void SetUp() override { test::AshTestBase::SetUp(); // Initialize display infos. They should be initialized after Ash @@ -212,9 +212,9 @@ class TouchHudTestBase : public test::AshTestBase { class TouchHudDebugTest : public TouchHudTestBase { public: TouchHudDebugTest() {} - virtual ~TouchHudDebugTest() {} + ~TouchHudDebugTest() override {} - virtual void SetUp() override { + void SetUp() override { // Add ash-touch-hud flag to enable debug touch HUD. This flag should be set // before Ash environment is set up, i.e., before TouchHudTestBase::SetUp(). CommandLine::ForCurrentProcess()->AppendSwitch( @@ -272,7 +272,7 @@ class TouchHudDebugTest : public TouchHudTestBase { class TouchHudProjectionTest : public TouchHudTestBase { public: TouchHudProjectionTest() {} - virtual ~TouchHudProjectionTest() {} + ~TouchHudProjectionTest() override {} void EnableTouchHudProjection() { Shell::GetInstance()->SetTouchHudProjectionEnabled(true); |