Index: ui/wm/core/focus_controller_unittest.cc |
diff --git a/ui/wm/core/focus_controller_unittest.cc b/ui/wm/core/focus_controller_unittest.cc |
index a10cef3e883805700124dcf3bba4ad8ed50c96b8..2508bcd8c611e24e270a45576e829dde140f7883 100644 |
--- a/ui/wm/core/focus_controller_unittest.cc |
+++ b/ui/wm/core/focus_controller_unittest.cc |
@@ -56,12 +56,12 @@ class FocusNotificationObserver : public aura::client::ActivationChangeObserver, |
private: |
// Overridden from aura::client::ActivationChangeObserver: |
virtual void OnWindowActivated(aura::Window* gained_active, |
- aura::Window* lost_active) OVERRIDE { |
+ aura::Window* lost_active) override { |
++activation_changed_count_; |
} |
virtual void OnAttemptToReactivateWindow( |
aura::Window* request_active, |
- aura::Window* actual_active) OVERRIDE { |
+ aura::Window* actual_active) override { |
++reactivation_count_; |
reactivation_requested_window_ = request_active; |
reactivation_actual_window_ = actual_active; |
@@ -69,7 +69,7 @@ class FocusNotificationObserver : public aura::client::ActivationChangeObserver, |
// Overridden from aura::client::FocusChangeObserver: |
virtual void OnWindowFocused(aura::Window* gained_focus, |
- aura::Window* lost_focus) OVERRIDE { |
+ aura::Window* lost_focus) override { |
++focus_changed_count_; |
} |
@@ -116,14 +116,14 @@ class RecordingActivationAndFocusChangeObserver |
// Overridden from aura::client::ActivationChangeObserver: |
virtual void OnWindowActivated(aura::Window* gained_active, |
- aura::Window* lost_active) OVERRIDE { |
+ aura::Window* lost_active) override { |
if (lost_active && lost_active == deleter_->GetDeletedWindow()) |
was_notified_with_deleted_window_ = true; |
} |
// Overridden from aura::client::FocusChangeObserver: |
virtual void OnWindowFocused(aura::Window* gained_focus, |
- aura::Window* lost_focus) OVERRIDE { |
+ aura::Window* lost_focus) override { |
if (lost_focus && lost_focus == deleter_->GetDeletedWindow()) |
was_notified_with_deleted_window_ = true; |
} |
@@ -159,7 +159,7 @@ class DeleteOnLoseActivationChangeObserver : |
// Overridden from aura::client::ActivationChangeObserver: |
virtual void OnWindowActivated(aura::Window* gained_active, |
- aura::Window* lost_active) OVERRIDE { |
+ aura::Window* lost_active) override { |
if (window_ && lost_active == window_) { |
delete lost_active; |
did_delete_ = true; |
@@ -167,7 +167,7 @@ class DeleteOnLoseActivationChangeObserver : |
} |
// Overridden from WindowDeleter: |
- virtual aura::Window* GetDeletedWindow() OVERRIDE { |
+ virtual aura::Window* GetDeletedWindow() override { |
return did_delete_ ? window_ : NULL; |
} |
@@ -196,7 +196,7 @@ class DeleteOnLoseFocusChangeObserver |
// Overridden from aura::client::FocusChangeObserver: |
virtual void OnWindowFocused(aura::Window* gained_focus, |
- aura::Window* lost_focus) OVERRIDE { |
+ aura::Window* lost_focus) override { |
if (window_ && lost_focus == window_) { |
delete lost_focus; |
did_delete_ = true; |
@@ -204,7 +204,7 @@ class DeleteOnLoseFocusChangeObserver |
} |
// Overridden from WindowDeleter: |
- virtual aura::Window* GetDeletedWindow() OVERRIDE { |
+ virtual aura::Window* GetDeletedWindow() override { |
return did_delete_ ? window_ : NULL; |
} |
@@ -267,7 +267,7 @@ class ScopedFocusedTextInputClientChanger |
private: |
// Overridden from aura::client::FocusChangeObserver: |
virtual void OnWindowFocused(aura::Window* gained_focus, |
- aura::Window* lost_focus) OVERRIDE { |
+ aura::Window* lost_focus) override { |
ui::TextInputFocusManager::GetInstance()->FocusTextInputClient( |
text_input_client_); |
} |
@@ -282,10 +282,10 @@ class SimpleEventHandler : public ui::EventHandler { |
virtual ~SimpleEventHandler() {} |
// Overridden from ui::EventHandler: |
- virtual void OnMouseEvent(ui::MouseEvent* event) OVERRIDE { |
+ virtual void OnMouseEvent(ui::MouseEvent* event) override { |
event->SetHandled(); |
} |
- virtual void OnGestureEvent(ui::GestureEvent* event) OVERRIDE { |
+ virtual void OnGestureEvent(ui::GestureEvent* event) override { |
event->SetHandled(); |
} |
@@ -308,7 +308,7 @@ class FocusShiftingActivationObserver |
private: |
// Overridden from aura::client::ActivationChangeObserver: |
virtual void OnWindowActivated(aura::Window* gained_active, |
- aura::Window* lost_active) OVERRIDE { |
+ aura::Window* lost_active) override { |
// Shift focus to a child. This should prevent the default focusing from |
// occurring in FocusController::FocusWindow(). |
if (gained_active == activated_window_) { |
@@ -338,33 +338,33 @@ class TestFocusRules : public BaseFocusRules { |
} |
// Overridden from BaseFocusRules: |
- virtual bool SupportsChildActivation(aura::Window* window) const OVERRIDE { |
+ virtual bool SupportsChildActivation(aura::Window* window) const override { |
// In FocusControllerTests, only the RootWindow has activatable children. |
return window->GetRootWindow() == window; |
} |
- virtual bool CanActivateWindow(aura::Window* window) const OVERRIDE { |
+ virtual bool CanActivateWindow(aura::Window* window) const override { |
// Restricting focus to a non-activatable child window means the activatable |
// parent outside the focus restriction is activatable. |
bool can_activate = |
CanFocusOrActivate(window) || window->Contains(focus_restriction_); |
return can_activate ? BaseFocusRules::CanActivateWindow(window) : false; |
} |
- virtual bool CanFocusWindow(aura::Window* window) const OVERRIDE { |
+ virtual bool CanFocusWindow(aura::Window* window) const override { |
return CanFocusOrActivate(window) ? |
BaseFocusRules::CanFocusWindow(window) : false; |
} |
virtual aura::Window* GetActivatableWindow( |
- aura::Window* window) const OVERRIDE { |
+ aura::Window* window) const override { |
return BaseFocusRules::GetActivatableWindow( |
CanFocusOrActivate(window) ? window : focus_restriction_); |
} |
virtual aura::Window* GetFocusableWindow( |
- aura::Window* window) const OVERRIDE { |
+ aura::Window* window) const override { |
return BaseFocusRules::GetFocusableWindow( |
CanFocusOrActivate(window) ? window : focus_restriction_); |
} |
virtual aura::Window* GetNextActivatableWindow( |
- aura::Window* ignore) const OVERRIDE { |
+ aura::Window* ignore) const override { |
aura::Window* next_activatable = |
BaseFocusRules::GetNextActivatableWindow(ignore); |
return CanFocusOrActivate(next_activatable) ? |
@@ -387,7 +387,7 @@ class FocusControllerTestBase : public aura::test::AuraTestBase { |
FocusControllerTestBase() {} |
// Overridden from aura::test::AuraTestBase: |
- virtual void SetUp() OVERRIDE { |
+ virtual void SetUp() override { |
wm_state_.reset(new wm::WMState); |
// FocusController registers itself as an Env observer so it can catch all |
// window initializations, including the root_window()'s, so we create it |
@@ -430,7 +430,7 @@ class FocusControllerTestBase : public aura::test::AuraTestBase { |
aura::test::TestWindowDelegate::CreateSelfDestroyingDelegate(), 3, |
gfx::Rect(125, 125, 50, 50), root_window()); |
} |
- virtual void TearDown() OVERRIDE { |
+ virtual void TearDown() override { |
root_window()->RemovePreTargetHandler(focus_controller_.get()); |
aura::test::AuraTestBase::TearDown(); |
test_focus_rules_ = NULL; // Owned by FocusController. |
@@ -518,14 +518,14 @@ class FocusControllerDirectTestBase : public FocusControllerTestBase { |
} |
// Overridden from FocusControllerTestBase: |
- virtual void BasicFocus() OVERRIDE { |
+ virtual void BasicFocus() override { |
EXPECT_EQ(NULL, GetFocusedWindow()); |
FocusWindowById(1); |
EXPECT_EQ(1, GetFocusedWindowId()); |
FocusWindowById(2); |
EXPECT_EQ(2, GetFocusedWindowId()); |
} |
- virtual void BasicActivation() OVERRIDE { |
+ virtual void BasicActivation() override { |
EXPECT_EQ(NULL, GetActiveWindow()); |
ActivateWindowById(1); |
EXPECT_EQ(1, GetActiveWindowId()); |
@@ -538,7 +538,7 @@ class FocusControllerDirectTestBase : public FocusControllerTestBase { |
DeactivateWindow(GetActiveWindow()); |
EXPECT_EQ(1, GetActiveWindowId()); |
} |
- virtual void FocusEvents() OVERRIDE { |
+ virtual void FocusEvents() override { |
ScopedFocusNotificationObserver root_observer(root_window()); |
ScopedTargetFocusNotificationObserver observer1(root_window(), 1); |
ScopedTargetFocusNotificationObserver observer2(root_window(), 2); |
@@ -557,7 +557,7 @@ class FocusControllerDirectTestBase : public FocusControllerTestBase { |
observer1.ExpectCounts(2, 2); |
observer2.ExpectCounts(1, 1); |
} |
- virtual void DuplicateFocusEvents() OVERRIDE { |
+ virtual void DuplicateFocusEvents() override { |
// Focusing an existing focused window should not resend focus events. |
ScopedFocusNotificationObserver root_observer(root_window()); |
ScopedTargetFocusNotificationObserver observer1(root_window(), 1); |
@@ -573,7 +573,7 @@ class FocusControllerDirectTestBase : public FocusControllerTestBase { |
root_observer.ExpectCounts(1, 1); |
observer1.ExpectCounts(1, 1); |
} |
- virtual void ActivationEvents() OVERRIDE { |
+ virtual void ActivationEvents() override { |
ActivateWindowById(1); |
ScopedFocusNotificationObserver root_observer(root_window()); |
@@ -589,7 +589,7 @@ class FocusControllerDirectTestBase : public FocusControllerTestBase { |
observer1.ExpectCounts(1, 1); |
observer2.ExpectCounts(1, 1); |
} |
- virtual void ReactivationEvents() OVERRIDE { |
+ virtual void ReactivationEvents() override { |
ActivateWindowById(1); |
ScopedFocusNotificationObserver root_observer(root_window()); |
EXPECT_EQ(0, root_observer.reactivation_count()); |
@@ -603,7 +603,7 @@ class FocusControllerDirectTestBase : public FocusControllerTestBase { |
EXPECT_EQ(root_window()->GetChildById(1), |
root_observer.reactivation_actual_window()); |
} |
- virtual void DuplicateActivationEvents() OVERRIDE { |
+ virtual void DuplicateActivationEvents() override { |
// Activating an existing active window should not resend activation events. |
ActivateWindowById(1); |
@@ -625,7 +625,7 @@ class FocusControllerDirectTestBase : public FocusControllerTestBase { |
observer1.ExpectCounts(1, 1); |
observer2.ExpectCounts(1, 1); |
} |
- virtual void ShiftFocusWithinActiveWindow() OVERRIDE { |
+ virtual void ShiftFocusWithinActiveWindow() override { |
ActivateWindowById(1); |
EXPECT_EQ(1, GetActiveWindowId()); |
EXPECT_EQ(1, GetFocusedWindowId()); |
@@ -634,7 +634,7 @@ class FocusControllerDirectTestBase : public FocusControllerTestBase { |
FocusWindowById(12); |
EXPECT_EQ(12, GetFocusedWindowId()); |
} |
- virtual void ShiftFocusToChildOfInactiveWindow() OVERRIDE { |
+ virtual void ShiftFocusToChildOfInactiveWindow() override { |
ActivateWindowById(2); |
EXPECT_EQ(2, GetActiveWindowId()); |
EXPECT_EQ(2, GetFocusedWindowId()); |
@@ -642,7 +642,7 @@ class FocusControllerDirectTestBase : public FocusControllerTestBase { |
EXPECT_EQ(1, GetActiveWindowId()); |
EXPECT_EQ(11, GetFocusedWindowId()); |
} |
- virtual void ShiftFocusToParentOfFocusedWindow() OVERRIDE { |
+ virtual void ShiftFocusToParentOfFocusedWindow() override { |
ActivateWindowById(1); |
EXPECT_EQ(1, GetFocusedWindowId()); |
FocusWindowById(11); |
@@ -651,7 +651,7 @@ class FocusControllerDirectTestBase : public FocusControllerTestBase { |
// Focus should _not_ shift to the parent of the already-focused window. |
EXPECT_EQ(11, GetFocusedWindowId()); |
} |
- virtual void FocusRulesOverride() OVERRIDE { |
+ virtual void FocusRulesOverride() override { |
EXPECT_EQ(NULL, GetFocusedWindow()); |
FocusWindowById(11); |
EXPECT_EQ(11, GetFocusedWindowId()); |
@@ -667,7 +667,7 @@ class FocusControllerDirectTestBase : public FocusControllerTestBase { |
FocusWindowById(12); |
EXPECT_EQ(12, GetFocusedWindowId()); |
} |
- virtual void ActivationRulesOverride() OVERRIDE { |
+ virtual void ActivationRulesOverride() override { |
ActivateWindowById(1); |
EXPECT_EQ(1, GetActiveWindowId()); |
EXPECT_EQ(1, GetFocusedWindowId()); |
@@ -687,7 +687,7 @@ class FocusControllerDirectTestBase : public FocusControllerTestBase { |
EXPECT_EQ(2, GetActiveWindowId()); |
EXPECT_EQ(2, GetFocusedWindowId()); |
} |
- virtual void ShiftFocusOnActivation() OVERRIDE { |
+ virtual void ShiftFocusOnActivation() override { |
// When a window is activated, by default that window is also focused. |
// An ActivationChangeObserver may shift focus to another window within the |
// same activatable window. |
@@ -729,7 +729,7 @@ class FocusControllerDirectTestBase : public FocusControllerTestBase { |
ActivateWindowById(1); |
EXPECT_EQ(1, GetFocusedWindowId()); |
} |
- virtual void ShiftFocusOnActivationDueToHide() OVERRIDE { |
+ virtual void ShiftFocusOnActivationDueToHide() override { |
// Similar to ShiftFocusOnActivation except the activation change is |
// triggered by hiding the active window. |
ActivateWindowById(1); |
@@ -755,12 +755,12 @@ class FocusControllerDirectTestBase : public FocusControllerTestBase { |
client->RemoveObserver(observer.get()); |
} |
- virtual void NoShiftActiveOnActivation() OVERRIDE { |
+ virtual void NoShiftActiveOnActivation() override { |
// When a window is activated, we need to prevent any change to activation |
// from being made in response to an activation change notification. |
} |
- virtual void NoFocusChangeOnClickOnCaptureWindow() OVERRIDE { |
+ virtual void NoFocusChangeOnClickOnCaptureWindow() override { |
scoped_ptr<aura::client::DefaultCaptureClient> capture_client( |
new aura::client::DefaultCaptureClient(root_window())); |
// Clicking on a window which has capture should not cause a focus change |
@@ -781,7 +781,7 @@ class FocusControllerDirectTestBase : public FocusControllerTestBase { |
} |
// Verifies focus change is honored while capture held. |
- virtual void ChangeFocusWhenNothingFocusedAndCaptured() OVERRIDE { |
+ virtual void ChangeFocusWhenNothingFocusedAndCaptured() override { |
scoped_ptr<aura::client::DefaultCaptureClient> capture_client( |
new aura::client::DefaultCaptureClient(root_window())); |
aura::Window* w1 = root_window()->GetChildById(1); |
@@ -800,7 +800,7 @@ class FocusControllerDirectTestBase : public FocusControllerTestBase { |
// Verifies if a window that loses activation or focus is deleted during |
// observer notification we don't pass the deleted window to other observers. |
- virtual void DontPassDeletedWindow() OVERRIDE { |
+ virtual void DontPassDeletedWindow() override { |
FocusWindowById(1); |
EXPECT_EQ(1, GetActiveWindowId()); |
@@ -839,7 +839,7 @@ class FocusControllerDirectTestBase : public FocusControllerTestBase { |
// Verifies if the focused text input client is cleared when a window gains |
// or loses the focus. |
- virtual void FocusedTextInputClient() OVERRIDE { |
+ virtual void FocusedTextInputClient() override { |
ui::TextInputFocusManager* text_input_focus_manager = |
ui::TextInputFocusManager::GetInstance(); |
ui::DummyTextInputClient text_input_client; |
@@ -883,16 +883,16 @@ class FocusControllerApiTest : public FocusControllerDirectTestBase { |
private: |
// Overridden from FocusControllerTestBase: |
- virtual void FocusWindowDirect(aura::Window* window) OVERRIDE { |
+ virtual void FocusWindowDirect(aura::Window* window) override { |
FocusWindow(window); |
} |
- virtual void ActivateWindowDirect(aura::Window* window) OVERRIDE { |
+ virtual void ActivateWindowDirect(aura::Window* window) override { |
ActivateWindow(window); |
} |
- virtual void DeactivateWindowDirect(aura::Window* window) OVERRIDE { |
+ virtual void DeactivateWindowDirect(aura::Window* window) override { |
DeactivateWindow(window); |
} |
- virtual bool IsInputEvent() OVERRIDE { return false; } |
+ virtual bool IsInputEvent() override { return false; } |
DISALLOW_COPY_AND_ASSIGN(FocusControllerApiTest); |
}; |
@@ -921,21 +921,21 @@ class FocusControllerMouseEventTest : public FocusControllerDirectTestBase { |
private: |
// Overridden from FocusControllerTestBase: |
- virtual void FocusWindowDirect(aura::Window* window) OVERRIDE { |
+ virtual void FocusWindowDirect(aura::Window* window) override { |
ui::test::EventGenerator generator(root_window(), window); |
generator.ClickLeftButton(); |
} |
- virtual void ActivateWindowDirect(aura::Window* window) OVERRIDE { |
+ virtual void ActivateWindowDirect(aura::Window* window) override { |
ui::test::EventGenerator generator(root_window(), window); |
generator.ClickLeftButton(); |
} |
- virtual void DeactivateWindowDirect(aura::Window* window) OVERRIDE { |
+ virtual void DeactivateWindowDirect(aura::Window* window) override { |
aura::Window* next_activatable = |
test_focus_rules()->GetNextActivatableWindow(window); |
ui::test::EventGenerator generator(root_window(), next_activatable); |
generator.ClickLeftButton(); |
} |
- virtual bool IsInputEvent() OVERRIDE { return true; } |
+ virtual bool IsInputEvent() override { return true; } |
DISALLOW_COPY_AND_ASSIGN(FocusControllerMouseEventTest); |
}; |
@@ -946,21 +946,21 @@ class FocusControllerGestureEventTest : public FocusControllerDirectTestBase { |
private: |
// Overridden from FocusControllerTestBase: |
- virtual void FocusWindowDirect(aura::Window* window) OVERRIDE { |
+ virtual void FocusWindowDirect(aura::Window* window) override { |
ui::test::EventGenerator generator(root_window(), window); |
generator.GestureTapAt(window->bounds().CenterPoint()); |
} |
- virtual void ActivateWindowDirect(aura::Window* window) OVERRIDE { |
+ virtual void ActivateWindowDirect(aura::Window* window) override { |
ui::test::EventGenerator generator(root_window(), window); |
generator.GestureTapAt(window->bounds().CenterPoint()); |
} |
- virtual void DeactivateWindowDirect(aura::Window* window) OVERRIDE { |
+ virtual void DeactivateWindowDirect(aura::Window* window) override { |
aura::Window* next_activatable = |
test_focus_rules()->GetNextActivatableWindow(window); |
ui::test::EventGenerator generator(root_window(), next_activatable); |
generator.GestureTapAt(window->bounds().CenterPoint()); |
} |
- virtual bool IsInputEvent() OVERRIDE { return true; } |
+ virtual bool IsInputEvent() override { return true; } |
DISALLOW_COPY_AND_ASSIGN(FocusControllerGestureEventTest); |
}; |
@@ -984,7 +984,7 @@ class FocusControllerImplicitTestBase : public FocusControllerTestBase { |
virtual void PostDispostionChangeExpectations() {} |
// Overridden from FocusControllerTestBase: |
- virtual void BasicFocus() OVERRIDE { |
+ virtual void BasicFocus() override { |
EXPECT_EQ(NULL, GetFocusedWindow()); |
aura::Window* w211 = root_window()->GetChildById(211); |
@@ -995,7 +995,7 @@ class FocusControllerImplicitTestBase : public FocusControllerTestBase { |
// BasicFocusRules passes focus to the parent. |
EXPECT_EQ(parent_ ? 2 : 21, GetFocusedWindowId()); |
} |
- virtual void BasicActivation() OVERRIDE { |
+ virtual void BasicActivation() override { |
DCHECK(!parent_) << "Activation tests don't support parent changes."; |
EXPECT_EQ(NULL, GetActiveWindow()); |
@@ -1008,7 +1008,7 @@ class FocusControllerImplicitTestBase : public FocusControllerTestBase { |
EXPECT_EQ(3, GetActiveWindowId()); |
PostDispostionChangeExpectations(); |
} |
- virtual void FocusEvents() OVERRIDE { |
+ virtual void FocusEvents() override { |
aura::Window* w211 = root_window()->GetChildById(211); |
FocusWindow(w211); |
@@ -1021,7 +1021,7 @@ class FocusControllerImplicitTestBase : public FocusControllerTestBase { |
root_observer.ExpectCounts(0, 1); |
observer211.ExpectCounts(0, 1); |
} |
- virtual void ActivationEvents() OVERRIDE { |
+ virtual void ActivationEvents() override { |
DCHECK(!parent_) << "Activation tests don't support parent changes."; |
aura::Window* w2 = root_window()->GetChildById(2); |
@@ -1039,7 +1039,7 @@ class FocusControllerImplicitTestBase : public FocusControllerTestBase { |
observer2.ExpectCounts(1, 1); |
observer3.ExpectCounts(1, 1); |
} |
- virtual void FocusRulesOverride() OVERRIDE { |
+ virtual void FocusRulesOverride() override { |
EXPECT_EQ(NULL, GetFocusedWindow()); |
aura::Window* w211 = root_window()->GetChildById(211); |
FocusWindow(w211); |
@@ -1053,7 +1053,7 @@ class FocusControllerImplicitTestBase : public FocusControllerTestBase { |
test_focus_rules()->set_focus_restriction(NULL); |
} |
- virtual void ActivationRulesOverride() OVERRIDE { |
+ virtual void ActivationRulesOverride() override { |
DCHECK(!parent_) << "Activation tests don't support parent changes."; |
aura::Window* w1 = root_window()->GetChildById(1); |
@@ -1096,7 +1096,7 @@ class FocusControllerHideTest : public FocusControllerImplicitTestBase { |
: FocusControllerImplicitTestBase(parent) {} |
// Overridden from FocusControllerImplicitTestBase: |
- virtual void ChangeWindowDisposition(aura::Window* window) OVERRIDE { |
+ virtual void ChangeWindowDisposition(aura::Window* window) override { |
GetDispositionWindow(window)->Hide(); |
} |
@@ -1124,7 +1124,7 @@ class FocusControllerDestructionTest : public FocusControllerImplicitTestBase { |
: FocusControllerImplicitTestBase(parent) {} |
// Overridden from FocusControllerImplicitTestBase: |
- virtual void ChangeWindowDisposition(aura::Window* window) OVERRIDE { |
+ virtual void ChangeWindowDisposition(aura::Window* window) override { |
delete GetDispositionWindow(window); |
} |
@@ -1153,12 +1153,12 @@ class FocusControllerRemovalTest : public FocusControllerImplicitTestBase { |
: FocusControllerImplicitTestBase(parent) {} |
// Overridden from FocusControllerImplicitTestBase: |
- virtual void ChangeWindowDisposition(aura::Window* window) OVERRIDE { |
+ virtual void ChangeWindowDisposition(aura::Window* window) override { |
aura::Window* disposition_window = GetDispositionWindow(window); |
disposition_window->parent()->RemoveChild(disposition_window); |
window_owner_.reset(disposition_window); |
} |
- virtual void TearDown() OVERRIDE { |
+ virtual void TearDown() override { |
window_owner_.reset(); |
FocusControllerImplicitTestBase::TearDown(); |
} |