From 28401c280ebf802265ef7f387a0ecfe784551e16 Mon Sep 17 00:00:00 2001 From: dcheng Date: Mon, 27 Oct 2014 18:26:19 -0700 Subject: [PATCH] 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=flackr@chromium.org Review URL: https://codereview.chromium.org/645513008 Cr-Commit-Position: refs/heads/master@{#301541} --- ash/wm/always_on_top_controller.h | 14 ++--- ash/wm/app_list_controller.h | 34 ++++++------ ash/wm/app_list_controller_unittest.cc | 2 +- ash/wm/ash_focus_rules.h | 11 ++-- ash/wm/ash_native_cursor_manager.h | 24 ++++----- ...ative_cursor_manager_interactive_uitest.cc | 4 +- ash/wm/ash_native_cursor_manager_unittest.cc | 4 +- ash/wm/cursor_manager_chromeos.h | 6 +-- ash/wm/default_state.h | 13 +++-- ash/wm/default_window_resizer.h | 8 +-- ash/wm/dock/docked_window_layout_manager.cc | 14 ++--- ash/wm/dock/docked_window_layout_manager.h | 54 +++++++++---------- .../docked_window_layout_manager_unittest.cc | 2 +- ash/wm/dock/docked_window_resizer.h | 8 +-- ash/wm/dock/docked_window_resizer_unittest.cc | 6 +-- ash/wm/drag_window_resizer.h | 8 +-- ash/wm/event_client_impl.h | 7 ++- .../gestures/long_press_affordance_handler.cc | 7 ++- .../gestures/long_press_affordance_handler.h | 8 +-- .../overview_gesture_handler_unittest.cc | 2 +- ash/wm/gestures/tray_gesture_handler.h | 4 +- ash/wm/immersive_fullscreen_controller.cc | 7 ++- ash/wm/immersive_fullscreen_controller.h | 37 +++++++------ ...mmersive_fullscreen_controller_unittest.cc | 22 ++++---- ash/wm/lock_layout_manager.h | 40 +++++++------- ash/wm/lock_layout_manager_unittest.cc | 26 +++------ ash/wm/lock_state_controller.h | 10 ++-- ash/wm/lock_state_controller_unittest.cc | 4 +- ash/wm/lock_window_state.h | 14 ++--- ash/wm/mru_window_tracker.h | 8 +-- ash/wm/mru_window_tracker_unittest.cc | 2 +- ash/wm/overlay_event_filter.h | 10 ++-- ash/wm/partial_screenshot_view.cc | 10 ++-- ash/wm/partial_screenshot_view.h | 18 +++---- ash/wm/partial_screenshot_view_unittest.cc | 4 +- ash/wm/power_button_controller.h | 4 +- ash/wm/resize_handle_window_targeter.h | 19 +++---- ash/wm/resize_shadow_and_cursor_unittest.cc | 20 +++---- ash/wm/resize_shadow_controller.h | 11 ++-- ash/wm/root_window_layout_manager.h | 18 +++---- ash/wm/screen_dimmer.h | 8 +-- ash/wm/screen_dimmer_unittest.cc | 4 +- ash/wm/session_state_animator_impl.cc | 32 +++++------ ash/wm/session_state_animator_impl.h | 26 +++++---- ash/wm/stacking_controller.h | 8 +-- ash/wm/stacking_controller_unittest.cc | 2 +- ash/wm/status_area_layout_manager.h | 8 +-- ash/wm/system_background_controller.h | 8 +-- ash/wm/system_gesture_event_filter.h | 10 ++-- .../system_gesture_event_filter_unittest.cc | 51 ++++++++---------- ash/wm/system_modal_container_event_filter.h | 6 +-- .../system_modal_container_layout_manager.h | 22 ++++---- ...modal_container_layout_manager_unittest.cc | 26 ++++----- ash/wm/toplevel_window_event_handler.cc | 8 +-- ash/wm/toplevel_window_event_handler.h | 14 ++--- .../toplevel_window_event_handler_unittest.cc | 8 ++- ash/wm/video_detector.h | 12 ++--- ash/wm/video_detector_unittest.cc | 8 +-- ...irtual_keyboard_container_layout_manager.h | 4 +- ash/wm/window_animations.cc | 29 ++++------ ash/wm/window_animations_unittest.cc | 12 ++--- ash/wm/window_cycle_controller.cc | 4 +- ash/wm/window_cycle_controller_unittest.cc | 4 +- ash/wm/window_cycle_list.cc | 4 +- ash/wm/window_cycle_list.h | 4 +- ash/wm/window_manager_unittest.cc | 16 +++--- ash/wm/window_modality_controller_unittest.cc | 4 +- ash/wm/window_positioner_unittest.cc | 21 +++----- ash/wm/window_state.cc | 18 +++---- ash/wm/window_state.h | 8 +-- ash/wm/window_state_unittest.cc | 16 +++--- ash/wm/wm_event.h | 2 +- ash/wm/workspace_controller_unittest.cc | 11 ++-- 73 files changed, 427 insertions(+), 515 deletions(-) diff --git a/ash/wm/always_on_top_controller.h b/ash/wm/always_on_top_controller.h index c813ea2c4281c2..eeb1339151ef78 100644 --- a/ash/wm/always_on_top_controller.h +++ b/ash/wm/always_on_top_controller.h @@ -22,7 +22,7 @@ namespace ash { class AlwaysOnTopController : public aura::WindowObserver { public: AlwaysOnTopController(); - virtual ~AlwaysOnTopController(); + ~AlwaysOnTopController() override; // Sets the container for always on top windows. void SetAlwaysOnTopContainer(aura::Window* always_on_top_container); @@ -32,12 +32,12 @@ class AlwaysOnTopController : public aura::WindowObserver { private: // Overridden from aura::WindowObserver: - virtual void OnWindowAdded(aura::Window* child) override; - virtual void OnWillRemoveWindow(aura::Window* child) override; - virtual void OnWindowPropertyChanged(aura::Window* window, - const void* key, - intptr_t old) override; - virtual void OnWindowDestroyed(aura::Window* window) override; + void OnWindowAdded(aura::Window* child) override; + void OnWillRemoveWindow(aura::Window* child) override; + void OnWindowPropertyChanged(aura::Window* window, + const void* key, + intptr_t old) override; + void OnWindowDestroyed(aura::Window* window) override; aura::Window* always_on_top_container_; diff --git a/ash/wm/app_list_controller.h b/ash/wm/app_list_controller.h index d772dd5317b4d7..b5dc8f38d34d18 100644 --- a/ash/wm/app_list_controller.h +++ b/ash/wm/app_list_controller.h @@ -48,7 +48,7 @@ class AppListController : public ui::EventHandler, public app_list::PaginationModelObserver { public: AppListController(); - virtual ~AppListController(); + ~AppListController() override; // Show/hide app list window. The |window| is used to deterime in // which display (in which the |window| exists) the app list should @@ -92,38 +92,38 @@ class AppListController : public ui::EventHandler, void UpdateBounds(); // ui::EventHandler overrides: - virtual void OnMouseEvent(ui::MouseEvent* event) override; - virtual void OnGestureEvent(ui::GestureEvent* event) override; + void OnMouseEvent(ui::MouseEvent* event) override; + void OnGestureEvent(ui::GestureEvent* event) override; // aura::client::FocusChangeObserver overrides: - virtual void OnWindowFocused(aura::Window* gained_focus, - aura::Window* lost_focus) override; + void OnWindowFocused(aura::Window* gained_focus, + aura::Window* lost_focus) override; // aura::WindowObserver overrides: - virtual void OnWindowBoundsChanged(aura::Window* root, - const gfx::Rect& old_bounds, - const gfx::Rect& new_bounds) override; + void OnWindowBoundsChanged(aura::Window* root, + const gfx::Rect& old_bounds, + const gfx::Rect& new_bounds) override; // ui::ImplicitAnimationObserver overrides: - virtual void OnImplicitAnimationsCompleted() override; + void OnImplicitAnimationsCompleted() override; // views::WidgetObserver overrides: - virtual void OnWidgetDestroying(views::Widget* widget) override; + void OnWidgetDestroying(views::Widget* widget) override; // KeyboardControllerObserver overrides: - virtual void OnKeyboardBoundsChanging(const gfx::Rect& new_bounds) override; + void OnKeyboardBoundsChanging(const gfx::Rect& new_bounds) override; // ShellObserver overrides: - virtual void OnShelfAlignmentChanged(aura::Window* root_window) override; + void OnShelfAlignmentChanged(aura::Window* root_window) override; // ShelfIconObserver overrides: - virtual void OnShelfIconPositionsChanged() override; + void OnShelfIconPositionsChanged() override; // app_list::PaginationModelObserver overrides: - virtual void TotalPagesChanged() override; - virtual void SelectedPageChanged(int old_selected, int new_selected) override; - virtual void TransitionStarted() override; - virtual void TransitionChanged() override; + void TotalPagesChanged() override; + void SelectedPageChanged(int old_selected, int new_selected) override; + void TransitionStarted() override; + void TransitionChanged() override; // Whether we should show or hide app list widget. bool is_visible_; diff --git a/ash/wm/app_list_controller_unittest.cc b/ash/wm/app_list_controller_unittest.cc index a1ae844538d7ad..f4988948e48da0 100644 --- a/ash/wm/app_list_controller_unittest.cc +++ b/ash/wm/app_list_controller_unittest.cc @@ -30,7 +30,7 @@ class AppListControllerTest : public test::AshTestBase, public: AppListControllerTest(); virtual ~AppListControllerTest(); - virtual void SetUp() override; + void SetUp() override; bool IsCentered() const; }; diff --git a/ash/wm/ash_focus_rules.h b/ash/wm/ash_focus_rules.h index e4198faba730d8..f32ce87724cc57 100644 --- a/ash/wm/ash_focus_rules.h +++ b/ash/wm/ash_focus_rules.h @@ -16,16 +16,15 @@ namespace wm { class ASH_EXPORT AshFocusRules : public ::wm::BaseFocusRules { public: AshFocusRules(); - virtual ~AshFocusRules(); + ~AshFocusRules() override; private: // Overridden from ::wm::BaseFocusRules: - virtual bool SupportsChildActivation(aura::Window* window) const override; - virtual bool IsWindowConsideredVisibleForActivation( + bool SupportsChildActivation(aura::Window* window) const override; + bool IsWindowConsideredVisibleForActivation( aura::Window* window) const override; - virtual bool CanActivateWindow(aura::Window* window) const override; - virtual aura::Window* GetNextActivatableWindow( - aura::Window* ignore) const override; + bool CanActivateWindow(aura::Window* window) const override; + aura::Window* GetNextActivatableWindow(aura::Window* ignore) const override; aura::Window* GetTopmostWindowToActivateForContainerIndex( int index, diff --git a/ash/wm/ash_native_cursor_manager.h b/ash/wm/ash_native_cursor_manager.h index 0ab9964bdba34e..0c1da8222dcbba 100644 --- a/ash/wm/ash_native_cursor_manager.h +++ b/ash/wm/ash_native_cursor_manager.h @@ -33,7 +33,7 @@ class ASH_EXPORT AshNativeCursorManager : public ::wm::NativeCursorManager { public: AshNativeCursorManager(); - virtual ~AshNativeCursorManager(); + ~AshNativeCursorManager() override; // Toggle native cursor enabled/disabled. // The native cursor is enabled by default. When disabled, we hide the native @@ -45,19 +45,15 @@ class ASH_EXPORT AshNativeCursorManager friend class test::CursorManagerTestApi; // Overridden from ::wm::NativeCursorManager: - virtual void SetDisplay( - const gfx::Display& display, - ::wm::NativeCursorManagerDelegate* delegate) override; - virtual void SetCursor( - gfx::NativeCursor cursor, - ::wm::NativeCursorManagerDelegate* delegate) override; - virtual void SetVisibility( - bool visible, - ::wm::NativeCursorManagerDelegate* delegate) override; - virtual void SetCursorSet( - ui::CursorSetType cursor_set, - ::wm::NativeCursorManagerDelegate* delegate) override; - virtual void SetMouseEventsEnabled( + void SetDisplay(const gfx::Display& display, + ::wm::NativeCursorManagerDelegate* delegate) override; + void SetCursor(gfx::NativeCursor cursor, + ::wm::NativeCursorManagerDelegate* delegate) override; + void SetVisibility(bool visible, + ::wm::NativeCursorManagerDelegate* delegate) override; + void SetCursorSet(ui::CursorSetType cursor_set, + ::wm::NativeCursorManagerDelegate* delegate) override; + void SetMouseEventsEnabled( bool enabled, ::wm::NativeCursorManagerDelegate* delegate) override; diff --git a/ash/wm/ash_native_cursor_manager_interactive_uitest.cc b/ash/wm/ash_native_cursor_manager_interactive_uitest.cc index 1c710793d3158d..50f160ec3ccf37 100644 --- a/ash/wm/ash_native_cursor_manager_interactive_uitest.cc +++ b/ash/wm/ash_native_cursor_manager_interactive_uitest.cc @@ -28,9 +28,9 @@ namespace ash { class AshNativeCursorManagerTest : public test::AshTestBase { public: AshNativeCursorManagerTest() {} - virtual ~AshNativeCursorManagerTest() {} + ~AshNativeCursorManagerTest() override {} - virtual void SetUp() override { + void SetUp() override { gfx::GLSurface::InitializeOneOffForTests(); ui::RegisterPathProvider(); diff --git a/ash/wm/ash_native_cursor_manager_unittest.cc b/ash/wm/ash_native_cursor_manager_unittest.cc index c7ec6577340677..f29b92432b0f02 100644 --- a/ash/wm/ash_native_cursor_manager_unittest.cc +++ b/ash/wm/ash_native_cursor_manager_unittest.cc @@ -36,7 +36,7 @@ namespace { class MouseEventLocationDelegate : public aura::test::TestWindowDelegate { public: MouseEventLocationDelegate() {} - virtual ~MouseEventLocationDelegate() {} + ~MouseEventLocationDelegate() override {} gfx::Point GetMouseEventLocationAndReset() { gfx::Point p = mouse_event_location_; @@ -44,7 +44,7 @@ class MouseEventLocationDelegate : public aura::test::TestWindowDelegate { return p; } - virtual void OnMouseEvent(ui::MouseEvent* event) override { + void OnMouseEvent(ui::MouseEvent* event) override { mouse_event_location_ = event->location(); event->SetHandled(); } diff --git a/ash/wm/cursor_manager_chromeos.h b/ash/wm/cursor_manager_chromeos.h index ea81e54ccff82f..70c121e8a22ee1 100644 --- a/ash/wm/cursor_manager_chromeos.h +++ b/ash/wm/cursor_manager_chromeos.h @@ -29,11 +29,11 @@ class ASH_EXPORT CursorManager : public ::wm::CursorManager { public: explicit CursorManager( scoped_ptr< ::wm::NativeCursorManager> delegate); - virtual ~CursorManager(); + ~CursorManager() override; // aura::client::CursorClient: - virtual bool ShouldHideCursorOnKeyEvent( - const ui::KeyEvent& event) const override; + bool ShouldHideCursorOnKeyEvent(const ui::KeyEvent& event) const override; + private: DISALLOW_COPY_AND_ASSIGN(CursorManager); }; diff --git a/ash/wm/default_state.h b/ash/wm/default_state.h index a09f0a5e42f7e4..f03adb8cd38053 100644 --- a/ash/wm/default_state.h +++ b/ash/wm/default_state.h @@ -16,15 +16,14 @@ class SetBoundsEvent; class DefaultState : public WindowState::State { public: explicit DefaultState(WindowStateType initial_state_type); - virtual ~DefaultState(); + ~DefaultState() override; // WindowState::State overrides: - virtual void OnWMEvent(WindowState* window_state, - const WMEvent* event) override; - virtual WindowStateType GetType() const override; - virtual void AttachState(WindowState* window_state, - WindowState::State* previous_state) override; - virtual void DetachState(WindowState* window_state) override; + void OnWMEvent(WindowState* window_state, const WMEvent* event) override; + WindowStateType GetType() const override; + void AttachState(WindowState* window_state, + WindowState::State* previous_state) override; + void DetachState(WindowState* window_state) override; private: // Process state dependent events, such as TOGGLE_MAXIMIZED, diff --git a/ash/wm/default_window_resizer.h b/ash/wm/default_window_resizer.h index 49c701742a481e..3f7537e376f0d2 100644 --- a/ash/wm/default_window_resizer.h +++ b/ash/wm/default_window_resizer.h @@ -15,7 +15,7 @@ namespace ash { // windows coordiantes. class ASH_EXPORT DefaultWindowResizer : public WindowResizer { public: - virtual ~DefaultWindowResizer(); + ~DefaultWindowResizer() override; // Creates a new DefaultWindowResizer. The caller takes ownership of the // returned object. @@ -29,9 +29,9 @@ class ASH_EXPORT DefaultWindowResizer : public WindowResizer { } // WindowResizer: - virtual void Drag(const gfx::Point& location, int event_flags) override; - virtual void CompleteDrag() override; - virtual void RevertDrag() override; + void Drag(const gfx::Point& location, int event_flags) override; + void CompleteDrag() override; + void RevertDrag() override; private: explicit DefaultWindowResizer(wm::WindowState* window_state); diff --git a/ash/wm/dock/docked_window_layout_manager.cc b/ash/wm/dock/docked_window_layout_manager.cc index b12d221f1115c2..db7c9c26ca4414 100644 --- a/ash/wm/dock/docked_window_layout_manager.cc +++ b/ash/wm/dock/docked_window_layout_manager.cc @@ -87,12 +87,12 @@ class DockedBackgroundWidget : public views::Widget, } // views::Widget: - virtual void OnNativeWidgetVisibilityChanged(bool visible) override { + void OnNativeWidgetVisibilityChanged(bool visible) override { views::Widget::OnNativeWidgetVisibilityChanged(visible); UpdateBackground(); } - virtual void OnNativeWidgetPaint(gfx::Canvas* canvas) override { + void OnNativeWidgetPaint(gfx::Canvas* canvas) override { const gfx::ImageSkia& shelf_background( alignment_ == DOCKED_ALIGNMENT_LEFT ? shelf_background_left_ : shelf_background_right_); @@ -127,7 +127,7 @@ class DockedBackgroundWidget : public views::Widget, } // BackgroundAnimatorDelegate: - virtual void UpdateBackground(int alpha) override { + void UpdateBackground(int alpha) override { alpha_ = alpha; SchedulePaintInRect(gfx::Rect(GetWindowBoundsInScreen().size())); } @@ -372,7 +372,7 @@ class DockedWindowLayoutManager::ShelfWindowObserver : public WindowObserver { ->AddObserver(this); } - virtual ~ShelfWindowObserver() { + ~ShelfWindowObserver() override { if (docked_layout_manager_->shelf() && docked_layout_manager_->shelf()->shelf_widget()) docked_layout_manager_->shelf()->shelf_widget()->GetNativeView() @@ -380,9 +380,9 @@ class DockedWindowLayoutManager::ShelfWindowObserver : public WindowObserver { } // aura::WindowObserver: - virtual void OnWindowBoundsChanged(aura::Window* window, - const gfx::Rect& old_bounds, - const gfx::Rect& new_bounds) override { + void OnWindowBoundsChanged(aura::Window* window, + const gfx::Rect& old_bounds, + const gfx::Rect& new_bounds) override { shelf_bounds_in_screen_ = ScreenUtil::ConvertRectToScreen( window->parent(), new_bounds); docked_layout_manager_->OnShelfBoundsChanged(); diff --git a/ash/wm/dock/docked_window_layout_manager.h b/ash/wm/dock/docked_window_layout_manager.h index a7b59d4eeff70e..dfb1c20a9a75d0 100644 --- a/ash/wm/dock/docked_window_layout_manager.h +++ b/ash/wm/dock/docked_window_layout_manager.h @@ -83,7 +83,7 @@ class ASH_EXPORT DockedWindowLayoutManager DockedWindowLayoutManager(aura::Window* dock_container, WorkspaceController* workspace_controller); - virtual ~DockedWindowLayoutManager(); + ~DockedWindowLayoutManager() override; // Disconnects observers before container windows get destroyed. void Shutdown(); @@ -148,42 +148,39 @@ class ASH_EXPORT DockedWindowLayoutManager void OnShelfBoundsChanged(); // SnapLayoutManager: - virtual void OnWindowResized() override; - virtual void OnWindowAddedToLayout(aura::Window* child) override; - virtual void OnWillRemoveWindowFromLayout(aura::Window* child) override {} - virtual void OnWindowRemovedFromLayout(aura::Window* child) override; - virtual void OnChildWindowVisibilityChanged(aura::Window* child, - bool visibile) override; - virtual void SetChildBounds(aura::Window* child, - const gfx::Rect& requested_bounds) override; + void OnWindowResized() override; + void OnWindowAddedToLayout(aura::Window* child) override; + void OnWillRemoveWindowFromLayout(aura::Window* child) override {} + void OnWindowRemovedFromLayout(aura::Window* child) override; + void OnChildWindowVisibilityChanged(aura::Window* child, + bool visibile) override; + void SetChildBounds(aura::Window* child, + const gfx::Rect& requested_bounds) override; // ash::ShellObserver: - virtual void OnDisplayWorkAreaInsetsChanged() override; - virtual void OnFullscreenStateChanged(bool is_fullscreen, - aura::Window* root_window) override; - virtual void OnShelfAlignmentChanged(aura::Window* root_window) override; + void OnDisplayWorkAreaInsetsChanged() override; + void OnFullscreenStateChanged(bool is_fullscreen, + aura::Window* root_window) override; + void OnShelfAlignmentChanged(aura::Window* root_window) override; // ShelfLayoutManagerObserver: - virtual void OnBackgroundUpdated( - ShelfBackgroundType background_type, - BackgroundAnimatorChangeType change_type) override; + void OnBackgroundUpdated(ShelfBackgroundType background_type, + BackgroundAnimatorChangeType change_type) override; // wm::WindowStateObserver: - virtual void OnPreWindowStateTypeChange( - wm::WindowState* window_state, - wm::WindowStateType old_type) override; + void OnPreWindowStateTypeChange(wm::WindowState* window_state, + wm::WindowStateType old_type) override; // aura::WindowObserver: - virtual void OnWindowBoundsChanged(aura::Window* window, - const gfx::Rect& old_bounds, - const gfx::Rect& new_bounds) override; - virtual void OnWindowVisibilityChanging(aura::Window* window, - bool visible) override; - virtual void OnWindowDestroying(aura::Window* window) override; + void OnWindowBoundsChanged(aura::Window* window, + const gfx::Rect& old_bounds, + const gfx::Rect& new_bounds) override; + void OnWindowVisibilityChanging(aura::Window* window, bool visible) override; + void OnWindowDestroying(aura::Window* window) override; // aura::client::ActivationChangeObserver: - virtual void OnWindowActivated(aura::Window* gained_active, - aura::Window* lost_active) override; + void OnWindowActivated(aura::Window* gained_active, + aura::Window* lost_active) override; private: class ShelfWindowObserver; @@ -266,8 +263,7 @@ class ASH_EXPORT DockedWindowLayoutManager void UpdateStacking(aura::Window* active_window); // keyboard::KeyboardControllerObserver: - virtual void OnKeyboardBoundsChanging( - const gfx::Rect& keyboard_bounds) override; + void OnKeyboardBoundsChanging(const gfx::Rect& keyboard_bounds) override; // Parent window associated with this layout manager. aura::Window* dock_container_; diff --git a/ash/wm/dock/docked_window_layout_manager_unittest.cc b/ash/wm/dock/docked_window_layout_manager_unittest.cc index 0c0780be9c7b39..0346758a50ba86 100644 --- a/ash/wm/dock/docked_window_layout_manager_unittest.cc +++ b/ash/wm/dock/docked_window_layout_manager_unittest.cc @@ -44,7 +44,7 @@ class DockedWindowLayoutManagerTest DockedWindowLayoutManagerTest() : window_type_(GetParam()) {} virtual ~DockedWindowLayoutManagerTest() {} - virtual void SetUp() override { + void SetUp() override { AshTestBase::SetUp(); UpdateDisplay("600x600"); ASSERT_TRUE(test::TestShelfDelegate::instance()); diff --git a/ash/wm/dock/docked_window_resizer.h b/ash/wm/dock/docked_window_resizer.h index 3f45d89a1258f7..6b769d354470f5 100644 --- a/ash/wm/dock/docked_window_resizer.h +++ b/ash/wm/dock/docked_window_resizer.h @@ -27,7 +27,7 @@ class DockedWindowLayoutManager; // moving or resizing of a window while it is docked to the side of a screen. class ASH_EXPORT DockedWindowResizer : public WindowResizer { public: - virtual ~DockedWindowResizer(); + ~DockedWindowResizer() override; // Creates a new DockWindowResizer. The caller takes ownership of the // returned object. The ownership of |next_window_resizer| is taken by the @@ -36,9 +36,9 @@ class ASH_EXPORT DockedWindowResizer : public WindowResizer { wm::WindowState* window_state); // WindowResizer: - virtual void Drag(const gfx::Point& location, int event_flags) override; - virtual void CompleteDrag() override; - virtual void RevertDrag() override; + void Drag(const gfx::Point& location, int event_flags) override; + void CompleteDrag() override; + void RevertDrag() override; private: // Creates DockWindowResizer that adds the ability to attach / detach diff --git a/ash/wm/dock/docked_window_resizer_unittest.cc b/ash/wm/dock/docked_window_resizer_unittest.cc index 27a9fc77ecaf8b..c8128261b087d4 100644 --- a/ash/wm/dock/docked_window_resizer_unittest.cc +++ b/ash/wm/dock/docked_window_resizer_unittest.cc @@ -45,16 +45,14 @@ class DockedWindowResizerTest DockedWindowResizerTest() : model_(NULL), window_type_(GetParam()) {} virtual ~DockedWindowResizerTest() {} - virtual void SetUp() override { + void SetUp() override { AshTestBase::SetUp(); UpdateDisplay("600x400"); test::ShellTestApi test_api(Shell::GetInstance()); model_ = test_api.shelf_model(); } - virtual void TearDown() override { - AshTestBase::TearDown(); - } + void TearDown() override { AshTestBase::TearDown(); } protected: enum DockedEdge { diff --git a/ash/wm/drag_window_resizer.h b/ash/wm/drag_window_resizer.h index a4f4b306f38492..478016871c2e45 100644 --- a/ash/wm/drag_window_resizer.h +++ b/ash/wm/drag_window_resizer.h @@ -19,7 +19,7 @@ class DragWindowController; // drag windows across displays. class ASH_EXPORT DragWindowResizer : public WindowResizer { public: - virtual ~DragWindowResizer(); + ~DragWindowResizer() override; // Creates a new DragWindowResizer. The caller takes ownership of the // returned object. The ownership of |next_window_resizer| is taken by the @@ -28,9 +28,9 @@ class ASH_EXPORT DragWindowResizer : public WindowResizer { wm::WindowState* window_state); // WindowResizer: - virtual void Drag(const gfx::Point& location, int event_flags) override; - virtual void CompleteDrag() override; - virtual void RevertDrag() override; + void Drag(const gfx::Point& location, int event_flags) override; + void CompleteDrag() override; + void RevertDrag() override; private: FRIEND_TEST_ALL_PREFIXES(DragWindowResizerTest, DragWindowController); diff --git a/ash/wm/event_client_impl.h b/ash/wm/event_client_impl.h index 5f652723033e89..8a7a488a883af4 100644 --- a/ash/wm/event_client_impl.h +++ b/ash/wm/event_client_impl.h @@ -15,13 +15,12 @@ namespace ash { class EventClientImpl : public aura::client::EventClient { public: EventClientImpl(); - virtual ~EventClientImpl(); + ~EventClientImpl() override; private: // Overridden from aura::client::EventClient: - virtual bool CanProcessEventsWithinSubtree( - const aura::Window* window) const override; - virtual ui::EventTarget* GetToplevelEventTarget() override; + bool CanProcessEventsWithinSubtree(const aura::Window* window) const override; + ui::EventTarget* GetToplevelEventTarget() override; DISALLOW_COPY_AND_ASSIGN(EventClientImpl); }; diff --git a/ash/wm/gestures/long_press_affordance_handler.cc b/ash/wm/gestures/long_press_affordance_handler.cc index b1fc87916520f1..ab9e413153a688 100644 --- a/ash/wm/gestures/long_press_affordance_handler.cc +++ b/ash/wm/gestures/long_press_affordance_handler.cc @@ -161,8 +161,7 @@ class LongPressAffordanceHandler::LongPressAffordanceView widget_->GetNativeView()->layer()->SetOpacity(kAffordanceOpacityStartValue); } - virtual ~LongPressAffordanceView() { - } + ~LongPressAffordanceView() override {} void UpdateWithGrowAnimation(gfx::Animation* animation) { // Update the portion of the circle filled so far and re-draw. @@ -187,12 +186,12 @@ class LongPressAffordanceHandler::LongPressAffordanceView private: // Overridden from views::View. - virtual gfx::Size GetPreferredSize() const override { + gfx::Size GetPreferredSize() const override { return gfx::Size(2 * (kAffordanceOuterRadius + kAffordanceGlowWidth), 2 * (kAffordanceOuterRadius + kAffordanceGlowWidth)); } - virtual void OnPaint(gfx::Canvas* canvas) override { + void OnPaint(gfx::Canvas* canvas) override { gfx::Point center(GetPreferredSize().width() / 2, GetPreferredSize().height() / 2); canvas->Save(); diff --git a/ash/wm/gestures/long_press_affordance_handler.h b/ash/wm/gestures/long_press_affordance_handler.h index 01a9c09c758ada..9c7a1a469a825d 100644 --- a/ash/wm/gestures/long_press_affordance_handler.h +++ b/ash/wm/gestures/long_press_affordance_handler.h @@ -31,7 +31,7 @@ class LongPressAffordanceHandler : public gfx::LinearAnimation, public aura::WindowObserver { public: LongPressAffordanceHandler(); - virtual ~LongPressAffordanceHandler(); + ~LongPressAffordanceHandler() override; // Displays or removes long press affordance according to the |event|. void ProcessEvent(aura::Window* target, ui::GestureEvent* event); @@ -52,11 +52,11 @@ class LongPressAffordanceHandler : public gfx::LinearAnimation, void SetTapDownTarget(aura::Window* target); // Overridden from gfx::LinearAnimation. - virtual void AnimateToState(double state) override; - virtual void AnimationStopped() override; + void AnimateToState(double state) override; + void AnimationStopped() override; // Overridden from aura::WindowObserver. - virtual void OnWindowDestroying(aura::Window* window) override; + void OnWindowDestroying(aura::Window* window) override; scoped_ptr view_; gfx::Point tap_down_location_; diff --git a/ash/wm/gestures/overview_gesture_handler_unittest.cc b/ash/wm/gestures/overview_gesture_handler_unittest.cc index 6c1412bf9f1cfc..b5a8796606f253 100644 --- a/ash/wm/gestures/overview_gesture_handler_unittest.cc +++ b/ash/wm/gestures/overview_gesture_handler_unittest.cc @@ -18,7 +18,7 @@ namespace ash { class OverviewGestureHandlerTest : public test::AshTestBase { public: OverviewGestureHandlerTest() {} - virtual ~OverviewGestureHandlerTest() {} + ~OverviewGestureHandlerTest() override {} aura::Window* CreateWindow(const gfx::Rect& bounds) { return CreateTestWindowInShellWithDelegate(&delegate_, -1, bounds); diff --git a/ash/wm/gestures/tray_gesture_handler.h b/ash/wm/gestures/tray_gesture_handler.h index 68ecf959a87e0e..529349868c81c4 100644 --- a/ash/wm/gestures/tray_gesture_handler.h +++ b/ash/wm/gestures/tray_gesture_handler.h @@ -19,7 +19,7 @@ namespace ash { class TrayGestureHandler : public views::WidgetObserver { public: TrayGestureHandler(); - virtual ~TrayGestureHandler(); + ~TrayGestureHandler() override; // Handles a gesture-update event and updates the dragging state of the tray // bubble. Returns true if the handler can continue to process gesture events @@ -30,7 +30,7 @@ class TrayGestureHandler : public views::WidgetObserver { void CompleteGestureDrag(const ui::GestureEvent& event); private: - virtual void OnWidgetDestroying(views::Widget* widget) override; + void OnWidgetDestroying(views::Widget* widget) override; // The widget for the tray-bubble. views::Widget* widget_; diff --git a/ash/wm/immersive_fullscreen_controller.cc b/ash/wm/immersive_fullscreen_controller.cc index 172d5720882eeb..9b3c01c4be7727 100644 --- a/ash/wm/immersive_fullscreen_controller.cc +++ b/ash/wm/immersive_fullscreen_controller.cc @@ -132,7 +132,7 @@ class ImmersiveFullscreenController::BubbleManager : public aura::WindowObserver { public: explicit BubbleManager(ImmersiveFullscreenController* controller); - virtual ~BubbleManager(); + ~BubbleManager() override; // Start / stop observing changes to |bubble|'s visibility. void StartObserving(aura::Window* bubble); @@ -143,9 +143,8 @@ class ImmersiveFullscreenController::BubbleManager void UpdateRevealedLock(); // aura::WindowObserver overrides: - virtual void OnWindowVisibilityChanged(aura::Window* window, - bool visible) override; - virtual void OnWindowDestroying(aura::Window* window) override; + void OnWindowVisibilityChanged(aura::Window* window, bool visible) override; + void OnWindowDestroying(aura::Window* window) override; ImmersiveFullscreenController* controller_; diff --git a/ash/wm/immersive_fullscreen_controller.h b/ash/wm/immersive_fullscreen_controller.h index 47f2610f6587ce..773c5eca63082a 100644 --- a/ash/wm/immersive_fullscreen_controller.h +++ b/ash/wm/immersive_fullscreen_controller.h @@ -86,7 +86,7 @@ class ASH_EXPORT ImmersiveFullscreenController }; ImmersiveFullscreenController(); - virtual ~ImmersiveFullscreenController(); + ~ImmersiveFullscreenController() override; // Initializes the controller. Must be called prior to enabling immersive // fullscreen via SetEnabled(). |top_container| is used to keep the @@ -126,34 +126,33 @@ class ASH_EXPORT ImmersiveFullscreenController void SetupForTest(); // ui::EventHandler overrides: - virtual void OnMouseEvent(ui::MouseEvent* event) override; - virtual void OnTouchEvent(ui::TouchEvent* event) override; - virtual void OnGestureEvent(ui::GestureEvent* event) override; + void OnMouseEvent(ui::MouseEvent* event) override; + void OnTouchEvent(ui::TouchEvent* event) override; + void OnGestureEvent(ui::GestureEvent* event) override; // views::FocusChangeObserver overrides: - virtual void OnWillChangeFocus(views::View* focused_before, - views::View* focused_now) override; - virtual void OnDidChangeFocus(views::View* focused_before, - views::View* focused_now) override; + void OnWillChangeFocus(views::View* focused_before, + views::View* focused_now) override; + void OnDidChangeFocus(views::View* focused_before, + views::View* focused_now) override; // views::WidgetObserver overrides: - virtual void OnWidgetDestroying(views::Widget* widget) override; - virtual void OnWidgetActivationChanged(views::Widget* widget, - bool active) override; + void OnWidgetDestroying(views::Widget* widget) override; + void OnWidgetActivationChanged(views::Widget* widget, bool active) override; // gfx::AnimationDelegate overrides: - virtual void AnimationEnded(const gfx::Animation* animation) override; - virtual void AnimationProgressed(const gfx::Animation* animation) override; + void AnimationEnded(const gfx::Animation* animation) override; + void AnimationProgressed(const gfx::Animation* animation) override; // ::wm::TransientWindowObserver overrides: - virtual void OnTransientChildAdded(aura::Window* window, - aura::Window* transient) override; - virtual void OnTransientChildRemoved(aura::Window* window, - aura::Window* transient) override; + void OnTransientChildAdded(aura::Window* window, + aura::Window* transient) override; + void OnTransientChildRemoved(aura::Window* window, + aura::Window* transient) override; // ash::ImmersiveRevealedLock::Delegate overrides: - virtual void LockRevealedState(AnimateReveal animate_reveal) override; - virtual void UnlockRevealedState() override; + void LockRevealedState(AnimateReveal animate_reveal) override; + void UnlockRevealedState() override; private: friend class ImmersiveFullscreenControllerTest; diff --git a/ash/wm/immersive_fullscreen_controller_unittest.cc b/ash/wm/immersive_fullscreen_controller_unittest.cc index 6295e948bf7d5a..7195429f4c4c2f 100644 --- a/ash/wm/immersive_fullscreen_controller_unittest.cc +++ b/ash/wm/immersive_fullscreen_controller_unittest.cc @@ -39,24 +39,22 @@ class MockImmersiveFullscreenControllerDelegate enabled_(false), visible_fraction_(1) { } - virtual ~MockImmersiveFullscreenControllerDelegate() {} + ~MockImmersiveFullscreenControllerDelegate() override {} // ImmersiveFullscreenController::Delegate overrides: - virtual void OnImmersiveRevealStarted() override { + void OnImmersiveRevealStarted() override { enabled_ = true; visible_fraction_ = 0; } - virtual void OnImmersiveRevealEnded() override { - visible_fraction_ = 0; - } - virtual void OnImmersiveFullscreenExited() override { + void OnImmersiveRevealEnded() override { visible_fraction_ = 0; } + void OnImmersiveFullscreenExited() override { enabled_ = false; visible_fraction_ = 1; } - virtual void SetVisibleFraction(double visible_fraction) override { + void SetVisibleFraction(double visible_fraction) override { visible_fraction_ = visible_fraction; } - virtual std::vector GetVisibleBoundsInScreen() const override { + std::vector GetVisibleBoundsInScreen() const override { std::vector bounds_in_screen; bounds_in_screen.push_back(top_container_view_->GetBoundsInScreen()); return bounds_in_screen; @@ -81,10 +79,10 @@ class MockImmersiveFullscreenControllerDelegate class ConsumeEventHandler : public ui::test::TestEventHandler { public: ConsumeEventHandler() {} - virtual ~ConsumeEventHandler() {} + ~ConsumeEventHandler() override {} private: - virtual void OnEvent(ui::Event* event) override { + void OnEvent(ui::Event* event) override { ui::test::TestEventHandler::OnEvent(event); if (event->cancelable()) event->SetHandled(); @@ -109,7 +107,7 @@ class ImmersiveFullscreenControllerTest : public ash::test::AshTestBase { : widget_(NULL), top_container_(NULL), content_view_(NULL) {} - virtual ~ImmersiveFullscreenControllerTest() {} + ~ImmersiveFullscreenControllerTest() override {} ImmersiveFullscreenController* controller() { return controller_.get(); @@ -142,7 +140,7 @@ class ImmersiveFullscreenControllerTest : public ash::test::AshTestBase { } // ash::test::AshTestBase overrides: - virtual void SetUp() override { + void SetUp() override { ash::test::AshTestBase::SetUp(); widget_ = new views::Widget(); diff --git a/ash/wm/lock_layout_manager.h b/ash/wm/lock_layout_manager.h index 88e72fa5b5348b..716baf0dae106f 100644 --- a/ash/wm/lock_layout_manager.h +++ b/ash/wm/lock_layout_manager.h @@ -51,35 +51,35 @@ class ASH_EXPORT LockLayoutManager public keyboard::KeyboardControllerObserver { public: explicit LockLayoutManager(aura::Window* window); - virtual ~LockLayoutManager(); + ~LockLayoutManager() override; // Overridden from aura::LayoutManager: - virtual void OnWindowResized() override; - virtual void OnWindowAddedToLayout(aura::Window* child) override; - virtual void OnWillRemoveWindowFromLayout(aura::Window* child) override; - virtual void OnWindowRemovedFromLayout(aura::Window* child) override; - virtual void OnChildWindowVisibilityChanged(aura::Window* child, - bool visibile) override; - virtual void SetChildBounds(aura::Window* child, - const gfx::Rect& requested_bounds) override; + void OnWindowResized() override; + void OnWindowAddedToLayout(aura::Window* child) override; + void OnWillRemoveWindowFromLayout(aura::Window* child) override; + void OnWindowRemovedFromLayout(aura::Window* child) override; + void OnChildWindowVisibilityChanged(aura::Window* child, + bool visibile) override; + void SetChildBounds(aura::Window* child, + const gfx::Rect& requested_bounds) override; // Overriden from aura::WindowObserver: - virtual void OnWindowHierarchyChanged( + void OnWindowHierarchyChanged( const WindowObserver::HierarchyChangeParams& params) override; - virtual void OnWindowPropertyChanged(aura::Window* window, - const void* key, - intptr_t old) override; - virtual void OnWindowStackingChanged(aura::Window* window) override; - virtual void OnWindowDestroying(aura::Window* window) override; - virtual void OnWindowBoundsChanged(aura::Window* window, - const gfx::Rect& old_bounds, - const gfx::Rect& new_bounds) override; + void OnWindowPropertyChanged(aura::Window* window, + const void* key, + intptr_t old) override; + void OnWindowStackingChanged(aura::Window* window) override; + void OnWindowDestroying(aura::Window* window) override; + void OnWindowBoundsChanged(aura::Window* window, + const gfx::Rect& old_bounds, + const gfx::Rect& new_bounds) override; // VirtualKeyboardStateObserver overrides: - virtual void OnVirtualKeyboardStateChanged(bool activated) override; + void OnVirtualKeyboardStateChanged(bool activated) override; // keyboard::KeyboardControllerObserver overrides: - virtual void OnKeyboardBoundsChanging(const gfx::Rect& new_bounds) override; + void OnKeyboardBoundsChanging(const gfx::Rect& new_bounds) override; private: // Adjusts the bounds of all managed windows when the display area changes. diff --git a/ash/wm/lock_layout_manager_unittest.cc b/ash/wm/lock_layout_manager_unittest.cc index e1ed1348bded20..e76fd96f7da43e 100644 --- a/ash/wm/lock_layout_manager_unittest.cc +++ b/ash/wm/lock_layout_manager_unittest.cc @@ -33,24 +33,14 @@ class LoginTestWidgetDelegate : public views::WidgetDelegate { public: explicit LoginTestWidgetDelegate(views::Widget* widget) : widget_(widget) { } - virtual ~LoginTestWidgetDelegate() {} + ~LoginTestWidgetDelegate() override {} // Overridden from WidgetDelegate: - virtual void DeleteDelegate() override { - delete this; - } - virtual views::Widget* GetWidget() override { - return widget_; - } - virtual const views::Widget* GetWidget() const override { - return widget_; - } - virtual bool CanActivate() const override { - return true; - } - virtual bool ShouldAdvanceFocusToTopLevelWidget() const override { - return true; - } + void DeleteDelegate() override { delete this; } + views::Widget* GetWidget() override { return widget_; } + const views::Widget* GetWidget() const override { return widget_; } + bool CanActivate() const override { return true; } + bool ShouldAdvanceFocusToTopLevelWidget() const override { return true; } private: views::Widget* widget_; @@ -62,7 +52,7 @@ class LoginTestWidgetDelegate : public views::WidgetDelegate { class LockLayoutManagerTest : public AshTestBase { public: - virtual void SetUp() override { + void SetUp() override { // Allow a virtual keyboard (and initialize it per default). CommandLine::ForCurrentProcess()->AppendSwitch( keyboard::switches::kEnableVirtualKeyboard); @@ -71,7 +61,7 @@ class LockLayoutManagerTest : public AshTestBase { keyboard::KeyboardController::GetInstance()); } - virtual void TearDown() override { + void TearDown() override { Shell::GetPrimaryRootWindowController()->DeactivateKeyboard( keyboard::KeyboardController::GetInstance()); AshTestBase::TearDown(); diff --git a/ash/wm/lock_state_controller.h b/ash/wm/lock_state_controller.h index 5db14eb2d5571a..73199bf6a802f8 100644 --- a/ash/wm/lock_state_controller.h +++ b/ash/wm/lock_state_controller.h @@ -143,7 +143,7 @@ class ASH_EXPORT LockStateController : public aura::WindowTreeHostObserver, }; LockStateController(); - virtual ~LockStateController(); + ~LockStateController() override; void SetDelegate(scoped_ptr delegate); @@ -200,12 +200,12 @@ class ASH_EXPORT LockStateController : public aura::WindowTreeHostObserver, void SetLockScreenDisplayedCallback(const base::Closure& callback); // aura::WindowTreeHostObserver override: - virtual void OnHostCloseRequested(const aura::WindowTreeHost* host) override; + void OnHostCloseRequested(const aura::WindowTreeHost* host) override; // ShellObserver overrides: - virtual void OnLoginStateChanged(user::LoginStatus status) override; - virtual void OnAppTerminating() override; - virtual void OnLockStateChanged(bool locked) override; + void OnLoginStateChanged(user::LoginStatus status) override; + void OnAppTerminating() override; + void OnLockStateChanged(bool locked) override; void set_animator_for_test(SessionStateAnimator* animator) { animator_.reset(animator); diff --git a/ash/wm/lock_state_controller_unittest.cc b/ash/wm/lock_state_controller_unittest.cc index f7b2f89d7e9666..480d233bbd17d3 100644 --- a/ash/wm/lock_state_controller_unittest.cc +++ b/ash/wm/lock_state_controller_unittest.cc @@ -48,9 +48,9 @@ class LockStateControllerTest : public AshTestBase { lock_state_controller_delegate_(NULL), test_animator_(NULL) { } - virtual ~LockStateControllerTest() {} + ~LockStateControllerTest() override {} - virtual void SetUp() override { + void SetUp() override { AshTestBase::SetUp(); scoped_ptr lock_state_controller_delegate( diff --git a/ash/wm/lock_window_state.h b/ash/wm/lock_window_state.h index c17faf76dc1d0b..33a5b0b7a3a4d3 100644 --- a/ash/wm/lock_window_state.h +++ b/ash/wm/lock_window_state.h @@ -18,15 +18,15 @@ class LockWindowState : public wm::WindowState::State { // The |window|'s state object will be modified to use this new window mode // state handler. explicit LockWindowState(aura::Window* window); - virtual ~LockWindowState(); + ~LockWindowState() override; // WindowState::State overrides: - virtual void OnWMEvent(wm::WindowState* window_state, - const wm::WMEvent* event) override; - virtual wm::WindowStateType GetType() const override; - virtual void AttachState(wm::WindowState* window_state, - wm::WindowState::State* previous_state) override; - virtual void DetachState(wm::WindowState* window_state) override; + void OnWMEvent(wm::WindowState* window_state, + const wm::WMEvent* event) override; + wm::WindowStateType GetType() const override; + void AttachState(wm::WindowState* window_state, + wm::WindowState::State* previous_state) override; + void DetachState(wm::WindowState* window_state) override; // Creates new LockWindowState instance and attaches it to |window|. static wm::WindowState* SetLockWindowState(aura::Window* window); diff --git a/ash/wm/mru_window_tracker.h b/ash/wm/mru_window_tracker.h index ff70166a5910f3..6f6dd5f0b338b0 100644 --- a/ash/wm/mru_window_tracker.h +++ b/ash/wm/mru_window_tracker.h @@ -34,7 +34,7 @@ class ASH_EXPORT MruWindowTracker explicit MruWindowTracker( aura::client::ActivationClient* activation_client); - virtual ~MruWindowTracker(); + ~MruWindowTracker() override; // Returns the set of windows which can be cycled through. This method creates // the vector based on the current set of windows across all valid root @@ -61,11 +61,11 @@ class ASH_EXPORT MruWindowTracker void SetActiveWindow(aura::Window* active_window); // Overridden from aura::client::ActivationChangeObserver: - virtual void OnWindowActivated(aura::Window* gained_active, - aura::Window* lost_active) override; + void OnWindowActivated(aura::Window* gained_active, + aura::Window* lost_active) override; // Overridden from WindowObserver: - virtual void OnWindowDestroyed(aura::Window* window) override; + void OnWindowDestroyed(aura::Window* window) override; // List of windows that have been activated in containers that we cycle // through, sorted by most recently used. diff --git a/ash/wm/mru_window_tracker_unittest.cc b/ash/wm/mru_window_tracker_unittest.cc index 2c08a5dc120614..a7bec73a379262 100644 --- a/ash/wm/mru_window_tracker_unittest.cc +++ b/ash/wm/mru_window_tracker_unittest.cc @@ -18,7 +18,7 @@ namespace ash { class MruWindowTrackerTest : public test::AshTestBase { public: MruWindowTrackerTest() {} - virtual ~MruWindowTrackerTest() {} + ~MruWindowTrackerTest() override {} aura::Window* CreateWindow() { return CreateTestWindowInShellWithBounds(gfx::Rect(0, 0, 400, 400)); diff --git a/ash/wm/overlay_event_filter.h b/ash/wm/overlay_event_filter.h index bcffbe9b804261..0c591e76f0440f 100644 --- a/ash/wm/overlay_event_filter.h +++ b/ash/wm/overlay_event_filter.h @@ -37,7 +37,7 @@ class ASH_EXPORT OverlayEventFilter : public ui::EventHandler, }; OverlayEventFilter(); - virtual ~OverlayEventFilter(); + ~OverlayEventFilter() override; // Starts the filtering of events. It also notifies the specified // |delegate| when a key event means cancel (like Esc). It holds the @@ -55,12 +55,12 @@ class ASH_EXPORT OverlayEventFilter : public ui::EventHandler, bool IsActive(); // ui::EventHandler overrides: - virtual void OnKeyEvent(ui::KeyEvent* event) override; + void OnKeyEvent(ui::KeyEvent* event) override; // ShellObserver overrides: - virtual void OnLoginStateChanged(user::LoginStatus status) override; - virtual void OnAppTerminating() override; - virtual void OnLockStateChanged(bool locked) override; + void OnLoginStateChanged(user::LoginStatus status) override; + void OnAppTerminating() override; + void OnLockStateChanged(bool locked) override; private: FRIEND_TEST_ALL_PREFIXES(PartialScreenshotViewTest, DontStartOverOverlay); diff --git a/ash/wm/partial_screenshot_view.cc b/ash/wm/partial_screenshot_view.cc index 789ea1e90e58d6..233a286d28398e 100644 --- a/ash/wm/partial_screenshot_view.cc +++ b/ash/wm/partial_screenshot_view.cc @@ -39,7 +39,7 @@ class PartialScreenshotView::OverlayDelegate } // Overridden from OverlayEventFilter::Delegate: - virtual void Cancel() override { + void Cancel() override { // Make sure the mouse_warp_mode allows warping. It can be stopped by a // partial screenshot view. MouseCursorEventFilter* mouse_cursor_filter = @@ -50,18 +50,18 @@ class PartialScreenshotView::OverlayDelegate widgets_[i]->Close(); } - virtual bool IsCancelingKeyEvent(ui::KeyEvent* event) override { + bool IsCancelingKeyEvent(ui::KeyEvent* event) override { return event->key_code() == ui::VKEY_ESCAPE; } - virtual aura::Window* GetWindow() override { + aura::Window* GetWindow() override { // Just returns NULL because this class does not handle key events in // OverlayEventFilter, except for cancel keys. return NULL; } // Overridden from views::WidgetObserver: - virtual void OnWidgetDestroying(views::Widget* widget) override { + void OnWidgetDestroying(views::Widget* widget) override { widget->RemoveObserver(this); widgets_.erase(std::remove(widgets_.begin(), widgets_.end(), widget)); if (widgets_.empty()) @@ -69,7 +69,7 @@ class PartialScreenshotView::OverlayDelegate } private: - virtual ~OverlayDelegate() { + ~OverlayDelegate() override { Shell::GetInstance()->overlay_filter()->Deactivate(this); } diff --git a/ash/wm/partial_screenshot_view.h b/ash/wm/partial_screenshot_view.h index 01fda53b23a4b1..71e0242873373c 100644 --- a/ash/wm/partial_screenshot_view.h +++ b/ash/wm/partial_screenshot_view.h @@ -35,7 +35,7 @@ class ASH_EXPORT PartialScreenshotView : public views::WidgetDelegateView { PartialScreenshotView(OverlayDelegate* overlay_delegate, ScreenshotDelegate* screenshot_delegate); - virtual ~PartialScreenshotView(); + ~PartialScreenshotView() override; // Initializes partial screenshot UI widget for |root_window|. void Init(aura::Window* root_window); @@ -48,14 +48,14 @@ class ASH_EXPORT PartialScreenshotView : public views::WidgetDelegateView { void OnSelectionFinished(); // Overridden from views::View: - virtual gfx::NativeCursor GetCursor(const ui::MouseEvent& event) override; - virtual void OnPaint(gfx::Canvas* canvas) override; - virtual bool OnMousePressed(const ui::MouseEvent& event) override; - virtual bool OnMouseDragged(const ui::MouseEvent& event) override; - virtual bool OnMouseWheel(const ui::MouseWheelEvent& event) override; - virtual void OnMouseReleased(const ui::MouseEvent& event) override; - virtual void OnMouseCaptureLost() override; - virtual void OnGestureEvent(ui::GestureEvent* event) override; + gfx::NativeCursor GetCursor(const ui::MouseEvent& event) override; + void OnPaint(gfx::Canvas* canvas) override; + bool OnMousePressed(const ui::MouseEvent& event) override; + bool OnMouseDragged(const ui::MouseEvent& event) override; + bool OnMouseWheel(const ui::MouseWheelEvent& event) override; + void OnMouseReleased(const ui::MouseEvent& event) override; + void OnMouseCaptureLost() override; + void OnGestureEvent(ui::GestureEvent* event) override; bool is_dragging_; gfx::Point start_position_; diff --git a/ash/wm/partial_screenshot_view_unittest.cc b/ash/wm/partial_screenshot_view_unittest.cc index 267ec8c768dc26..6a31968bd8e9fd 100644 --- a/ash/wm/partial_screenshot_view_unittest.cc +++ b/ash/wm/partial_screenshot_view_unittest.cc @@ -21,7 +21,7 @@ class PartialScreenshotViewTest : public test::AshTestBase, public views::WidgetObserver { public: PartialScreenshotViewTest() : view_(NULL) {} - virtual ~PartialScreenshotViewTest() { + ~PartialScreenshotViewTest() override { if (view_) view_->GetWidget()->RemoveObserver(this); } @@ -40,7 +40,7 @@ class PartialScreenshotViewTest : public test::AshTestBase, private: // views::WidgetObserver: - virtual void OnWidgetDestroying(views::Widget* widget) override { + void OnWidgetDestroying(views::Widget* widget) override { if (view_ && view_->GetWidget() == widget) view_ = NULL; widget->RemoveObserver(this); diff --git a/ash/wm/power_button_controller.h b/ash/wm/power_button_controller.h index 05786575340449..e399d83f207984 100644 --- a/ash/wm/power_button_controller.h +++ b/ash/wm/power_button_controller.h @@ -46,7 +46,7 @@ class ASH_EXPORT PowerButtonController : ui::EventHandler { public: explicit PowerButtonController(LockStateController* controller); - virtual ~PowerButtonController(); + ~PowerButtonController() override; void set_has_legacy_power_button_for_test(bool legacy) { has_legacy_power_button_ = legacy; @@ -64,7 +64,7 @@ class ASH_EXPORT PowerButtonController : ui::EventHandler void OnLockButtonEvent(bool down, const base::TimeTicks& timestamp); // ui::EventHandler: - virtual void OnKeyEvent(ui::KeyEvent* event) override; + void OnKeyEvent(ui::KeyEvent* event) override; #if defined(OS_CHROMEOS) // Overriden from ui::DisplayConfigurator::Observer: diff --git a/ash/wm/resize_handle_window_targeter.h b/ash/wm/resize_handle_window_targeter.h index 4b0d0b6059b088..c6b789eabd8863 100644 --- a/ash/wm/resize_handle_window_targeter.h +++ b/ash/wm/resize_handle_window_targeter.h @@ -25,23 +25,20 @@ class ResizeHandleWindowTargeter : public wm::WindowStateObserver, public: ResizeHandleWindowTargeter(aura::Window* window, ImmersiveFullscreenController* immersive); - virtual ~ResizeHandleWindowTargeter(); + ~ResizeHandleWindowTargeter() override; private: // wm::WindowStateObserver: - virtual void OnPostWindowStateTypeChange( - wm::WindowState* window_state, - wm::WindowStateType old_type) override; + void OnPostWindowStateTypeChange(wm::WindowState* window_state, + wm::WindowStateType old_type) override; // aura::WindowObserver: - virtual void OnWindowDestroying(aura::Window* window) override; + void OnWindowDestroying(aura::Window* window) override; // aura::WindowTargeter: - virtual ui::EventTarget* FindTargetForLocatedEvent( - ui::EventTarget* root, - ui::LocatedEvent* event) override; - virtual bool SubtreeShouldBeExploredForEvent( - ui::EventTarget* target, - const ui::LocatedEvent& event) override; + ui::EventTarget* FindTargetForLocatedEvent(ui::EventTarget* root, + ui::LocatedEvent* event) override; + bool SubtreeShouldBeExploredForEvent(ui::EventTarget* target, + const ui::LocatedEvent& event) override; // The targeter does not take ownership of |window_| or // |immersive_controller_|. diff --git a/ash/wm/resize_shadow_and_cursor_unittest.cc b/ash/wm/resize_shadow_and_cursor_unittest.cc index 285cbf9e7e2cd8..e3689b345c6c14 100644 --- a/ash/wm/resize_shadow_and_cursor_unittest.cc +++ b/ash/wm/resize_shadow_and_cursor_unittest.cc @@ -27,19 +27,13 @@ namespace { class TestWidgetDelegate : public views::WidgetDelegateView { public: TestWidgetDelegate() {} - virtual ~TestWidgetDelegate() {} + ~TestWidgetDelegate() override {} // views::WidgetDelegateView overrides: - virtual bool CanResize() const override { - return true; - } - virtual bool CanMaximize() const override { - return true; - } - virtual bool CanMinimize() const override { - return true; - } - virtual views::NonClientFrameView* CreateNonClientFrameView( + bool CanResize() const override { return true; } + bool CanMaximize() const override { return true; } + bool CanMinimize() const override { return true; } + views::NonClientFrameView* CreateNonClientFrameView( views::Widget* widget) override { return new ash::CustomFrameViewAsh(widget); } @@ -55,10 +49,10 @@ class TestWidgetDelegate : public views::WidgetDelegateView { class ResizeShadowAndCursorTest : public AshTestBase { public: ResizeShadowAndCursorTest() {} - virtual ~ResizeShadowAndCursorTest() {} + ~ResizeShadowAndCursorTest() override {} // AshTestBase override: - virtual void SetUp() override { + void SetUp() override { AshTestBase::SetUp(); views::Widget* widget(views::Widget::CreateWindowWithContextAndBounds( diff --git a/ash/wm/resize_shadow_controller.h b/ash/wm/resize_shadow_controller.h index 10c3db855a6f68..04afefef573749 100644 --- a/ash/wm/resize_shadow_controller.h +++ b/ash/wm/resize_shadow_controller.h @@ -25,7 +25,7 @@ class ResizeShadow; class ASH_EXPORT ResizeShadowController : public aura::WindowObserver { public: ResizeShadowController(); - virtual ~ResizeShadowController(); + ~ResizeShadowController() override; // Shows the appropriate shadow for a given |window| and |hit_test| location. void ShowShadow(aura::Window* window, int hit_test); @@ -36,11 +36,10 @@ class ASH_EXPORT ResizeShadowController : public aura::WindowObserver { ResizeShadow* GetShadowForWindowForTest(aura::Window* window); // aura::WindowObserver overrides: - virtual void OnWindowBoundsChanged( - aura::Window* window, - const gfx::Rect& old_bounds, - const gfx::Rect& new_bounds) override; - virtual void OnWindowDestroyed(aura::Window* window) override; + void OnWindowBoundsChanged(aura::Window* window, + const gfx::Rect& old_bounds, + const gfx::Rect& new_bounds) override; + void OnWindowDestroyed(aura::Window* window) override; private: typedef std::map > WindowShadowMap; diff --git a/ash/wm/root_window_layout_manager.h b/ash/wm/root_window_layout_manager.h index a56ad2ad5b82e6..4994469ea5d894 100644 --- a/ash/wm/root_window_layout_manager.h +++ b/ash/wm/root_window_layout_manager.h @@ -31,17 +31,17 @@ namespace ash { class RootWindowLayoutManager : public aura::LayoutManager { public: explicit RootWindowLayoutManager(aura::Window* owner); - virtual ~RootWindowLayoutManager(); + ~RootWindowLayoutManager() override; // Overridden from aura::LayoutManager: - virtual void OnWindowResized() override; - virtual void OnWindowAddedToLayout(aura::Window* child) override; - virtual void OnWillRemoveWindowFromLayout(aura::Window* child) override; - virtual void OnWindowRemovedFromLayout(aura::Window* child) override; - virtual void OnChildWindowVisibilityChanged(aura::Window* child, - bool visible) override; - virtual void SetChildBounds(aura::Window* child, - const gfx::Rect& requested_bounds) override; + void OnWindowResized() override; + void OnWindowAddedToLayout(aura::Window* child) override; + void OnWillRemoveWindowFromLayout(aura::Window* child) override; + void OnWindowRemovedFromLayout(aura::Window* child) override; + void OnChildWindowVisibilityChanged(aura::Window* child, + bool visible) override; + void SetChildBounds(aura::Window* child, + const gfx::Rect& requested_bounds) override; private: aura::Window* owner_; diff --git a/ash/wm/screen_dimmer.h b/ash/wm/screen_dimmer.h index 489b93345beb83..a0b3fa57b8d2d6 100644 --- a/ash/wm/screen_dimmer.h +++ b/ash/wm/screen_dimmer.h @@ -39,15 +39,15 @@ class ASH_EXPORT ScreenDimmer : public aura::WindowObserver { }; explicit ScreenDimmer(aura::Window* root_window); - virtual ~ScreenDimmer(); + ~ScreenDimmer() override; // Dim or undim the root window. void SetDimming(bool should_dim); // aura::WindowObserver overrides: - virtual void OnWindowBoundsChanged(aura::Window* root_window, - const gfx::Rect& old_bounds, - const gfx::Rect& new_bounds) override; + void OnWindowBoundsChanged(aura::Window* root_window, + const gfx::Rect& old_bounds, + const gfx::Rect& new_bounds) override; private: friend class TestApi; diff --git a/ash/wm/screen_dimmer_unittest.cc b/ash/wm/screen_dimmer_unittest.cc index 91ecf4e8869fac..244beecc7057d4 100644 --- a/ash/wm/screen_dimmer_unittest.cc +++ b/ash/wm/screen_dimmer_unittest.cc @@ -18,9 +18,9 @@ namespace test { class ScreenDimmerTest : public AshTestBase { public: ScreenDimmerTest() : dimmer_(NULL) {} - virtual ~ScreenDimmerTest() {} + ~ScreenDimmerTest() override {} - virtual void SetUp() override { + void SetUp() override { AshTestBase::SetUp(); dimmer_ = Shell::GetPrimaryRootWindowController()->screen_dimmer(); test_api_.reset(new ScreenDimmer::TestApi(dimmer_)); diff --git a/ash/wm/session_state_animator_impl.cc b/ash/wm/session_state_animator_impl.cc index 274b5e46d3b1a7..e606953619e1a8 100644 --- a/ash/wm/session_state_animator_impl.cc +++ b/ash/wm/session_state_animator_impl.cc @@ -295,27 +295,23 @@ class CallbackAnimationObserver : public ui::LayerAnimationObserver { explicit CallbackAnimationObserver(base::Closure callback) : callback_(callback) { } - virtual ~CallbackAnimationObserver() { - } + ~CallbackAnimationObserver() override {} private: // Overridden from ui::LayerAnimationObserver: - virtual void OnLayerAnimationEnded(ui::LayerAnimationSequence* seq) - override { + void OnLayerAnimationEnded(ui::LayerAnimationSequence* seq) override { // Drop foreground once animation is over. callback_.Run(); delete this; } - virtual void OnLayerAnimationAborted(ui::LayerAnimationSequence* seq) - override { + void OnLayerAnimationAborted(ui::LayerAnimationSequence* seq) override { // Drop foreground once animation is over. callback_.Run(); delete this; } - virtual void OnLayerAnimationScheduled(ui::LayerAnimationSequence* seq) - override {} + void OnLayerAnimationScheduled(ui::LayerAnimationSequence* seq) override {} base::Closure callback_; @@ -418,36 +414,32 @@ class SessionStateAnimatorImpl::AnimationSequence } // SessionStateAnimator::AnimationSequence: - virtual void StartAnimation( - int container_mask, - SessionStateAnimator::AnimationType type, - SessionStateAnimator::AnimationSpeed speed) override { + void StartAnimation(int container_mask, + SessionStateAnimator::AnimationType type, + SessionStateAnimator::AnimationSpeed speed) override { animator_->StartAnimationInSequence(container_mask, type, speed, this); } private: - virtual ~AnimationSequence() {} + ~AnimationSequence() override {} // ui::LayerAnimationObserver: - virtual void OnLayerAnimationEnded( - ui::LayerAnimationSequence* sequence) override { + void OnLayerAnimationEnded(ui::LayerAnimationSequence* sequence) override { sequences_completed_++; if (sequences_completed_ == sequences_attached_) OnAnimationCompleted(); } - virtual void OnLayerAnimationAborted( - ui::LayerAnimationSequence* sequence) override { + void OnLayerAnimationAborted(ui::LayerAnimationSequence* sequence) override { sequences_completed_++; if (sequences_completed_ == sequences_attached_) OnAnimationAborted(); } - virtual void OnLayerAnimationScheduled( + void OnLayerAnimationScheduled( ui::LayerAnimationSequence* sequence) override {} - virtual void OnAttachedToSequence( - ui::LayerAnimationSequence* sequence) override { + void OnAttachedToSequence(ui::LayerAnimationSequence* sequence) override { LayerAnimationObserver::OnAttachedToSequence(sequence); sequences_attached_++; } diff --git a/ash/wm/session_state_animator_impl.h b/ash/wm/session_state_animator_impl.h index d4792aa942fb53..6c634bddaaae3f 100644 --- a/ash/wm/session_state_animator_impl.h +++ b/ash/wm/session_state_animator_impl.h @@ -43,26 +43,24 @@ class ASH_EXPORT SessionStateAnimatorImpl : public SessionStateAnimator { }; SessionStateAnimatorImpl(); - virtual ~SessionStateAnimatorImpl(); + ~SessionStateAnimatorImpl() override; // Fills |containers| with the containers included in |container_mask|. static void GetContainers(int container_mask, aura::Window::Windows* containers); // ash::SessionStateAnimator: - virtual void StartAnimation(int container_mask, - AnimationType type, - AnimationSpeed speed) override; - virtual void StartAnimationWithCallback( - int container_mask, - AnimationType type, - AnimationSpeed speed, - base::Closure callback) override; - virtual AnimationSequence* BeginAnimationSequence( - base::Closure callback) override; - virtual bool IsBackgroundHidden() const override; - virtual void ShowBackground() override; - virtual void HideBackground() override; + void StartAnimation(int container_mask, + AnimationType type, + AnimationSpeed speed) override; + void StartAnimationWithCallback(int container_mask, + AnimationType type, + AnimationSpeed speed, + base::Closure callback) override; + AnimationSequence* BeginAnimationSequence(base::Closure callback) override; + bool IsBackgroundHidden() const override; + void ShowBackground() override; + void HideBackground() override; private: class AnimationSequence; diff --git a/ash/wm/stacking_controller.h b/ash/wm/stacking_controller.h index 1e4642f03738c9..48ffc9636e0bbc 100644 --- a/ash/wm/stacking_controller.h +++ b/ash/wm/stacking_controller.h @@ -17,12 +17,12 @@ class AlwaysOnTopController; class ASH_EXPORT StackingController : public aura::client::WindowTreeClient { public: StackingController(); - virtual ~StackingController(); + ~StackingController() override; // Overridden from aura::client::WindowTreeClient: - virtual aura::Window* GetDefaultParent(aura::Window* context, - aura::Window* window, - const gfx::Rect& bounds) override; + aura::Window* GetDefaultParent(aura::Window* context, + aura::Window* window, + const gfx::Rect& bounds) override; private: // Returns corresponding system modal container for a modal window. diff --git a/ash/wm/stacking_controller_unittest.cc b/ash/wm/stacking_controller_unittest.cc index c091e03d1f7e24..532aa2faf4452f 100644 --- a/ash/wm/stacking_controller_unittest.cc +++ b/ash/wm/stacking_controller_unittest.cc @@ -19,7 +19,7 @@ namespace ash { class StackingControllerTest : public test::AshTestBase { public: StackingControllerTest() {} - virtual ~StackingControllerTest() {} + ~StackingControllerTest() override {} aura::Window* CreateTestWindow() { aura::Window* window = new aura::Window(NULL); diff --git a/ash/wm/status_area_layout_manager.h b/ash/wm/status_area_layout_manager.h index eabcb5526deff5..23ec8826bccdd8 100644 --- a/ash/wm/status_area_layout_manager.h +++ b/ash/wm/status_area_layout_manager.h @@ -19,12 +19,12 @@ class ShelfWidget; class StatusAreaLayoutManager : public SnapToPixelLayoutManager { public: StatusAreaLayoutManager(aura::Window* container, ShelfWidget* shelf); - virtual ~StatusAreaLayoutManager(); + ~StatusAreaLayoutManager() override; // Overridden from aura::LayoutManager: - virtual void OnWindowResized() override; - virtual void SetChildBounds(aura::Window* child, - const gfx::Rect& requested_bounds) override; + void OnWindowResized() override; + void SetChildBounds(aura::Window* child, + const gfx::Rect& requested_bounds) override; private: // Updates layout of the status area. Effectively calls ShelfLayoutManager diff --git a/ash/wm/system_background_controller.h b/ash/wm/system_background_controller.h index 41e7c98708758d..c695cbdf26ab8e 100644 --- a/ash/wm/system_background_controller.h +++ b/ash/wm/system_background_controller.h @@ -28,14 +28,14 @@ namespace ash { class SystemBackgroundController : public aura::WindowObserver { public: SystemBackgroundController(aura::Window* root_window, SkColor color); - virtual ~SystemBackgroundController(); + ~SystemBackgroundController() override; void SetColor(SkColor color); // aura::WindowObserver overrides: - virtual void OnWindowBoundsChanged(aura::Window* root, - const gfx::Rect& old_bounds, - const gfx::Rect& new_bounds) override; + void OnWindowBoundsChanged(aura::Window* root, + const gfx::Rect& old_bounds, + const gfx::Rect& new_bounds) override; private: class HostContentLayerDelegate; diff --git a/ash/wm/system_gesture_event_filter.h b/ash/wm/system_gesture_event_filter.h index bdde8031e3aa30..421836b53090d7 100644 --- a/ash/wm/system_gesture_event_filter.h +++ b/ash/wm/system_gesture_event_filter.h @@ -21,13 +21,13 @@ class SystemGestureEventFilterTest; class SystemGestureEventFilter : public ui::EventHandler { public: SystemGestureEventFilter(); - virtual ~SystemGestureEventFilter(); + ~SystemGestureEventFilter() override; // Overridden from ui::EventHandler: - virtual void OnMouseEvent(ui::MouseEvent* event) override; - virtual void OnScrollEvent(ui::ScrollEvent* event) override; - virtual void OnTouchEvent(ui::TouchEvent* event) override; - virtual void OnGestureEvent(ui::GestureEvent* event) override; + void OnMouseEvent(ui::MouseEvent* event) override; + void OnScrollEvent(ui::ScrollEvent* event) override; + void OnTouchEvent(ui::TouchEvent* event) override; + void OnGestureEvent(ui::GestureEvent* event) override; private: friend class ash::test::SystemGestureEventFilterTest; diff --git a/ash/wm/system_gesture_event_filter_unittest.cc b/ash/wm/system_gesture_event_filter_unittest.cc index a514d60ff8dc32..58a89f815320da 100644 --- a/ash/wm/system_gesture_event_filter_unittest.cc +++ b/ash/wm/system_gesture_event_filter_unittest.cc @@ -47,13 +47,13 @@ namespace { class ResizableWidgetDelegate : public views::WidgetDelegateView { public: ResizableWidgetDelegate() {} - virtual ~ResizableWidgetDelegate() {} + ~ResizableWidgetDelegate() override {} private: - virtual bool CanResize() const override { return true; } - virtual bool CanMaximize() const override { return true; } - virtual bool CanMinimize() const override { return true; } - virtual void DeleteDelegate() override { delete this; } + bool CanResize() const override { return true; } + bool CanMaximize() const override { return true; } + bool CanMinimize() const override { return true; } + void DeleteDelegate() override { delete this; } DISALLOW_COPY_AND_ASSIGN(ResizableWidgetDelegate); }; @@ -63,14 +63,10 @@ class MaxSizeNCFV : public views::NonClientFrameView { public: MaxSizeNCFV() {} private: - virtual gfx::Size GetMaximumSize() const override { - return gfx::Size(200, 200); - } - virtual gfx::Rect GetBoundsForClientView() const override { - return gfx::Rect(); - }; + gfx::Size GetMaximumSize() const override { return gfx::Size(200, 200); } + gfx::Rect GetBoundsForClientView() const override { return gfx::Rect(); }; - virtual gfx::Rect GetWindowBoundsForClientBounds( + gfx::Rect GetWindowBoundsForClientBounds( const gfx::Rect& client_bounds) const override { return gfx::Rect(); }; @@ -79,15 +75,12 @@ class MaxSizeNCFV : public views::NonClientFrameView { // the parent NonClientView because that makes it more difficult to calculate // hittests for regions that are partially obscured by the ClientView, e.g. // HTSYSMENU. - virtual int NonClientHitTest(const gfx::Point& point) override { - return HTNOWHERE; - } - 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 { return HTNOWHERE; } + void GetWindowMask(const gfx::Size& size, gfx::Path* window_mask) override {} + void ResetWindowControls() override {} + void UpdateWindowIcon() override {} + void UpdateWindowTitle() override {} + void SizeConstraintsChanged() override {} DISALLOW_COPY_AND_ASSIGN(MaxSizeNCFV); }; @@ -95,14 +88,14 @@ class MaxSizeNCFV : public views::NonClientFrameView { class MaxSizeWidgetDelegate : public views::WidgetDelegateView { public: MaxSizeWidgetDelegate() {} - virtual ~MaxSizeWidgetDelegate() {} + ~MaxSizeWidgetDelegate() override {} private: - virtual bool CanResize() const override { return true; } - virtual bool CanMaximize() const override { return false; } - virtual bool CanMinimize() const override { return true; } - virtual void DeleteDelegate() override { delete this; } - virtual views::NonClientFrameView* CreateNonClientFrameView( + bool CanResize() const override { return true; } + bool CanMaximize() const override { return false; } + bool CanMinimize() const override { return true; } + void DeleteDelegate() override { delete this; } + views::NonClientFrameView* CreateNonClientFrameView( views::Widget* widget) override { return new MaxSizeNCFV; } @@ -115,7 +108,7 @@ class MaxSizeWidgetDelegate : public views::WidgetDelegateView { class SystemGestureEventFilterTest : public AshTestBase { public: SystemGestureEventFilterTest() : AshTestBase() {} - virtual ~SystemGestureEventFilterTest() {} + ~SystemGestureEventFilterTest() override {} LongPressAffordanceHandler* GetLongPressAffordance() { ShellTestApi shell_test(Shell::GetInstance()); @@ -138,7 +131,7 @@ class SystemGestureEventFilterTest : public AshTestBase { } // Overridden from AshTestBase: - virtual void SetUp() override { + void SetUp() override { // TODO(jonross): TwoFingerDragDelayed() and ThreeFingerGestureStopsDrag() // both use hardcoded touch points, assuming that they target empty header // space. Window control order now reflects configuration files and can diff --git a/ash/wm/system_modal_container_event_filter.h b/ash/wm/system_modal_container_event_filter.h index a221844394a92d..6be8f052674f02 100644 --- a/ash/wm/system_modal_container_event_filter.h +++ b/ash/wm/system_modal_container_event_filter.h @@ -18,11 +18,11 @@ class ASH_EXPORT SystemModalContainerEventFilter : public ui::EventHandler { public: explicit SystemModalContainerEventFilter( SystemModalContainerEventFilterDelegate* delegate); - virtual ~SystemModalContainerEventFilter(); + ~SystemModalContainerEventFilter() override; // Overridden from ui::EventHandler: - virtual void OnKeyEvent(ui::KeyEvent* event) override; - virtual void OnMouseEvent(ui::MouseEvent* event) override; + void OnKeyEvent(ui::KeyEvent* event) override; + void OnMouseEvent(ui::MouseEvent* event) override; private: SystemModalContainerEventFilterDelegate* delegate_; diff --git a/ash/wm/system_modal_container_layout_manager.h b/ash/wm/system_modal_container_layout_manager.h index e877da3c9dc535..59c0eac8922318 100644 --- a/ash/wm/system_modal_container_layout_manager.h +++ b/ash/wm/system_modal_container_layout_manager.h @@ -37,25 +37,25 @@ class ASH_EXPORT SystemModalContainerLayoutManager public keyboard::KeyboardControllerObserver { public: explicit SystemModalContainerLayoutManager(aura::Window* container); - virtual ~SystemModalContainerLayoutManager(); + ~SystemModalContainerLayoutManager() override; bool has_modal_background() const { return modal_background_ != NULL; } // Overridden from SnapToPixelLayoutManager: - virtual void OnWindowResized() override; - virtual void OnWindowAddedToLayout(aura::Window* child) override; - virtual void OnWillRemoveWindowFromLayout(aura::Window* child) override; - virtual void SetChildBounds(aura::Window* child, - const gfx::Rect& requested_bounds) override; + void OnWindowResized() override; + void OnWindowAddedToLayout(aura::Window* child) override; + void OnWillRemoveWindowFromLayout(aura::Window* child) override; + void SetChildBounds(aura::Window* child, + const gfx::Rect& requested_bounds) override; // Overridden from aura::WindowObserver: - virtual void OnWindowPropertyChanged(aura::Window* window, - const void* key, - intptr_t old) override; - virtual void OnWindowDestroying(aura::Window* window) override; + void OnWindowPropertyChanged(aura::Window* window, + const void* key, + intptr_t old) override; + void OnWindowDestroying(aura::Window* window) override; // Overridden from keyboard::KeyboardControllerObserver: - virtual void OnKeyboardBoundsChanging(const gfx::Rect& new_bounds) override; + void OnKeyboardBoundsChanging(const gfx::Rect& new_bounds) override; // Can a given |window| receive and handle input events? bool CanWindowReceiveEvents(aura::Window* window); diff --git a/ash/wm/system_modal_container_layout_manager_unittest.cc b/ash/wm/system_modal_container_layout_manager_unittest.cc index 541242f9879c20..de284d151f0875 100644 --- a/ash/wm/system_modal_container_layout_manager_unittest.cc +++ b/ash/wm/system_modal_container_layout_manager_unittest.cc @@ -64,7 +64,7 @@ bool AllRootWindowsHaveModalBackgrounds() { class TestWindow : public views::WidgetDelegateView { public: explicit TestWindow(bool modal) : modal_(modal) {} - virtual ~TestWindow() {} + ~TestWindow() override {} // The window needs be closed from widget in order for // aura::client::kModalKey property to be reset. @@ -73,15 +73,11 @@ class TestWindow : public views::WidgetDelegateView { } // Overridden from views::View: - virtual gfx::Size GetPreferredSize() const override { - return gfx::Size(50, 50); - } + gfx::Size GetPreferredSize() const override { return gfx::Size(50, 50); } // Overridden from views::WidgetDelegate: - virtual views::View* GetContentsView() override { - return this; - } - virtual ui::ModalType GetModalType() const override { + views::View* GetContentsView() override { return this; } + ui::ModalType GetModalType() const override { return modal_ ? ui::MODAL_TYPE_SYSTEM : ui::MODAL_TYPE_NONE; } @@ -95,7 +91,7 @@ class EventTestWindow : public TestWindow { public: explicit EventTestWindow(bool modal) : TestWindow(modal), mouse_presses_(0) {} - virtual ~EventTestWindow() {} + ~EventTestWindow() override {} aura::Window* OpenTestWindowWithContext(aura::Window* context) { views::Widget* widget = @@ -113,7 +109,7 @@ class EventTestWindow : public TestWindow { } // Overridden from views::View: - virtual bool OnMousePressed(const ui::MouseEvent& event) override { + bool OnMousePressed(const ui::MouseEvent& event) override { mouse_presses_++; return false; } @@ -128,14 +124,12 @@ class EventTestWindow : public TestWindow { class TransientWindowObserver : public aura::WindowObserver { public: TransientWindowObserver() : destroyed_(false) {} - virtual ~TransientWindowObserver() {} + ~TransientWindowObserver() override {} bool destroyed() const { return destroyed_; } // Overridden from aura::WindowObserver: - virtual void OnWindowDestroyed(aura::Window* window) override { - destroyed_ = true; - } + void OnWindowDestroyed(aura::Window* window) override { destroyed_ = true; } private: bool destroyed_; @@ -147,7 +141,7 @@ class TransientWindowObserver : public aura::WindowObserver { class SystemModalContainerLayoutManagerTest : public AshTestBase { public: - virtual void SetUp() override { + void SetUp() override { // Allow a virtual keyboard (and initialize it per default). CommandLine::ForCurrentProcess()->AppendSwitch( keyboard::switches::kEnableVirtualKeyboard); @@ -156,7 +150,7 @@ class SystemModalContainerLayoutManagerTest : public AshTestBase { keyboard::KeyboardController::GetInstance()); } - virtual void TearDown() override { + void TearDown() override { Shell::GetPrimaryRootWindowController()->DeactivateKeyboard( keyboard::KeyboardController::GetInstance()); AshTestBase::TearDown(); diff --git a/ash/wm/toplevel_window_event_handler.cc b/ash/wm/toplevel_window_event_handler.cc index 22a3e07d541a1a..610261f9f78b21 100644 --- a/ash/wm/toplevel_window_event_handler.cc +++ b/ash/wm/toplevel_window_event_handler.cc @@ -92,7 +92,7 @@ class ToplevelWindowEventHandler::ScopedWindowResizer public: ScopedWindowResizer(ToplevelWindowEventHandler* handler, WindowResizer* resizer); - virtual ~ScopedWindowResizer(); + ~ScopedWindowResizer() override; // Returns true if the drag moves the window and does not resize. bool IsMove() const; @@ -100,11 +100,11 @@ class ToplevelWindowEventHandler::ScopedWindowResizer WindowResizer* resizer() { return resizer_.get(); } // WindowObserver overrides: - virtual void OnWindowDestroying(aura::Window* window) override; + void OnWindowDestroying(aura::Window* window) override; // WindowStateObserver overrides: - virtual void OnPreWindowStateTypeChange(wm::WindowState* window_state, - wm::WindowStateType type) override; + void OnPreWindowStateTypeChange(wm::WindowState* window_state, + wm::WindowStateType type) override; private: ToplevelWindowEventHandler* handler_; diff --git a/ash/wm/toplevel_window_event_handler.h b/ash/wm/toplevel_window_event_handler.h index 4e6dc1b8e0a04f..ce744a9ca77df4 100644 --- a/ash/wm/toplevel_window_event_handler.h +++ b/ash/wm/toplevel_window_event_handler.h @@ -36,22 +36,22 @@ class ASH_EXPORT ToplevelWindowEventHandler public DisplayController::Observer { public: ToplevelWindowEventHandler(); - virtual ~ToplevelWindowEventHandler(); + ~ToplevelWindowEventHandler() override; // Overridden from ui::EventHandler: - virtual void OnKeyEvent(ui::KeyEvent* event) override; - virtual void OnMouseEvent(ui::MouseEvent* event) override; - virtual void OnGestureEvent(ui::GestureEvent* event) override; + void OnKeyEvent(ui::KeyEvent* event) override; + void OnMouseEvent(ui::MouseEvent* event) override; + void OnGestureEvent(ui::GestureEvent* event) override; // Overridden form aura::client::WindowMoveClient: - virtual aura::client::WindowMoveResult RunMoveLoop( + aura::client::WindowMoveResult RunMoveLoop( aura::Window* source, const gfx::Vector2d& drag_offset, aura::client::WindowMoveSource move_source) override; - virtual void EndMoveLoop() override; + void EndMoveLoop() override; // Overridden form ash::DisplayController::Observer: - virtual void OnDisplayConfigurationChanging() override; + void OnDisplayConfigurationChanging() override; private: class ScopedWindowResizer; diff --git a/ash/wm/toplevel_window_event_handler_unittest.cc b/ash/wm/toplevel_window_event_handler_unittest.cc index db35b9a1327bb7..c576024b2b513b 100644 --- a/ash/wm/toplevel_window_event_handler_unittest.cc +++ b/ash/wm/toplevel_window_event_handler_unittest.cc @@ -47,13 +47,11 @@ class TestWindowDelegate : public aura::test::TestWindowDelegate { explicit TestWindowDelegate(int hittest_code) { set_window_component(hittest_code); } - virtual ~TestWindowDelegate() {} + ~TestWindowDelegate() override {} private: // Overridden from aura::Test::TestWindowDelegate: - virtual void OnWindowDestroyed(aura::Window* window) override { - delete this; - } + void OnWindowDestroyed(aura::Window* window) override { delete this; } DISALLOW_COPY_AND_ASSIGN(TestWindowDelegate); }; @@ -61,7 +59,7 @@ class TestWindowDelegate : public aura::test::TestWindowDelegate { class ToplevelWindowEventHandlerTest : public AshTestBase { public: ToplevelWindowEventHandlerTest() {} - virtual ~ToplevelWindowEventHandlerTest() {} + ~ToplevelWindowEventHandlerTest() override {} protected: aura::Window* CreateWindow(int hittest_code) { diff --git a/ash/wm/video_detector.h b/ash/wm/video_detector.h index 41139df20e0472..0735b09d6d4da5 100644 --- a/ash/wm/video_detector.h +++ b/ash/wm/video_detector.h @@ -58,7 +58,7 @@ class ASH_EXPORT VideoDetector : public aura::EnvObserver, static const double kNotifyIntervalSec; VideoDetector(); - virtual ~VideoDetector(); + ~VideoDetector() override; void set_now_for_test(base::TimeTicks now) { now_for_test_ = now; } @@ -66,15 +66,15 @@ class ASH_EXPORT VideoDetector : public aura::EnvObserver, void RemoveObserver(VideoDetectorObserver* observer); // EnvObserver overrides. - virtual void OnWindowInitialized(aura::Window* window) override; + void OnWindowInitialized(aura::Window* window) override; // WindowObserver overrides. - virtual void OnDelegatedFrameDamage(aura::Window* window, - const gfx::Rect& region) override; - virtual void OnWindowDestroyed(aura::Window* window) override; + void OnDelegatedFrameDamage(aura::Window* window, + const gfx::Rect& region) override; + void OnWindowDestroyed(aura::Window* window) override; // ShellObserver overrides. - virtual void OnAppTerminating() override; + void OnAppTerminating() override; private: class WindowInfo; diff --git a/ash/wm/video_detector_unittest.cc b/ash/wm/video_detector_unittest.cc index d2443da6665293..d431c2c146d9b0 100644 --- a/ash/wm/video_detector_unittest.cc +++ b/ash/wm/video_detector_unittest.cc @@ -40,7 +40,7 @@ class TestVideoDetectorObserver : public VideoDetectorObserver { } // VideoDetectorObserver implementation. - virtual void OnVideoDetected(bool is_fullscreen) override { + void OnVideoDetected(bool is_fullscreen) override { num_invocations_++; if (is_fullscreen) num_fullscreens_++; @@ -64,9 +64,9 @@ class TestVideoDetectorObserver : public VideoDetectorObserver { class VideoDetectorTest : public AshTestBase { public: VideoDetectorTest() {} - virtual ~VideoDetectorTest() {} + ~VideoDetectorTest() override {} - virtual void SetUp() override { + void SetUp() override { AshTestBase::SetUp(); observer_.reset(new TestVideoDetectorObserver); detector_ = Shell::GetInstance()->video_detector(); @@ -76,7 +76,7 @@ class VideoDetectorTest : public AshTestBase { detector_->set_now_for_test(now_); } - virtual void TearDown() override { + void TearDown() override { detector_->RemoveObserver(observer_.get()); AshTestBase::TearDown(); } diff --git a/ash/wm/virtual_keyboard_container_layout_manager.h b/ash/wm/virtual_keyboard_container_layout_manager.h index 1f90f7381bb49e..13fda64dc8ffda 100644 --- a/ash/wm/virtual_keyboard_container_layout_manager.h +++ b/ash/wm/virtual_keyboard_container_layout_manager.h @@ -17,10 +17,10 @@ namespace ash { class VirtualKeyboardContainerLayoutManager : public SnapToPixelLayoutManager { public: explicit VirtualKeyboardContainerLayoutManager(aura::Window* container); - virtual ~VirtualKeyboardContainerLayoutManager(); + ~VirtualKeyboardContainerLayoutManager() override; // Overridden from SnapToPixelLayoutManager: - virtual void OnWindowResized() override; + void OnWindowResized() override; private: aura::Window* parent_container_; diff --git a/ash/wm/window_animations.cc b/ash/wm/window_animations.cc index 5bc71cd818fcba..c1c5c68605d541 100644 --- a/ash/wm/window_animations.cc +++ b/ash/wm/window_animations.cc @@ -277,42 +277,35 @@ class CrossFadeObserver : public ui::CompositorObserver, window_->AddObserver(this); layer_owner_->root()->GetCompositor()->AddObserver(this); } - virtual ~CrossFadeObserver() { + ~CrossFadeObserver() override { window_->RemoveObserver(this); window_ = NULL; layer_owner_->root()->GetCompositor()->RemoveObserver(this); } // ui::CompositorObserver overrides: - virtual void OnCompositingDidCommit(ui::Compositor* compositor) override { - } - virtual void OnCompositingStarted(ui::Compositor* compositor, - base::TimeTicks start_time) override { - } - virtual void OnCompositingEnded(ui::Compositor* compositor) override { - } - virtual void OnCompositingAborted(ui::Compositor* compositor) override { + void OnCompositingDidCommit(ui::Compositor* compositor) override {} + void OnCompositingStarted(ui::Compositor* compositor, + base::TimeTicks start_time) override {} + void OnCompositingEnded(ui::Compositor* compositor) override {} + void OnCompositingAborted(ui::Compositor* compositor) override { // Triggers OnImplicitAnimationsCompleted() to be called and deletes us. layer_owner_->root()->GetAnimator()->StopAnimating(); } - virtual void OnCompositingLockStateChanged( - ui::Compositor* compositor) override { - } + void OnCompositingLockStateChanged(ui::Compositor* compositor) override {} // aura::WindowObserver overrides: - virtual void OnWindowDestroying(aura::Window* window) override { + void OnWindowDestroying(aura::Window* window) override { // Triggers OnImplicitAnimationsCompleted() to be called and deletes us. layer_owner_->root()->GetAnimator()->StopAnimating(); } - virtual void OnWindowRemovingFromRootWindow(aura::Window* window, - aura::Window* new_root) override { + void OnWindowRemovingFromRootWindow(aura::Window* window, + aura::Window* new_root) override { layer_owner_->root()->GetAnimator()->StopAnimating(); } // ui::ImplicitAnimationObserver overrides: - virtual void OnImplicitAnimationsCompleted() override { - delete this; - } + void OnImplicitAnimationsCompleted() override { delete this; } private: aura::Window* window_; // not owned diff --git a/ash/wm/window_animations_unittest.cc b/ash/wm/window_animations_unittest.cc index 575e9e25f03d40..d1c2d924e104a4 100644 --- a/ash/wm/window_animations_unittest.cc +++ b/ash/wm/window_animations_unittest.cc @@ -25,9 +25,7 @@ class WindowAnimationsTest : public ash::test::AshTestBase { public: WindowAnimationsTest() {} - virtual void TearDown() override { - AshTestBase::TearDown(); - } + void TearDown() override { AshTestBase::TearDown(); } private: DISALLOW_COPY_AND_ASSIGN(WindowAnimationsTest); @@ -47,15 +45,13 @@ class MinimizeAnimationObserver : public ui::LayerAnimationObserver { protected: // ui::LayerAnimationObserver: - virtual void OnLayerAnimationScheduled( + void OnLayerAnimationScheduled( ui::LayerAnimationSequence* sequence) override { duration_ = animator_->GetTransitionDuration(); animator_->RemoveObserver(this); } - virtual void OnLayerAnimationEnded( - ui::LayerAnimationSequence* sequence) override {} - virtual void OnLayerAnimationAborted( - ui::LayerAnimationSequence* sequence) override {} + void OnLayerAnimationEnded(ui::LayerAnimationSequence* sequence) override {} + void OnLayerAnimationAborted(ui::LayerAnimationSequence* sequence) override {} private: ui::LayerAnimator* animator_; diff --git a/ash/wm/window_cycle_controller.cc b/ash/wm/window_cycle_controller.cc index 412d275520fc03..42f866e38e0ab1 100644 --- a/ash/wm/window_cycle_controller.cc +++ b/ash/wm/window_cycle_controller.cc @@ -21,10 +21,10 @@ namespace { class WindowCycleEventFilter : public ui::EventHandler { public: WindowCycleEventFilter(); - virtual ~WindowCycleEventFilter(); + ~WindowCycleEventFilter() override; // Overridden from ui::EventHandler: - virtual void OnKeyEvent(ui::KeyEvent* event) override; + void OnKeyEvent(ui::KeyEvent* event) override; private: DISALLOW_COPY_AND_ASSIGN(WindowCycleEventFilter); diff --git a/ash/wm/window_cycle_controller_unittest.cc b/ash/wm/window_cycle_controller_unittest.cc index 59618dbe87bf8a..ec34f7a712f290 100644 --- a/ash/wm/window_cycle_controller_unittest.cc +++ b/ash/wm/window_cycle_controller_unittest.cc @@ -38,9 +38,9 @@ using aura::Window; class WindowCycleControllerTest : public test::AshTestBase { public: WindowCycleControllerTest() {} - virtual ~WindowCycleControllerTest() {} + ~WindowCycleControllerTest() override {} - virtual void SetUp() override { + void SetUp() override { test::AshTestBase::SetUp(); ASSERT_TRUE(test::TestShelfDelegate::instance()); diff --git a/ash/wm/window_cycle_list.cc b/ash/wm/window_cycle_list.cc index d8f74180fd2b3b..f442001ced328a 100644 --- a/ash/wm/window_cycle_list.cc +++ b/ash/wm/window_cycle_list.cc @@ -32,7 +32,7 @@ aura::Window* GetWindowBelow(aura::Window* window) { class ScopedShowWindow : public aura::WindowObserver { public: ScopedShowWindow(); - virtual ~ScopedShowWindow(); + ~ScopedShowWindow() override; // Show |window| at the top of the stacking order. void Show(aura::Window* window); @@ -43,7 +43,7 @@ class ScopedShowWindow : public aura::WindowObserver { aura::Window* window() { return window_; } // aura::WindowObserver: - virtual void OnWillRemoveWindow(aura::Window* window) override; + void OnWillRemoveWindow(aura::Window* window) override; private: // The window being shown. diff --git a/ash/wm/window_cycle_list.h b/ash/wm/window_cycle_list.h index 5363b4415fb773..8c8b33cc9ca963 100644 --- a/ash/wm/window_cycle_list.h +++ b/ash/wm/window_cycle_list.h @@ -25,7 +25,7 @@ class ASH_EXPORT WindowCycleList : public aura::WindowObserver { typedef std::vector WindowList; explicit WindowCycleList(const WindowList& windows); - virtual ~WindowCycleList(); + ~WindowCycleList() override; bool empty() const { return windows_.empty(); } @@ -39,7 +39,7 @@ class ASH_EXPORT WindowCycleList : public aura::WindowObserver { // There is a chance a window is destroyed, for example by JS code. We need to // take care of that even if it is not intended for the user to close a window // while window cycling. - virtual void OnWindowDestroyed(aura::Window* window) override; + void OnWindowDestroyed(aura::Window* window) override; // List of weak pointers to windows to use while cycling with the keyboard. // List is built when the user initiates the gesture (i.e. hits alt-tab the diff --git a/ash/wm/window_manager_unittest.cc b/ash/wm/window_manager_unittest.cc index bd5ec05f65f728..6a51a0f990976d 100644 --- a/ash/wm/window_manager_unittest.cc +++ b/ash/wm/window_manager_unittest.cc @@ -39,7 +39,7 @@ class TestingCursorClientObserver : public aura::client::CursorClientObserver { bool did_visibility_change() const { return did_visibility_change_; } // Overridden from aura::client::CursorClientObserver: - virtual void OnCursorVisibilityChanged(bool is_visible) override { + void OnCursorVisibilityChanged(bool is_visible) override { cursor_visibility_ = is_visible; did_visibility_change_ = true; } @@ -64,7 +64,7 @@ class CustomEventHandler : public ui::test::TestEventHandler { mouse_result_(ui::ER_UNHANDLED) { } - virtual ~CustomEventHandler() {} + ~CustomEventHandler() override {} void set_key_event_handling_result(ui::EventResult result) { key_result_ = result; @@ -75,7 +75,7 @@ class CustomEventHandler : public ui::test::TestEventHandler { } // Overridden from ui::EventHandler: - virtual void OnKeyEvent(ui::KeyEvent* event) override { + void OnKeyEvent(ui::KeyEvent* event) override { ui::test::TestEventHandler::OnKeyEvent(event); if (key_result_ & ui::ER_HANDLED) event->SetHandled(); @@ -83,7 +83,7 @@ class CustomEventHandler : public ui::test::TestEventHandler { event->StopPropagation(); } - virtual void OnMouseEvent(ui::MouseEvent* event) override { + void OnMouseEvent(ui::MouseEvent* event) override { ui::test::TestEventHandler::OnMouseEvent(event); if (mouse_result_ & ui::ER_HANDLED) event->SetHandled(); @@ -109,9 +109,7 @@ class NonFocusableDelegate : public aura::test::TestWindowDelegate { NonFocusableDelegate() {} private: - virtual bool CanFocus() override { - return false; - } + bool CanFocus() override { return false; } DISALLOW_COPY_AND_ASSIGN(NonFocusableDelegate); }; @@ -121,12 +119,12 @@ class HitTestWindowDelegate : public aura::test::TestWindowDelegate { HitTestWindowDelegate() : hittest_code_(HTNOWHERE) { } - virtual ~HitTestWindowDelegate() {} + ~HitTestWindowDelegate() override {} void set_hittest_code(int hittest_code) { hittest_code_ = hittest_code; } private: // Overridden from TestWindowDelegate: - virtual int GetNonClientComponent(const gfx::Point& point) const override { + int GetNonClientComponent(const gfx::Point& point) const override { return hittest_code_; } diff --git a/ash/wm/window_modality_controller_unittest.cc b/ash/wm/window_modality_controller_unittest.cc index f4b96629438e31..765d12d7e69ae9 100644 --- a/ash/wm/window_modality_controller_unittest.cc +++ b/ash/wm/window_modality_controller_unittest.cc @@ -315,7 +315,7 @@ class TouchTrackerWindowDelegate : public aura::test::TestWindowDelegate { : received_touch_(false), last_event_type_(ui::ET_UNKNOWN) { } - virtual ~TouchTrackerWindowDelegate() {} + ~TouchTrackerWindowDelegate() override {} void reset() { received_touch_ = false; @@ -327,7 +327,7 @@ class TouchTrackerWindowDelegate : public aura::test::TestWindowDelegate { private: // Overridden from aura::test::TestWindowDelegate. - virtual void OnTouchEvent(ui::TouchEvent* event) override { + void OnTouchEvent(ui::TouchEvent* event) override { received_touch_ = true; last_event_type_ = event->type(); aura::test::TestWindowDelegate::OnTouchEvent(event); diff --git a/ash/wm/window_positioner_unittest.cc b/ash/wm/window_positioner_unittest.cc index d6d0a8d435d59f..af320bc209fe4b 100644 --- a/ash/wm/window_positioner_unittest.cc +++ b/ash/wm/window_positioner_unittest.cc @@ -106,22 +106,15 @@ namespace { class OutOfDisplayDelegate : public views::WidgetDelegate { public: explicit OutOfDisplayDelegate(views::Widget* widget) : widget_(widget) {} - virtual ~OutOfDisplayDelegate() {} + ~OutOfDisplayDelegate() override {} // Overridden from WidgetDelegate: - virtual void DeleteDelegate() override { - delete this; - } - virtual views::Widget* GetWidget() override { - return widget_; - } - virtual const views::Widget* GetWidget() const override { - return widget_; - } - virtual bool GetSavedWindowPlacement( - const views::Widget* widget, - gfx::Rect* bounds, - ui::WindowShowState* show_state) const override { + void DeleteDelegate() override { delete this; } + views::Widget* GetWidget() override { return widget_; } + const views::Widget* GetWidget() const override { return widget_; } + bool GetSavedWindowPlacement(const views::Widget* widget, + gfx::Rect* bounds, + ui::WindowShowState* show_state) const override { bounds->SetRect(450, 10, 100, 100); *show_state = ui::SHOW_STATE_NORMAL; return true; diff --git a/ash/wm/window_state.cc b/ash/wm/window_state.cc index 1b962d1c010efc..ffe25f3c7f1e88 100644 --- a/ash/wm/window_state.cc +++ b/ash/wm/window_state.cc @@ -38,17 +38,17 @@ namespace { class BoundsSetter : public aura::LayoutManager { public: BoundsSetter() {} - virtual ~BoundsSetter() {} + ~BoundsSetter() override {} // aura::LayoutManager overrides: - virtual void OnWindowResized() override {} - virtual void OnWindowAddedToLayout(aura::Window* child) override {} - virtual void OnWillRemoveWindowFromLayout(aura::Window* child) override {} - virtual void OnWindowRemovedFromLayout(aura::Window* child) override {} - virtual void OnChildWindowVisibilityChanged( - aura::Window* child, bool visible) override {} - virtual void SetChildBounds( - aura::Window* child, const gfx::Rect& requested_bounds) override {} + void OnWindowResized() override {} + void OnWindowAddedToLayout(aura::Window* child) override {} + void OnWillRemoveWindowFromLayout(aura::Window* child) override {} + void OnWindowRemovedFromLayout(aura::Window* child) override {} + void OnChildWindowVisibilityChanged(aura::Window* child, + bool visible) override {} + void SetChildBounds(aura::Window* child, + const gfx::Rect& requested_bounds) override {} void SetBounds(aura::Window* window, const gfx::Rect& bounds) { SetChildBoundsDirect(window, bounds); diff --git a/ash/wm/window_state.h b/ash/wm/window_state.h index a76555795790f6..cc4627377688ca 100644 --- a/ash/wm/window_state.h +++ b/ash/wm/window_state.h @@ -79,7 +79,7 @@ class ASH_EXPORT WindowState : public aura::WindowObserver { }; // Call GetWindowState() to instantiate this class. - virtual ~WindowState(); + ~WindowState() override; aura::Window* window() { return window_; } const aura::Window* window() const { return window_; } @@ -298,9 +298,9 @@ class ASH_EXPORT WindowState : public aura::WindowObserver { DragDetails* drag_details() { return drag_details_.get(); } // aura::WindowObserver overrides: - virtual void OnWindowPropertyChanged(aura::Window* window, - const void* key, - intptr_t old) override; + void OnWindowPropertyChanged(aura::Window* window, + const void* key, + intptr_t old) override; private: friend class DefaultState; diff --git a/ash/wm/window_state_unittest.cc b/ash/wm/window_state_unittest.cc index 79f765a679bb4e..d816cf7d11ba78 100644 --- a/ash/wm/window_state_unittest.cc +++ b/ash/wm/window_state_unittest.cc @@ -21,26 +21,22 @@ class AlwaysMaximizeTestState : public WindowState::State { public: explicit AlwaysMaximizeTestState(WindowStateType initial_state_type) : state_type_(initial_state_type) {} - virtual ~AlwaysMaximizeTestState() {} + ~AlwaysMaximizeTestState() override {} // WindowState::State overrides: - virtual void OnWMEvent(WindowState* window_state, - const WMEvent* event) override { + void OnWMEvent(WindowState* window_state, const WMEvent* event) override { // We don't do anything here. } - virtual WindowStateType GetType() const override { - return state_type_; - } - virtual void AttachState( - WindowState* window_state, - WindowState::State* previous_state) override { + WindowStateType GetType() const override { return state_type_; } + void AttachState(WindowState* window_state, + WindowState::State* previous_state) override { // We always maximize. if (state_type_ != WINDOW_STATE_TYPE_MAXIMIZED) { window_state->Maximize(); state_type_ = WINDOW_STATE_TYPE_MAXIMIZED; } } - virtual void DetachState(WindowState* window_state) override {} + void DetachState(WindowState* window_state) override {} private: WindowStateType state_type_; diff --git a/ash/wm/wm_event.h b/ash/wm/wm_event.h index ad64a21196a8ae..bcb00e3c880a64 100644 --- a/ash/wm/wm_event.h +++ b/ash/wm/wm_event.h @@ -105,7 +105,7 @@ class ASH_EXPORT WMEvent { class SetBoundsEvent : public WMEvent { public: SetBoundsEvent(WMEventType type, const gfx::Rect& requested_bounds); - virtual ~SetBoundsEvent(); + ~SetBoundsEvent() override; const gfx::Rect& requested_bounds() const { return requested_bounds_; } diff --git a/ash/wm/workspace_controller_unittest.cc b/ash/wm/workspace_controller_unittest.cc index aa4cee7dd34186..df1de84d561721 100644 --- a/ash/wm/workspace_controller_unittest.cc +++ b/ash/wm/workspace_controller_unittest.cc @@ -82,7 +82,7 @@ std::string GetLayerNames(const aura::Window* window) { class WorkspaceControllerTest : public test::AshTestBase { public: WorkspaceControllerTest() {} - virtual ~WorkspaceControllerTest() {} + ~WorkspaceControllerTest() override {} aura::Window* CreateTestWindowUnparented() { aura::Window* window = new aura::Window(NULL); @@ -646,8 +646,8 @@ class DontCrashOnChangeAndActivateDelegate void set_window(aura::Window* window) { window_ = window; } // WindowDelegate overrides: - virtual void OnBoundsChanged(const gfx::Rect& old_bounds, - const gfx::Rect& new_bounds) override { + void OnBoundsChanged(const gfx::Rect& old_bounds, + const gfx::Rect& new_bounds) override { if (window_) { wm::ActivateWindow(window_); window_ = NULL; @@ -1329,8 +1329,7 @@ class DragMaximizedNonTrackedWindowObserver // aura::WindowObserver overrides: // Counts number of times a window is reparented. Ignores reparenting into and // from a docked container which is expected when a tab is dragged. - virtual void OnWindowHierarchyChanged( - const HierarchyChangeParams& params) override { + void OnWindowHierarchyChanged(const HierarchyChangeParams& params) override { if (params.target != window_ || (params.old_parent->id() == kShellWindowId_DefaultContainer && params.new_parent->id() == kShellWindowId_DockedContainer) || @@ -1376,7 +1375,7 @@ namespace { class WorkspaceControllerTestDragging : public WorkspaceControllerTest { public: WorkspaceControllerTestDragging() {} - virtual ~WorkspaceControllerTestDragging() {} + ~WorkspaceControllerTestDragging() override {} private: DISALLOW_COPY_AND_ASSIGN(WorkspaceControllerTestDragging);