summaryrefslogtreecommitdiffstats
path: root/ash/desktop_background
diff options
context:
space:
mode:
authordcheng <dcheng@chromium.org>2014-10-27 16:57:05 -0700
committerCommit bot <commit-bot@chromium.org>2014-10-27 23:58:04 +0000
commit1f4538e02ae35659abf7f9468639a1045924af50 (patch)
tree1e076638bbebe64689099c5ea5bd82bfa9c6b9aa /ash/desktop_background
parente19d49ab07f57c16eb6685e7394ac4902e53382c (diff)
downloadchromium_src-1f4538e02ae35659abf7f9468639a1045924af50.zip
chromium_src-1f4538e02ae35659abf7f9468639a1045924af50.tar.gz
chromium_src-1f4538e02ae35659abf7f9468639a1045924af50.tar.bz2
Standardize usage of virtual/override/final specifiers.
The Google C++ style guide states: Explicitly annotate overrides of virtual functions or virtual destructors with an override or (less frequently) final specifier. Older (pre-C++11) code will use the virtual keyword as an inferior alternative annotation. For clarity, use exactly one of override, final, or virtual when declaring an override. To better conform to these guidelines, the following constructs have been rewritten: - if a base class has a virtual destructor, then: virtual ~Foo(); -> ~Foo() override; - virtual void Foo() override; -> void Foo() override; - virtual void Foo() override final; -> void Foo() final; This patch was automatically generated. The clang plugin can generate fixit hints, which are suggested edits when it is 100% sure it knows how to fix a problem. The hints from the clang plugin were applied to the source tree using the tool in https://codereview.chromium.org/598073004. BUG=417463 R=derat@chromium.org Review URL: https://codereview.chromium.org/680153002 Cr-Commit-Position: refs/heads/master@{#301490}
Diffstat (limited to 'ash/desktop_background')
-rw-r--r--ash/desktop_background/desktop_background_controller.h6
-rw-r--r--ash/desktop_background/desktop_background_controller_unittest.cc4
-rw-r--r--ash/desktop_background/desktop_background_view.cc8
-rw-r--r--ash/desktop_background/desktop_background_view.h12
-rw-r--r--ash/desktop_background/desktop_background_widget_controller.cc10
-rw-r--r--ash/desktop_background/desktop_background_widget_controller.h4
-rw-r--r--ash/desktop_background/wallpaper_resizer_unittest.cc6
7 files changed, 23 insertions, 27 deletions
diff --git a/ash/desktop_background/desktop_background_controller.h b/ash/desktop_background/desktop_background_controller.h
index e9bf639..66752a1 100644
--- a/ash/desktop_background/desktop_background_controller.h
+++ b/ash/desktop_background/desktop_background_controller.h
@@ -58,7 +58,7 @@ class ASH_EXPORT DesktopBackgroundController
};
DesktopBackgroundController();
- virtual ~DesktopBackgroundController();
+ ~DesktopBackgroundController() override;
BackgroundMode desktop_background_mode() const {
return desktop_background_mode_;
@@ -97,10 +97,10 @@ class ASH_EXPORT DesktopBackgroundController
bool MoveDesktopToUnlockedContainer();
// DisplayController::Observer:
- virtual void OnDisplayConfigurationChanged() override;
+ void OnDisplayConfigurationChanged() override;
// ShellObserver:
- virtual void OnRootWindowAdded(aura::Window* root_window) override;
+ void OnRootWindowAdded(aura::Window* root_window) override;
// Returns the maximum size of all displays combined in native
// resolutions. Note that this isn't the bounds of the display who
diff --git a/ash/desktop_background/desktop_background_controller_unittest.cc b/ash/desktop_background/desktop_background_controller_unittest.cc
index e504f03..49f7f79 100644
--- a/ash/desktop_background/desktop_background_controller_unittest.cc
+++ b/ash/desktop_background/desktop_background_controller_unittest.cc
@@ -71,9 +71,9 @@ class DesktopBackgroundControllerTest : public test::AshTestBase {
: controller_(NULL),
wallpaper_delegate_(NULL) {
}
- virtual ~DesktopBackgroundControllerTest() {}
+ ~DesktopBackgroundControllerTest() override {}
- virtual void SetUp() override {
+ void SetUp() override {
test::AshTestBase::SetUp();
// Ash shell initialization creates wallpaper. Reset it so we can manually
// control wallpaper creation and animation in our tests.
diff --git a/ash/desktop_background/desktop_background_view.cc b/ash/desktop_background/desktop_background_view.cc
index 3af8599..c87b4fd 100644
--- a/ash/desktop_background/desktop_background_view.cc
+++ b/ash/desktop_background/desktop_background_view.cc
@@ -49,7 +49,7 @@ class LayerControlView : public views::View {
}
// Overrides views::View.
- virtual void Layout() override {
+ void Layout() override {
gfx::Display display = Shell::GetScreen()->GetDisplayNearestWindow(
GetWidget()->GetNativeView());
DisplayManager* display_manager = Shell::GetInstance()->display_manager();
@@ -79,11 +79,11 @@ class LayerControlView : public views::View {
class PreEventDispatchHandler : public ui::EventHandler {
public:
PreEventDispatchHandler() {}
- virtual ~PreEventDispatchHandler() {}
+ ~PreEventDispatchHandler() override {}
private:
// ui::EventHandler:
- virtual void OnMouseEvent(ui::MouseEvent* event) override {
+ void OnMouseEvent(ui::MouseEvent* event) override {
CHECK_EQ(ui::EP_PRETARGET, event->phase());
WindowSelectorController* controller =
Shell::GetInstance()->window_selector_controller();
@@ -93,7 +93,7 @@ class PreEventDispatchHandler : public ui::EventHandler {
}
}
- virtual void OnGestureEvent(ui::GestureEvent* event) override {
+ void OnGestureEvent(ui::GestureEvent* event) override {
CHECK_EQ(ui::EP_PRETARGET, event->phase());
WindowSelectorController* controller =
Shell::GetInstance()->window_selector_controller();
diff --git a/ash/desktop_background/desktop_background_view.h b/ash/desktop_background/desktop_background_view.h
index 6a93823..17814d0 100644
--- a/ash/desktop_background/desktop_background_view.h
+++ b/ash/desktop_background/desktop_background_view.h
@@ -18,17 +18,17 @@ class DesktopBackgroundView : public views::View,
public views::ContextMenuController {
public:
DesktopBackgroundView();
- virtual ~DesktopBackgroundView();
+ ~DesktopBackgroundView() override;
private:
// Overridden from views::View:
- virtual void OnPaint(gfx::Canvas* canvas) override;
- virtual bool OnMousePressed(const ui::MouseEvent& event) override;
+ void OnPaint(gfx::Canvas* canvas) override;
+ bool OnMousePressed(const ui::MouseEvent& event) override;
// Overridden from views::ContextMenuController:
- virtual void ShowContextMenuForView(views::View* source,
- const gfx::Point& point,
- ui::MenuSourceType source_type) override;
+ void ShowContextMenuForView(views::View* source,
+ const gfx::Point& point,
+ ui::MenuSourceType source_type) override;
scoped_ptr<PreEventDispatchHandler> pre_dispatch_handler_;
DISALLOW_COPY_AND_ASSIGN(DesktopBackgroundView);
diff --git a/ash/desktop_background/desktop_background_widget_controller.cc b/ash/desktop_background/desktop_background_widget_controller.cc
index cd90318..72351c3 100644
--- a/ash/desktop_background/desktop_background_widget_controller.cc
+++ b/ash/desktop_background/desktop_background_widget_controller.cc
@@ -30,7 +30,7 @@ class ShowWallpaperAnimationObserver : public ui::ImplicitAnimationObserver,
desktop_widget_->AddObserver(this);
}
- virtual ~ShowWallpaperAnimationObserver() {
+ ~ShowWallpaperAnimationObserver() override {
StopObservingImplicitAnimations();
if (desktop_widget_)
desktop_widget_->RemoveObserver(this);
@@ -38,22 +38,20 @@ class ShowWallpaperAnimationObserver : public ui::ImplicitAnimationObserver,
private:
// Overridden from ui::ImplicitAnimationObserver:
- virtual void OnImplicitAnimationsScheduled() override {
+ void OnImplicitAnimationsScheduled() override {
if (is_initial_animation_) {
root_window_controller_->
HandleInitialDesktopBackgroundAnimationStarted();
}
}
- virtual void OnImplicitAnimationsCompleted() override {
+ void OnImplicitAnimationsCompleted() override {
root_window_controller_->OnWallpaperAnimationFinished(desktop_widget_);
delete this;
}
// Overridden from views::WidgetObserver.
- virtual void OnWidgetDestroying(views::Widget* widget) override {
- delete this;
- }
+ void OnWidgetDestroying(views::Widget* widget) override { delete this; }
RootWindowController* root_window_controller_;
views::Widget* desktop_widget_;
diff --git a/ash/desktop_background/desktop_background_widget_controller.h b/ash/desktop_background/desktop_background_widget_controller.h
index 0aafe2e..bad030c 100644
--- a/ash/desktop_background/desktop_background_widget_controller.h
+++ b/ash/desktop_background/desktop_background_widget_controller.h
@@ -25,10 +25,10 @@ class ASH_EXPORT DesktopBackgroundWidgetController
// Create
explicit DesktopBackgroundWidgetController(views::Widget* widget);
- virtual ~DesktopBackgroundWidgetController();
+ ~DesktopBackgroundWidgetController() override;
// Overridden from views::WidgetObserver.
- virtual void OnWidgetDestroying(views::Widget* widget) override;
+ void OnWidgetDestroying(views::Widget* widget) override;
// Set bounds of component that draws background.
void SetBounds(gfx::Rect bounds);
diff --git a/ash/desktop_background/wallpaper_resizer_unittest.cc b/ash/desktop_background/wallpaper_resizer_unittest.cc
index 97bd249..6a06490 100644
--- a/ash/desktop_background/wallpaper_resizer_unittest.cc
+++ b/ash/desktop_background/wallpaper_resizer_unittest.cc
@@ -61,7 +61,7 @@ class WallpaperResizerTest : public testing::Test,
WallpaperResizerTest()
: ui_thread_(content::BrowserThread::UI, &message_loop_) {
}
- virtual ~WallpaperResizerTest() {}
+ ~WallpaperResizerTest() override {}
gfx::ImageSkia Resize(const gfx::ImageSkia& image,
const gfx::Size& target_size,
@@ -79,9 +79,7 @@ class WallpaperResizerTest : public testing::Test,
message_loop_.Run();
}
- virtual void OnWallpaperResized() override {
- message_loop_.Quit();
- }
+ void OnWallpaperResized() override { message_loop_.Quit(); }
private:
base::MessageLoop message_loop_;