| Index: ui/aura/window_unittest.cc
|
| diff --git a/ui/aura/window_unittest.cc b/ui/aura/window_unittest.cc
|
| index 486bc6bff4d386f8924f2fc1c4d80e8d4b6a1f26..3a884ea763189a565856d60703b51623bb4d0da1 100644
|
| --- a/ui/aura/window_unittest.cc
|
| +++ b/ui/aura/window_unittest.cc
|
| @@ -55,7 +55,7 @@ class WindowTest : public AuraTestBase {
|
| WindowTest() : max_separation_(0) {
|
| }
|
|
|
| - virtual void SetUp() override {
|
| + void SetUp() override {
|
| AuraTestBase::SetUp();
|
| // TODO: there needs to be an easier way to do this.
|
| max_separation_ = ui::GestureConfiguration::
|
| @@ -64,7 +64,7 @@ class WindowTest : public AuraTestBase {
|
| set_max_separation_for_gesture_touches_in_pixels(0);
|
| }
|
|
|
| - virtual void TearDown() override {
|
| + void TearDown() override {
|
| AuraTestBase::TearDown();
|
| ui::GestureConfiguration::
|
| set_max_separation_for_gesture_touches_in_pixels(max_separation_);
|
| @@ -94,13 +94,13 @@ class DestroyTrackingDelegateImpl : public TestWindowDelegate {
|
|
|
| bool in_destroying() const { return in_destroying_; }
|
|
|
| - virtual void OnWindowDestroying(Window* window) override {
|
| + void OnWindowDestroying(Window* window) override {
|
| EXPECT_FALSE(in_destroying_);
|
| in_destroying_ = true;
|
| destroying_count_++;
|
| }
|
|
|
| - virtual void OnWindowDestroyed(Window* window) override {
|
| + void OnWindowDestroyed(Window* window) override {
|
| EXPECT_TRUE(in_destroying_);
|
| in_destroying_ = false;
|
| destroyed_count_++;
|
| @@ -123,7 +123,7 @@ class ChildWindowDelegateImpl : public DestroyTrackingDelegateImpl {
|
| : parent_delegate_(parent_delegate) {
|
| }
|
|
|
| - virtual void OnWindowDestroying(Window* window) override {
|
| + void OnWindowDestroying(Window* window) override {
|
| EXPECT_TRUE(parent_delegate_->in_destroying());
|
| DestroyTrackingDelegateImpl::OnWindowDestroying(window);
|
| }
|
| @@ -143,7 +143,7 @@ class DestroyOrphanDelegate : public TestWindowDelegate {
|
|
|
| void set_window(Window* window) { window_ = window; }
|
|
|
| - virtual void OnWindowDestroyed(Window* window) override {
|
| + void OnWindowDestroyed(Window* window) override {
|
| EXPECT_FALSE(window_->parent());
|
| }
|
|
|
| @@ -175,20 +175,16 @@ class CaptureWindowDelegateImpl : public TestWindowDelegate {
|
| int touch_event_count() const { return touch_event_count_; }
|
| int gesture_event_count() const { return gesture_event_count_; }
|
|
|
| - virtual void OnMouseEvent(ui::MouseEvent* event) override {
|
| + void OnMouseEvent(ui::MouseEvent* event) override {
|
| if (event->type() == ui::ET_MOUSE_CAPTURE_CHANGED)
|
| capture_changed_event_count_++;
|
| mouse_event_count_++;
|
| }
|
| - virtual void OnTouchEvent(ui::TouchEvent* event) override {
|
| - touch_event_count_++;
|
| - }
|
| - virtual void OnGestureEvent(ui::GestureEvent* event) override {
|
| + void OnTouchEvent(ui::TouchEvent* event) override { touch_event_count_++; }
|
| + void OnGestureEvent(ui::GestureEvent* event) override {
|
| gesture_event_count_++;
|
| }
|
| - virtual void OnCaptureLost() override {
|
| - capture_lost_count_++;
|
| - }
|
| + void OnCaptureLost() override { capture_lost_count_++; }
|
|
|
| private:
|
| int capture_changed_event_count_;
|
| @@ -205,7 +201,7 @@ class GestureTrackPositionDelegate : public TestWindowDelegate {
|
| public:
|
| GestureTrackPositionDelegate() {}
|
|
|
| - virtual void OnGestureEvent(ui::GestureEvent* event) override {
|
| + void OnGestureEvent(ui::GestureEvent* event) override {
|
| position_ = event->location();
|
| event->StopPropagation();
|
| }
|
| @@ -226,7 +222,7 @@ class SelfEventHandlingWindowDelegate : public TestWindowDelegate {
|
| public:
|
| SelfEventHandlingWindowDelegate() {}
|
|
|
| - virtual bool ShouldDescendIntoChildForEventHandling(
|
| + bool ShouldDescendIntoChildForEventHandling(
|
| Window* child,
|
| const gfx::Point& location) override {
|
| return false;
|
| @@ -242,12 +238,10 @@ class DestroyWindowDelegate : public TestWindowDelegate {
|
| DestroyWindowDelegate() {}
|
|
|
| private:
|
| - virtual ~DestroyWindowDelegate() {}
|
| + ~DestroyWindowDelegate() override {}
|
|
|
| // Overridden from WindowDelegate.
|
| - virtual void OnWindowDestroyed(Window* window) override {
|
| - delete this;
|
| - }
|
| + void OnWindowDestroyed(Window* window) override { delete this; }
|
|
|
| DISALLOW_COPY_AND_ASSIGN(DestroyWindowDelegate);
|
| };
|
| @@ -576,9 +570,7 @@ class AddedToRootWindowObserver : public WindowObserver {
|
| public:
|
| AddedToRootWindowObserver() : called_(false) {}
|
|
|
| - virtual void OnWindowAddedToRootWindow(Window* window) override {
|
| - called_ = true;
|
| - }
|
| + void OnWindowAddedToRootWindow(Window* window) override { called_ = true; }
|
|
|
| bool called() const { return called_; }
|
|
|
| @@ -1087,7 +1079,7 @@ class MouseEnterExitWindowDelegate : public TestWindowDelegate {
|
| public:
|
| MouseEnterExitWindowDelegate() : entered_(false), exited_(false) {}
|
|
|
| - virtual void OnMouseEvent(ui::MouseEvent* event) override {
|
| + void OnMouseEvent(ui::MouseEvent* event) override {
|
| switch (event->type()) {
|
| case ui::ET_MOUSE_ENTERED:
|
| EXPECT_TRUE(event->flags() & ui::EF_IS_SYNTHESIZED);
|
| @@ -1372,7 +1364,7 @@ class VisibilityWindowDelegate : public TestWindowDelegate {
|
| hidden_ = 0;
|
| }
|
|
|
| - virtual void OnWindowTargetVisibilityChanged(bool visible) override {
|
| + void OnWindowTargetVisibilityChanged(bool visible) override {
|
| if (visible)
|
| shown_++;
|
| else
|
| @@ -1675,7 +1667,7 @@ class WindowObserverTest : public WindowTest,
|
| old_property_value_(-3) {
|
| }
|
|
|
| - virtual ~WindowObserverTest() {}
|
| + ~WindowObserverTest() override {}
|
|
|
| const VisibilityInfo* GetVisibilityInfo() const {
|
| return visibility_info_.get();
|
| @@ -1721,16 +1713,11 @@ class WindowObserverTest : public WindowTest,
|
| }
|
|
|
| private:
|
| - virtual void OnWindowAdded(Window* new_window) override {
|
| - added_count_++;
|
| - }
|
| + void OnWindowAdded(Window* new_window) override { added_count_++; }
|
|
|
| - virtual void OnWillRemoveWindow(Window* window) override {
|
| - removed_count_++;
|
| - }
|
| + void OnWillRemoveWindow(Window* window) override { removed_count_++; }
|
|
|
| - virtual void OnWindowVisibilityChanged(Window* window,
|
| - bool visible) override {
|
| + void OnWindowVisibilityChanged(Window* window, bool visible) override {
|
| if (!visibility_info_) {
|
| visibility_info_.reset(new VisibilityInfo);
|
| visibility_info_->changed_count = 0;
|
| @@ -1740,20 +1727,19 @@ class WindowObserverTest : public WindowTest,
|
| visibility_info_->changed_count++;
|
| }
|
|
|
| - virtual void OnWindowDestroyed(Window* window) override {
|
| + void OnWindowDestroyed(Window* window) override {
|
| EXPECT_FALSE(window->parent());
|
| destroyed_count_++;
|
| }
|
|
|
| - virtual void OnWindowPropertyChanged(Window* window,
|
| - const void* key,
|
| - intptr_t old) override {
|
| + void OnWindowPropertyChanged(Window* window,
|
| + const void* key,
|
| + intptr_t old) override {
|
| property_key_ = key;
|
| old_property_value_ = old;
|
| }
|
|
|
| - virtual void OnAncestorWindowTransformed(Window* source,
|
| - Window* window) override {
|
| + void OnAncestorWindowTransformed(Window* source, Window* window) override {
|
| transform_notifications_.push_back(
|
| std::make_pair(source->id(), window->id()));
|
| }
|
| @@ -2034,16 +2020,14 @@ class TestVisibilityClient : public client::VisibilityClient {
|
| : ignore_visibility_changes_(false) {
|
| client::SetVisibilityClient(root_window, this);
|
| }
|
| - virtual ~TestVisibilityClient() {
|
| - }
|
| + ~TestVisibilityClient() override {}
|
|
|
| void set_ignore_visibility_changes(bool ignore_visibility_changes) {
|
| ignore_visibility_changes_ = ignore_visibility_changes;
|
| }
|
|
|
| // Overridden from client::VisibilityClient:
|
| - virtual void UpdateLayerVisibility(aura::Window* window,
|
| - bool visible) override {
|
| + void UpdateLayerVisibility(aura::Window* window, bool visible) override {
|
| if (!ignore_visibility_changes_)
|
| window->layer()->SetVisible(visible);
|
| }
|
| @@ -2168,7 +2152,7 @@ TEST_F(WindowTest, MouseEventsOnWindowChange) {
|
| class RootWindowAttachmentObserver : public WindowObserver {
|
| public:
|
| RootWindowAttachmentObserver() : added_count_(0), removed_count_(0) {}
|
| - virtual ~RootWindowAttachmentObserver() {}
|
| + ~RootWindowAttachmentObserver() override {}
|
|
|
| int added_count() const { return added_count_; }
|
| int removed_count() const { return removed_count_; }
|
| @@ -2179,11 +2163,9 @@ class RootWindowAttachmentObserver : public WindowObserver {
|
| }
|
|
|
| // Overridden from WindowObserver:
|
| - virtual void OnWindowAddedToRootWindow(Window* window) override {
|
| - ++added_count_;
|
| - }
|
| - virtual void OnWindowRemovingFromRootWindow(Window* window,
|
| - Window* new_root) override {
|
| + void OnWindowAddedToRootWindow(Window* window) override { ++added_count_; }
|
| + void OnWindowRemovingFromRootWindow(Window* window,
|
| + Window* new_root) override {
|
| ++removed_count_;
|
| }
|
|
|
| @@ -2263,9 +2245,9 @@ class BoundsChangedWindowObserver : public WindowObserver {
|
| public:
|
| BoundsChangedWindowObserver() : root_set_(false) {}
|
|
|
| - virtual void OnWindowBoundsChanged(Window* window,
|
| - const gfx::Rect& old_bounds,
|
| - const gfx::Rect& new_bounds) override {
|
| + void OnWindowBoundsChanged(Window* window,
|
| + const gfx::Rect& old_bounds,
|
| + const gfx::Rect& new_bounds) override {
|
| root_set_ = window->GetRootWindow() != NULL;
|
| }
|
|
|
| @@ -2344,9 +2326,7 @@ class OwningWindowDelegate : public TestWindowDelegate {
|
| owned_window_.reset(window);
|
| }
|
|
|
| - virtual void OnWindowDestroyed(Window* window) override {
|
| - owned_window_.reset(NULL);
|
| - }
|
| + void OnWindowDestroyed(Window* window) override { owned_window_.reset(NULL); }
|
|
|
| private:
|
| scoped_ptr<Window> owned_window_;
|
| @@ -2389,8 +2369,8 @@ class BoundsChangeDelegate : public TestWindowDelegate {
|
| }
|
|
|
| // Window
|
| - 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 {
|
| bounds_changed_ = true;
|
| }
|
|
|
| @@ -2498,11 +2478,9 @@ class AddChildNotificationsObserver : public WindowObserver {
|
| }
|
|
|
| // WindowObserver overrides:
|
| - virtual void OnWindowAddedToRootWindow(Window* window) override {
|
| - added_count_++;
|
| - }
|
| - virtual void OnWindowRemovingFromRootWindow(Window* window,
|
| - Window* new_root) override {
|
| + void OnWindowAddedToRootWindow(Window* window) override { added_count_++; }
|
| + void OnWindowRemovingFromRootWindow(Window* window,
|
| + Window* new_root) override {
|
| removed_count_++;
|
| }
|
|
|
| @@ -2547,9 +2525,7 @@ class HierarchyObserver : public WindowObserver {
|
| HierarchyObserver(Window* target) : target_(target) {
|
| target_->AddObserver(this);
|
| }
|
| - virtual ~HierarchyObserver() {
|
| - target_->RemoveObserver(this);
|
| - }
|
| + ~HierarchyObserver() override { target_->RemoveObserver(this); }
|
|
|
| void ValidateState(
|
| int index,
|
| @@ -2563,12 +2539,10 @@ class HierarchyObserver : public WindowObserver {
|
|
|
| private:
|
| // Overridden from WindowObserver:
|
| - virtual void OnWindowHierarchyChanging(
|
| - const HierarchyChangeParams& params) override {
|
| + void OnWindowHierarchyChanging(const HierarchyChangeParams& params) override {
|
| params_.push_back(params);
|
| }
|
| - virtual void OnWindowHierarchyChanged(
|
| - const HierarchyChangeParams& params) override {
|
| + void OnWindowHierarchyChanged(const HierarchyChangeParams& params) override {
|
| params_.push_back(params);
|
| }
|
|
|
| @@ -2935,7 +2909,7 @@ namespace {
|
| class PaintWindowDelegate : public TestWindowDelegate {
|
| public:
|
| PaintWindowDelegate() : paint_count_(0) {}
|
| - virtual ~PaintWindowDelegate() {}
|
| + ~PaintWindowDelegate() override {}
|
|
|
| const gfx::Rect& most_recent_paint_clip_bounds() const {
|
| return most_recent_paint_clip_bounds_;
|
| @@ -2949,7 +2923,7 @@ class PaintWindowDelegate : public TestWindowDelegate {
|
| int paint_count() const { return paint_count_; }
|
|
|
| // TestWindowDelegate::
|
| - virtual void OnPaint(gfx::Canvas* canvas) override {
|
| + void OnPaint(gfx::Canvas* canvas) override {
|
| paint_count_++;
|
| canvas->GetClipBounds(&most_recent_paint_clip_bounds_);
|
| const SkMatrix& matrix = canvas->sk_canvas()->getTotalMatrix();
|
| @@ -3412,7 +3386,7 @@ class TestLayerAnimationObserver : public ui::LayerAnimationObserver {
|
| TestLayerAnimationObserver()
|
| : animation_completed_(false),
|
| animation_aborted_(false) {}
|
| - virtual ~TestLayerAnimationObserver() {}
|
| + ~TestLayerAnimationObserver() override {}
|
|
|
| bool animation_completed() const { return animation_completed_; }
|
| bool animation_aborted() const { return animation_aborted_; }
|
| @@ -3424,19 +3398,16 @@ class TestLayerAnimationObserver : public ui::LayerAnimationObserver {
|
|
|
| private:
|
| // ui::LayerAnimationObserver:
|
| - virtual void OnLayerAnimationEnded(
|
| - ui::LayerAnimationSequence* sequence) override {
|
| + void OnLayerAnimationEnded(ui::LayerAnimationSequence* sequence) override {
|
| animation_completed_ = true;
|
| }
|
|
|
| - virtual void OnLayerAnimationAborted(
|
| - ui::LayerAnimationSequence* sequence) override {
|
| + void OnLayerAnimationAborted(ui::LayerAnimationSequence* sequence) override {
|
| animation_aborted_ = true;
|
| }
|
|
|
| - virtual void OnLayerAnimationScheduled(
|
| - ui::LayerAnimationSequence* sequence) override {
|
| - }
|
| + void OnLayerAnimationScheduled(
|
| + ui::LayerAnimationSequence* sequence) override {}
|
|
|
| bool animation_completed_;
|
| bool animation_aborted_;
|
|
|