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
[email protected]
Review URL: https://codereview.chromium.org/680153002
Cr-Commit-Position: refs/heads/master@{#301490}
diff --git a/ash/extended_desktop_unittest.cc b/ash/extended_desktop_unittest.cc
index 7e88d4777..2abea49 100644
--- a/ash/extended_desktop_unittest.cc
+++ b/ash/extended_desktop_unittest.cc
@@ -45,15 +45,11 @@
class ModalWidgetDelegate : public views::WidgetDelegateView {
public:
ModalWidgetDelegate() {}
- virtual ~ModalWidgetDelegate() {}
+ ~ModalWidgetDelegate() override {}
// Overridden from views::WidgetDelegate:
- virtual views::View* GetContentsView() override {
- return this;
- }
- virtual ui::ModalType GetModalType() const override {
- return ui::MODAL_TYPE_SYSTEM;
- }
+ views::View* GetContentsView() override { return this; }
+ ui::ModalType GetModalType() const override { return ui::MODAL_TYPE_SYSTEM; }
private:
DISALLOW_COPY_AND_ASSIGN(ModalWidgetDelegate);
@@ -65,11 +61,11 @@
public:
explicit MoveWindowByClickEventHandler(aura::Window* target)
: target_(target) {}
- virtual ~MoveWindowByClickEventHandler() {}
+ ~MoveWindowByClickEventHandler() override {}
private:
// ui::EventHandler overrides:
- virtual void OnMouseEvent(ui::MouseEvent* event) override {
+ void OnMouseEvent(ui::MouseEvent* event) override {
if (event->type() == ui::ET_MOUSE_RELEASED) {
aura::Window::Windows root_windows = Shell::GetAllRootWindows();
DCHECK_LT(1u, root_windows.size());
@@ -87,7 +83,7 @@
explicit EventLocationRecordingEventHandler() {
reset();
}
- virtual ~EventLocationRecordingEventHandler() {}
+ ~EventLocationRecordingEventHandler() override {}
std::string GetLocationsAndReset() {
std::string result =
@@ -98,7 +94,7 @@
private:
// ui::EventHandler overrides:
- virtual void OnMouseEvent(ui::MouseEvent* event) override {
+ void OnMouseEvent(ui::MouseEvent* event) override {
if (event->type() == ui::ET_MOUSE_MOVED ||
event->type() == ui::ET_MOUSE_DRAGGED) {
location_ = event->location();
@@ -120,14 +116,14 @@
class EventLocationHandler : public ui::EventHandler {
public:
EventLocationHandler() {}
- virtual ~EventLocationHandler() {}
+ ~EventLocationHandler() override {}
const gfx::Point& press_location() const { return press_location_; }
const gfx::Point& release_location() const { return release_location_; }
private:
// ui::EventHandler:
- virtual void OnMouseEvent(ui::MouseEvent* event) override {
+ void OnMouseEvent(ui::MouseEvent* event) override {
if (event->type() == ui::ET_MOUSE_PRESSED)
press_location_ = event->location();
else if (event->type() == ui::ET_MOUSE_RELEASED)