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/accelerators | |
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/accelerators')
-rw-r--r-- | ash/accelerators/accelerator_controller.h | 6 | ||||
-rw-r--r-- | ash/accelerators/accelerator_controller_unittest.cc | 42 | ||||
-rw-r--r-- | ash/accelerators/accelerator_delegate.h | 8 | ||||
-rw-r--r-- | ash/accelerators/exit_warning_handler.cc | 6 | ||||
-rw-r--r-- | ash/accelerators/focus_manager_factory.h | 12 | ||||
-rw-r--r-- | ash/accelerators/key_hold_detector.h | 4 | ||||
-rw-r--r-- | ash/accelerators/magnifier_key_scroller.h | 10 | ||||
-rw-r--r-- | ash/accelerators/magnifier_key_scroller_unittest.cc | 4 | ||||
-rw-r--r-- | ash/accelerators/nested_accelerator_delegate.h | 5 | ||||
-rw-r--r-- | ash/accelerators/spoken_feedback_toggler.h | 10 |
10 files changed, 50 insertions, 57 deletions
diff --git a/ash/accelerators/accelerator_controller.h b/ash/accelerators/accelerator_controller.h index b0baa9c..9a7c579 100644 --- a/ash/accelerators/accelerator_controller.h +++ b/ash/accelerators/accelerator_controller.h @@ -36,7 +36,7 @@ class VolumeControlDelegate; class ASH_EXPORT AcceleratorController : public ui::AcceleratorTarget { public: AcceleratorController(); - virtual ~AcceleratorController(); + ~AcceleratorController() override; // A list of possible ways in which an accelerator should be restricted before // processing. Any target registered with this controller should respect @@ -96,8 +96,8 @@ class ASH_EXPORT AcceleratorController : public ui::AcceleratorTarget { AcceleratorProcessingRestriction GetCurrentAcceleratorRestriction(); // Overridden from ui::AcceleratorTarget: - virtual bool AcceleratorPressed(const ui::Accelerator& accelerator) override; - virtual bool CanHandleAccelerators() const override; + bool AcceleratorPressed(const ui::Accelerator& accelerator) override; + bool CanHandleAccelerators() const override; void SetBrightnessControlDelegate( scoped_ptr<BrightnessControlDelegate> brightness_control_delegate); diff --git a/ash/accelerators/accelerator_controller_unittest.cc b/ash/accelerators/accelerator_controller_unittest.cc index 338c15f..e6b0227 100644 --- a/ash/accelerators/accelerator_controller_unittest.cc +++ b/ash/accelerators/accelerator_controller_unittest.cc @@ -51,7 +51,7 @@ namespace { class TestTarget : public ui::AcceleratorTarget { public: TestTarget() : accelerator_pressed_count_(0), accelerator_repeat_count_(0) {} - virtual ~TestTarget() {} + ~TestTarget() override {} int accelerator_pressed_count() const { return accelerator_pressed_count_; @@ -65,8 +65,8 @@ class TestTarget : public ui::AcceleratorTarget { } // Overridden from ui::AcceleratorTarget: - virtual bool AcceleratorPressed(const ui::Accelerator& accelerator) override; - virtual bool CanHandleAccelerators() const override; + bool AcceleratorPressed(const ui::Accelerator& accelerator) override; + bool CanHandleAccelerators() const override; private: int accelerator_pressed_count_; @@ -90,21 +90,20 @@ class DummyBrightnessControlDelegate : public BrightnessControlDelegate { handle_brightness_down_count_(0), handle_brightness_up_count_(0) { } - virtual ~DummyBrightnessControlDelegate() {} + ~DummyBrightnessControlDelegate() override {} - virtual bool HandleBrightnessDown( - const ui::Accelerator& accelerator) override { + bool HandleBrightnessDown(const ui::Accelerator& accelerator) override { ++handle_brightness_down_count_; last_accelerator_ = accelerator; return consume_; } - virtual bool HandleBrightnessUp(const ui::Accelerator& accelerator) override { + bool HandleBrightnessUp(const ui::Accelerator& accelerator) override { ++handle_brightness_up_count_; last_accelerator_ = accelerator; return consume_; } - virtual void SetBrightnessPercent(double percent, bool gradual) override {} - virtual void GetBrightnessPercent( + void SetBrightnessPercent(double percent, bool gradual) override {} + void GetBrightnessPercent( const base::Callback<void(double)>& callback) override { callback.Run(100.0); } @@ -136,17 +135,15 @@ class DummyImeControlDelegate : public ImeControlDelegate { handle_previous_ime_count_(0), handle_switch_ime_count_(0) { } - virtual ~DummyImeControlDelegate() {} + ~DummyImeControlDelegate() override {} - virtual void HandleNextIme() override { - ++handle_next_ime_count_; - } - virtual bool HandlePreviousIme(const ui::Accelerator& accelerator) override { + void HandleNextIme() override { ++handle_next_ime_count_; } + bool HandlePreviousIme(const ui::Accelerator& accelerator) override { ++handle_previous_ime_count_; last_accelerator_ = accelerator; return consume_; } - virtual bool HandleSwitchIme(const ui::Accelerator& accelerator) override { + bool HandleSwitchIme(const ui::Accelerator& accelerator) override { ++handle_switch_ime_count_; last_accelerator_ = accelerator; return consume_; @@ -164,7 +161,7 @@ class DummyImeControlDelegate : public ImeControlDelegate { const ui::Accelerator& last_accelerator() const { return last_accelerator_; } - virtual ui::Accelerator RemapAccelerator( + ui::Accelerator RemapAccelerator( const ui::Accelerator& accelerator) override { return ui::Accelerator(accelerator); } @@ -187,17 +184,16 @@ class DummyKeyboardBrightnessControlDelegate handle_keyboard_brightness_down_count_(0), handle_keyboard_brightness_up_count_(0) { } - virtual ~DummyKeyboardBrightnessControlDelegate() {} + ~DummyKeyboardBrightnessControlDelegate() override {} - virtual bool HandleKeyboardBrightnessDown( + bool HandleKeyboardBrightnessDown( const ui::Accelerator& accelerator) override { ++handle_keyboard_brightness_down_count_; last_accelerator_ = accelerator; return consume_; } - virtual bool HandleKeyboardBrightnessUp( - const ui::Accelerator& accelerator) override { + bool HandleKeyboardBrightnessUp(const ui::Accelerator& accelerator) override { ++handle_keyboard_brightness_up_count_; last_accelerator_ = accelerator; return consume_; @@ -241,7 +237,7 @@ bool TestTarget::CanHandleAccelerators() const { class AcceleratorControllerTest : public test::AshTestBase { public: AcceleratorControllerTest() {} - virtual ~AcceleratorControllerTest() {} + ~AcceleratorControllerTest() override {} protected: void EnableInternalDisplay() { @@ -1253,10 +1249,10 @@ namespace { class PreferredReservedAcceleratorsTest : public test::AshTestBase { public: PreferredReservedAcceleratorsTest() {} - virtual ~PreferredReservedAcceleratorsTest() {} + ~PreferredReservedAcceleratorsTest() override {} // test::AshTestBase: - virtual void SetUp() override { + void SetUp() override { AshTestBase::SetUp(); Shell::GetInstance()->lock_state_controller()-> set_animator_for_test(new test::TestSessionStateAnimator); diff --git a/ash/accelerators/accelerator_delegate.h b/ash/accelerators/accelerator_delegate.h index 7027d68..3250a0c 100644 --- a/ash/accelerators/accelerator_delegate.h +++ b/ash/accelerators/accelerator_delegate.h @@ -15,12 +15,12 @@ class ASH_EXPORT AcceleratorDelegate : NON_EXPORTED_BASE(public wm::AcceleratorDelegate) { public: AcceleratorDelegate(); - virtual ~AcceleratorDelegate(); + ~AcceleratorDelegate() override; // wm::AcceleratorDelegate: - virtual bool ProcessAccelerator(const ui::KeyEvent& event, - const ui::Accelerator& accelerator, - KeyType key_type) override; + bool ProcessAccelerator(const ui::KeyEvent& event, + const ui::Accelerator& accelerator, + KeyType key_type) override; private: // Returns true if the window should be allowed a chance to handle diff --git a/ash/accelerators/exit_warning_handler.cc b/ash/accelerators/exit_warning_handler.cc index 275dc5a..21e4aff 100644 --- a/ash/accelerators/exit_warning_handler.cc +++ b/ash/accelerators/exit_warning_handler.cc @@ -68,11 +68,11 @@ class ExitWarningWidgetDelegateView : public views::WidgetDelegateView { SetLayoutManager(new views::FillLayout); } - virtual gfx::Size GetPreferredSize() const override { + gfx::Size GetPreferredSize() const override { return gfx::Size(width_, height_); } - virtual void OnPaint(gfx::Canvas* canvas) override { + void OnPaint(gfx::Canvas* canvas) override { SkPaint paint; paint.setStyle(SkPaint::kFill_Style); paint.setColor(kWindowBackgroundColor); @@ -80,7 +80,7 @@ class ExitWarningWidgetDelegateView : public views::WidgetDelegateView { views::WidgetDelegateView::OnPaint(canvas); } - virtual void GetAccessibleState(ui::AXViewState* state) override { + void GetAccessibleState(ui::AXViewState* state) override { state->name = accessible_name_; state->role = ui::AX_ROLE_ALERT; } diff --git a/ash/accelerators/focus_manager_factory.h b/ash/accelerators/focus_manager_factory.h index 1f6a1cf..fc14151 100644 --- a/ash/accelerators/focus_manager_factory.h +++ b/ash/accelerators/focus_manager_factory.h @@ -17,21 +17,19 @@ namespace ash { class AshFocusManagerFactory : public views::FocusManagerFactory { public: AshFocusManagerFactory(); - virtual ~AshFocusManagerFactory(); + ~AshFocusManagerFactory() override; protected: // views::FocusManagerFactory overrides: - virtual views::FocusManager* CreateFocusManager( - views::Widget* widget, - bool desktop_widget) override; + views::FocusManager* CreateFocusManager(views::Widget* widget, + bool desktop_widget) override; private: class Delegate : public views::FocusManagerDelegate { public: // views::FocusManagerDelegate overrides: - virtual bool ProcessAccelerator( - const ui::Accelerator& accelerator) override; - virtual ui::AcceleratorTarget* GetCurrentTargetForAccelerator( + bool ProcessAccelerator(const ui::Accelerator& accelerator) override; + ui::AcceleratorTarget* GetCurrentTargetForAccelerator( const ui::Accelerator& accelerator) const override; }; diff --git a/ash/accelerators/key_hold_detector.h b/ash/accelerators/key_hold_detector.h index 96c89fd..cad7e9f 100644 --- a/ash/accelerators/key_hold_detector.h +++ b/ash/accelerators/key_hold_detector.h @@ -39,10 +39,10 @@ class ASH_EXPORT KeyHoldDetector : public ui::EventHandler { }; explicit KeyHoldDetector(scoped_ptr<Delegate> delegate); - virtual ~KeyHoldDetector(); + ~KeyHoldDetector() override; // ui::EventHandler overrides: - virtual void OnKeyEvent(ui::KeyEvent* key_event) override; + void OnKeyEvent(ui::KeyEvent* key_event) override; private: // A state to keep track of one click and click and hold operation. diff --git a/ash/accelerators/magnifier_key_scroller.h b/ash/accelerators/magnifier_key_scroller.h index 1ef78fb..2e16533 100644 --- a/ash/accelerators/magnifier_key_scroller.h +++ b/ash/accelerators/magnifier_key_scroller.h @@ -39,13 +39,13 @@ class ASH_EXPORT MagnifierKeyScroller : public KeyHoldDetector::Delegate { private: // KeyHoldDetector overrides: - virtual bool ShouldProcessEvent(const ui::KeyEvent* event) const override; - virtual bool IsStartEvent(const ui::KeyEvent* event) const override; - virtual void OnKeyHold(const ui::KeyEvent* event) override; - virtual void OnKeyUnhold(const ui::KeyEvent* event) override; + bool ShouldProcessEvent(const ui::KeyEvent* event) const override; + bool IsStartEvent(const ui::KeyEvent* event) const override; + void OnKeyHold(const ui::KeyEvent* event) override; + void OnKeyUnhold(const ui::KeyEvent* event) override; MagnifierKeyScroller(); - virtual ~MagnifierKeyScroller(); + ~MagnifierKeyScroller() override; DISALLOW_COPY_AND_ASSIGN(MagnifierKeyScroller); }; diff --git a/ash/accelerators/magnifier_key_scroller_unittest.cc b/ash/accelerators/magnifier_key_scroller_unittest.cc index c8670a7..8555369 100644 --- a/ash/accelerators/magnifier_key_scroller_unittest.cc +++ b/ash/accelerators/magnifier_key_scroller_unittest.cc @@ -17,10 +17,10 @@ namespace { class KeyEventDelegate : public aura::test::TestWindowDelegate { public: KeyEventDelegate() {} - virtual ~KeyEventDelegate() {} + ~KeyEventDelegate() override {} // ui::EventHandler overrides: - virtual void OnKeyEvent(ui::KeyEvent* event) override { + void OnKeyEvent(ui::KeyEvent* event) override { key_event.reset(new ui::KeyEvent( event->type(), event->key_code(), event->flags())); } diff --git a/ash/accelerators/nested_accelerator_delegate.h b/ash/accelerators/nested_accelerator_delegate.h index 5a8dfad..2e9b765 100644 --- a/ash/accelerators/nested_accelerator_delegate.h +++ b/ash/accelerators/nested_accelerator_delegate.h @@ -13,11 +13,10 @@ namespace ash { class NestedAcceleratorDelegate : public wm::NestedAcceleratorDelegate { public: NestedAcceleratorDelegate(); - virtual ~NestedAcceleratorDelegate(); + ~NestedAcceleratorDelegate() override; // wm::AcceleratorDispatcher::Delegate - virtual Result ProcessAccelerator( - const ui::Accelerator& accelerator) override; + Result ProcessAccelerator(const ui::Accelerator& accelerator) override; private: DISALLOW_COPY_AND_ASSIGN(NestedAcceleratorDelegate); diff --git a/ash/accelerators/spoken_feedback_toggler.h b/ash/accelerators/spoken_feedback_toggler.h index 067a7d1..51bf985 100644 --- a/ash/accelerators/spoken_feedback_toggler.h +++ b/ash/accelerators/spoken_feedback_toggler.h @@ -39,13 +39,13 @@ class ASH_EXPORT SpokenFeedbackToggler : public KeyHoldDetector::Delegate { private: // KeyHoldDetector overrides: - virtual bool ShouldProcessEvent(const ui::KeyEvent* event) const override; - virtual bool IsStartEvent(const ui::KeyEvent* event) const override; - virtual void OnKeyHold(const ui::KeyEvent* event) override; - virtual void OnKeyUnhold(const ui::KeyEvent* event) override; + bool ShouldProcessEvent(const ui::KeyEvent* event) const override; + bool IsStartEvent(const ui::KeyEvent* event) const override; + void OnKeyHold(const ui::KeyEvent* event) override; + void OnKeyUnhold(const ui::KeyEvent* event) override; SpokenFeedbackToggler(); - virtual ~SpokenFeedbackToggler(); + ~SpokenFeedbackToggler() override; bool toggled_; |