Skip to content

Commit

Permalink
Standardize usage of virtual/override/final specifiers in apps/.
Browse files Browse the repository at this point in the history
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.

Several formatting edits by clang-format were manually reverted, due to
mangling of some of the more complicate IPC macros.

BUG=417463

Review URL: https://codereview.chromium.org/818113002

Cr-Commit-Position: refs/heads/master@{#309493}
  • Loading branch information
zetafunction authored and Commit bot committed Dec 22, 2014
1 parent 8fb7fbc commit 9dcda9d
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 20 deletions.
4 changes: 2 additions & 2 deletions apps/saved_files_service_unittest.cc
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ std::string GenerateId(int i) {

class SavedFilesServiceUnitTest : public testing::Test {
protected:
virtual void SetUp() override {
void SetUp() override {
testing::Test::SetUp();
extension_ = env_.MakeExtension(*base::test::ParseJson(
"{"
Expand All @@ -52,7 +52,7 @@ class SavedFilesServiceUnitTest : public testing::Test {
path_ = base::FilePath(FILE_PATH_LITERAL("filename.ext"));
}

virtual void TearDown() override {
void TearDown() override {
SavedFilesService::ClearMaxSequenceNumberForTest();
SavedFilesService::ClearLruSizeForTest();
testing::Test::TearDown();
Expand Down
34 changes: 16 additions & 18 deletions apps/ui/views/app_window_frame_view.h
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ class AppWindowFrameView : public views::NonClientFrameView,
bool draw_frame,
const SkColor& active_frame_color,
const SkColor& inactive_frame_color);
virtual ~AppWindowFrameView();
~AppWindowFrameView() override;

void Init();

Expand All @@ -68,28 +68,26 @@ class AppWindowFrameView : public views::NonClientFrameView,

private:
// views::NonClientFrameView implementation.
virtual gfx::Rect GetBoundsForClientView() const override;
virtual gfx::Rect GetWindowBoundsForClientBounds(
gfx::Rect GetBoundsForClientView() const override;
gfx::Rect GetWindowBoundsForClientBounds(
const gfx::Rect& client_bounds) const override;
virtual int NonClientHitTest(const gfx::Point& point) override;
virtual void GetWindowMask(const gfx::Size& size,
gfx::Path* window_mask) override;
virtual void ResetWindowControls() override {}
virtual void UpdateWindowIcon() override {}
virtual void UpdateWindowTitle() override {}
virtual void SizeConstraintsChanged() override;
int NonClientHitTest(const gfx::Point& point) override;
void GetWindowMask(const gfx::Size& size, gfx::Path* window_mask) override;
void ResetWindowControls() override {}
void UpdateWindowIcon() override {}
void UpdateWindowTitle() override {}
void SizeConstraintsChanged() override;

// views::View implementation.
virtual gfx::Size GetPreferredSize() const override;
virtual void Layout() override;
virtual const char* GetClassName() const override;
virtual void OnPaint(gfx::Canvas* canvas) override;
virtual gfx::Size GetMinimumSize() const override;
virtual gfx::Size GetMaximumSize() const override;
gfx::Size GetPreferredSize() const override;
void Layout() override;
const char* GetClassName() const override;
void OnPaint(gfx::Canvas* canvas) override;
gfx::Size GetMinimumSize() const override;
gfx::Size GetMaximumSize() const override;

// views::ButtonListener implementation.
virtual void ButtonPressed(views::Button* sender,
const ui::Event& event) override;
void ButtonPressed(views::Button* sender, const ui::Event& event) override;

// Some button images we use depend on the color of the frame. This
// will set these images based on the color of the frame.
Expand Down

0 comments on commit 9dcda9d

Please sign in to comment.