diff options
author | dcheng <dcheng@chromium.org> | 2014-12-22 15:52:56 -0800 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2014-12-22 23:53:39 +0000 |
commit | 9dcda9dba917206939bbc882b514569d36e7e13c (patch) | |
tree | 4421872075a960f3ca24b0afe68794f708ce4ab9 /apps | |
parent | 8fb7fbcb06fb1f858efbfe7063cf89a07978ff27 (diff) | |
download | chromium_src-9dcda9dba917206939bbc882b514569d36e7e13c.zip chromium_src-9dcda9dba917206939bbc882b514569d36e7e13c.tar.gz chromium_src-9dcda9dba917206939bbc882b514569d36e7e13c.tar.bz2 |
Standardize usage of virtual/override/final specifiers in apps/.
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}
Diffstat (limited to 'apps')
-rw-r--r-- | apps/saved_files_service_unittest.cc | 4 | ||||
-rw-r--r-- | apps/ui/views/app_window_frame_view.h | 34 |
2 files changed, 18 insertions, 20 deletions
diff --git a/apps/saved_files_service_unittest.cc b/apps/saved_files_service_unittest.cc index 0adbe34..fe215c6 100644 --- a/apps/saved_files_service_unittest.cc +++ b/apps/saved_files_service_unittest.cc @@ -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( "{" @@ -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(); diff --git a/apps/ui/views/app_window_frame_view.h b/apps/ui/views/app_window_frame_view.h index 6537f80..6800a12 100644 --- a/apps/ui/views/app_window_frame_view.h +++ b/apps/ui/views/app_window_frame_view.h @@ -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(); @@ -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. |