Skip to content

Commit

Permalink
Standardize usage of virtual/override/final specifiers.
Browse files Browse the repository at this point in the history
The Google C++ style guide states:

  Explicitly annotate overrides of virtual functions or virtual
  destructors with an override or (less frequently) final specifier.
  Older (pre-C++11) code will use the virtual keyword as an inferior
  alternative annotation. For clarity, use exactly one of override,
  final, or virtual when declaring an override.

To better conform to these guidelines, the following constructs have
been rewritten:

- if a base class has a virtual destructor, then:
    virtual ~Foo();                   ->  ~Foo() override;
- virtual void Foo() override;        ->  void Foo() override;
- virtual void Foo() override final;  ->  void Foo() final;

This patch was automatically generated. The clang plugin can generate
fixit hints, which are suggested edits when it is 100% sure it knows how
to fix a problem. The hints from the clang plugin were applied to the
source tree using the tool in https://codereview.chromium.org/598073004.

BUG=417463
R=flackr@chromium.org

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

Cr-Commit-Position: refs/heads/master@{#301541}
  • Loading branch information
zetafunction authored and Commit bot committed Oct 28, 2014
1 parent 07d12f7 commit 28401c2
Show file tree
Hide file tree
Showing 73 changed files with 427 additions and 515 deletions.
14 changes: 7 additions & 7 deletions ash/wm/always_on_top_controller.h
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -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_;

Expand Down
34 changes: 17 additions & 17 deletions ash/wm/app_list_controller.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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_;
Expand Down
2 changes: 1 addition & 1 deletion ash/wm/app_list_controller_unittest.cc
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ class AppListControllerTest : public test::AshTestBase,
public:
AppListControllerTest();
virtual ~AppListControllerTest();
virtual void SetUp() override;
void SetUp() override;

bool IsCentered() const;
};
Expand Down
11 changes: 5 additions & 6 deletions ash/wm/ash_focus_rules.h
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
24 changes: 10 additions & 14 deletions ash/wm/ash_native_cursor_manager.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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;

Expand Down
4 changes: 2 additions & 2 deletions ash/wm/ash_native_cursor_manager_interactive_uitest.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down
4 changes: 2 additions & 2 deletions ash/wm/ash_native_cursor_manager_unittest.cc
Original file line number Diff line number Diff line change
Expand Up @@ -36,15 +36,15 @@ namespace {
class MouseEventLocationDelegate : public aura::test::TestWindowDelegate {
public:
MouseEventLocationDelegate() {}
virtual ~MouseEventLocationDelegate() {}
~MouseEventLocationDelegate() override {}

gfx::Point GetMouseEventLocationAndReset() {
gfx::Point p = mouse_event_location_;
mouse_event_location_.SetPoint(-100, -100);
return p;
}

virtual void OnMouseEvent(ui::MouseEvent* event) override {
void OnMouseEvent(ui::MouseEvent* event) override {
mouse_event_location_ = event->location();
event->SetHandled();
}
Expand Down
6 changes: 3 additions & 3 deletions ash/wm/cursor_manager_chromeos.h
Original file line number Diff line number Diff line change
Expand Up @@ -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);
};
Expand Down
13 changes: 6 additions & 7 deletions ash/wm/default_state.h
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
8 changes: 4 additions & 4 deletions ash/wm/default_window_resizer.h
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand All @@ -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);
Expand Down
14 changes: 7 additions & 7 deletions ash/wm/dock/docked_window_layout_manager.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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_);
Expand Down Expand Up @@ -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()));
}
Expand Down Expand Up @@ -372,17 +372,17 @@ 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()
->RemoveObserver(this);
}

// 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();
Expand Down
54 changes: 25 additions & 29 deletions ash/wm/dock/docked_window_layout_manager.h
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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_;
Expand Down
2 changes: 1 addition & 1 deletion ash/wm/dock/docked_window_layout_manager_unittest.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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());
Expand Down
Loading

0 comments on commit 28401c2

Please sign in to comment.