| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "ui/views/widget/desktop_aura/desktop_native_widget_aura.h" | 5 #include "ui/views/widget/desktop_aura/desktop_native_widget_aura.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "ui/aura/client/stacking_client.h" | 8 #include "ui/aura/client/stacking_client.h" |
| 9 #include "ui/aura/focus_manager.h" | 9 #include "ui/aura/focus_manager.h" |
| 10 #include "ui/aura/root_window.h" | 10 #include "ui/aura/root_window.h" |
| (...skipping 562 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 573 } | 573 } |
| 574 | 574 |
| 575 ui::EventResult DesktopNativeWidgetAura::OnGestureEvent( | 575 ui::EventResult DesktopNativeWidgetAura::OnGestureEvent( |
| 576 ui::GestureEvent* event) { | 576 ui::GestureEvent* event) { |
| 577 return native_widget_delegate_->OnGestureEvent(event); | 577 return native_widget_delegate_->OnGestureEvent(event); |
| 578 } | 578 } |
| 579 | 579 |
| 580 //////////////////////////////////////////////////////////////////////////////// | 580 //////////////////////////////////////////////////////////////////////////////// |
| 581 // DesktopNativeWidgetAura, aura::ActivationDelegate implementation: | 581 // DesktopNativeWidgetAura, aura::ActivationDelegate implementation: |
| 582 | 582 |
| 583 bool DesktopNativeWidgetAura::ShouldActivate() const { | 583 bool DesktopNativeWidgetAura::ShouldActivate(const ui::Event* event) { |
| 584 return can_activate_ && native_widget_delegate_->CanActivate(); | 584 return can_activate_ && native_widget_delegate_->CanActivate(); |
| 585 } | 585 } |
| 586 | 586 |
| 587 void DesktopNativeWidgetAura::OnActivated() { | 587 void DesktopNativeWidgetAura::OnActivated() { |
| 588 if (GetWidget()->HasFocusManager()) | 588 if (GetWidget()->HasFocusManager()) |
| 589 GetWidget()->GetFocusManager()->RestoreFocusedView(); | 589 GetWidget()->GetFocusManager()->RestoreFocusedView(); |
| 590 native_widget_delegate_->OnNativeWidgetActivationChanged(true); | 590 native_widget_delegate_->OnNativeWidgetActivationChanged(true); |
| 591 if (IsVisible() && GetWidget()->non_client_view()) | 591 if (IsVisible() && GetWidget()->non_client_view()) |
| 592 GetWidget()->non_client_view()->SchedulePaint(); | 592 GetWidget()->non_client_view()->SchedulePaint(); |
| 593 } | 593 } |
| 594 | 594 |
| 595 void DesktopNativeWidgetAura::OnLostActive() { | 595 void DesktopNativeWidgetAura::OnLostActive() { |
| 596 native_widget_delegate_->OnNativeWidgetActivationChanged(false); | 596 native_widget_delegate_->OnNativeWidgetActivationChanged(false); |
| 597 if (IsVisible() && GetWidget()->non_client_view()) | 597 if (IsVisible() && GetWidget()->non_client_view()) |
| 598 GetWidget()->non_client_view()->SchedulePaint(); | 598 GetWidget()->non_client_view()->SchedulePaint(); |
| 599 } | 599 } |
| 600 | 600 |
| 601 } // namespace views | 601 } // namespace views |
| OLD | NEW |