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 601 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
612 } | 612 } |
613 | 613 |
614 //////////////////////////////////////////////////////////////////////////////// | 614 //////////////////////////////////////////////////////////////////////////////// |
615 // DesktopNativeWidgetAura, aura::ActivationDelegate implementation: | 615 // DesktopNativeWidgetAura, aura::ActivationDelegate implementation: |
616 | 616 |
617 bool DesktopNativeWidgetAura::ShouldActivate() const { | 617 bool DesktopNativeWidgetAura::ShouldActivate() const { |
618 return can_activate_ && native_widget_delegate_->CanActivate(); | 618 return can_activate_ && native_widget_delegate_->CanActivate(); |
619 } | 619 } |
620 | 620 |
621 void DesktopNativeWidgetAura::OnActivated() { | 621 void DesktopNativeWidgetAura::OnActivated() { |
622 native_widget_delegate_->OnNativeWidgetActivationChanged(true); | |
623 if (IsVisible() && GetWidget()->non_client_view()) | 622 if (IsVisible() && GetWidget()->non_client_view()) |
624 GetWidget()->non_client_view()->SchedulePaint(); | 623 GetWidget()->non_client_view()->SchedulePaint(); |
625 } | 624 } |
626 | 625 |
627 void DesktopNativeWidgetAura::OnLostActive() { | 626 void DesktopNativeWidgetAura::OnLostActive() { |
628 native_widget_delegate_->OnNativeWidgetActivationChanged(false); | |
629 if (IsVisible() && GetWidget()->non_client_view()) | 627 if (IsVisible() && GetWidget()->non_client_view()) |
630 GetWidget()->non_client_view()->SchedulePaint(); | 628 GetWidget()->non_client_view()->SchedulePaint(); |
631 } | 629 } |
632 | 630 |
633 //////////////////////////////////////////////////////////////////////////////// | 631 //////////////////////////////////////////////////////////////////////////////// |
634 // DesktopNativeWidgetAura, views::internal::InputMethodDelegate: | 632 // DesktopNativeWidgetAura, views::internal::InputMethodDelegate: |
635 | 633 |
636 void DesktopNativeWidgetAura::DispatchKeyEventPostIME(const ui::KeyEvent& key) { | 634 void DesktopNativeWidgetAura::DispatchKeyEventPostIME(const ui::KeyEvent& key) { |
637 FocusManager* focus_manager = | 635 FocusManager* focus_manager = |
638 native_widget_delegate_->AsWidget()->GetFocusManager(); | 636 native_widget_delegate_->AsWidget()->GetFocusManager(); |
(...skipping 23 matching lines...) Expand all Loading... |
662 drop_helper_->OnDragExit(); | 660 drop_helper_->OnDragExit(); |
663 } | 661 } |
664 | 662 |
665 int DesktopNativeWidgetAura::OnPerformDrop(const ui::DropTargetEvent& event) { | 663 int DesktopNativeWidgetAura::OnPerformDrop(const ui::DropTargetEvent& event) { |
666 DCHECK(drop_helper_.get() != NULL); | 664 DCHECK(drop_helper_.get() != NULL); |
667 return drop_helper_->OnDrop(event.data(), event.location(), | 665 return drop_helper_->OnDrop(event.data(), event.location(), |
668 last_drop_operation_); | 666 last_drop_operation_); |
669 } | 667 } |
670 | 668 |
671 } // namespace views | 669 } // namespace views |
OLD | NEW |