| 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 554 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 565 ui::ER_HANDLED : ui::ER_UNHANDLED; | 565 ui::ER_HANDLED : ui::ER_UNHANDLED; |
| 566 } else { | 566 } else { |
| 567 return native_widget_delegate_->OnScrollEvent(event); | 567 return native_widget_delegate_->OnScrollEvent(event); |
| 568 } | 568 } |
| 569 } | 569 } |
| 570 | 570 |
| 571 ui::EventResult DesktopNativeWidgetAura::OnTouchEvent(ui::TouchEvent* event) { | 571 ui::EventResult DesktopNativeWidgetAura::OnTouchEvent(ui::TouchEvent* event) { |
| 572 return native_widget_delegate_->OnTouchEvent(event); | 572 return native_widget_delegate_->OnTouchEvent(event); |
| 573 } | 573 } |
| 574 | 574 |
| 575 ui::EventResult DesktopNativeWidgetAura::OnGestureEvent( | 575 void DesktopNativeWidgetAura::OnGestureEvent(ui::GestureEvent* event) { |
| 576 ui::GestureEvent* event) { | 576 native_widget_delegate_->OnGestureEvent(event); |
| 577 return native_widget_delegate_->OnGestureEvent(event); | |
| 578 } | 577 } |
| 579 | 578 |
| 580 //////////////////////////////////////////////////////////////////////////////// | 579 //////////////////////////////////////////////////////////////////////////////// |
| 581 // DesktopNativeWidgetAura, aura::ActivationDelegate implementation: | 580 // DesktopNativeWidgetAura, aura::ActivationDelegate implementation: |
| 582 | 581 |
| 583 bool DesktopNativeWidgetAura::ShouldActivate() const { | 582 bool DesktopNativeWidgetAura::ShouldActivate() const { |
| 584 return can_activate_ && native_widget_delegate_->CanActivate(); | 583 return can_activate_ && native_widget_delegate_->CanActivate(); |
| 585 } | 584 } |
| 586 | 585 |
| 587 void DesktopNativeWidgetAura::OnActivated() { | 586 void DesktopNativeWidgetAura::OnActivated() { |
| 588 if (GetWidget()->HasFocusManager()) | 587 if (GetWidget()->HasFocusManager()) |
| 589 GetWidget()->GetFocusManager()->RestoreFocusedView(); | 588 GetWidget()->GetFocusManager()->RestoreFocusedView(); |
| 590 native_widget_delegate_->OnNativeWidgetActivationChanged(true); | 589 native_widget_delegate_->OnNativeWidgetActivationChanged(true); |
| 591 if (IsVisible() && GetWidget()->non_client_view()) | 590 if (IsVisible() && GetWidget()->non_client_view()) |
| 592 GetWidget()->non_client_view()->SchedulePaint(); | 591 GetWidget()->non_client_view()->SchedulePaint(); |
| 593 } | 592 } |
| 594 | 593 |
| 595 void DesktopNativeWidgetAura::OnLostActive() { | 594 void DesktopNativeWidgetAura::OnLostActive() { |
| 596 native_widget_delegate_->OnNativeWidgetActivationChanged(false); | 595 native_widget_delegate_->OnNativeWidgetActivationChanged(false); |
| 597 if (IsVisible() && GetWidget()->non_client_view()) | 596 if (IsVisible() && GetWidget()->non_client_view()) |
| 598 GetWidget()->non_client_view()->SchedulePaint(); | 597 GetWidget()->non_client_view()->SchedulePaint(); |
| 599 } | 598 } |
| 600 | 599 |
| 601 } // namespace views | 600 } // namespace views |
| OLD | NEW |