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/native_widget_aura.h" | 5 #include "ui/views/widget/native_widget_aura.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/string_util.h" | 8 #include "base/string_util.h" |
9 #include "third_party/skia/include/core/SkRegion.h" | 9 #include "third_party/skia/include/core/SkRegion.h" |
10 #include "ui/aura/client/activation_client.h" | 10 #include "ui/aura/client/activation_client.h" |
(...skipping 755 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
766 } | 766 } |
767 | 767 |
768 //////////////////////////////////////////////////////////////////////////////// | 768 //////////////////////////////////////////////////////////////////////////////// |
769 // NativeWidgetAura, aura::ActivationDelegate implementation: | 769 // NativeWidgetAura, aura::ActivationDelegate implementation: |
770 | 770 |
771 bool NativeWidgetAura::ShouldActivate(aura::Event* event) { | 771 bool NativeWidgetAura::ShouldActivate(aura::Event* event) { |
772 return can_activate_ && delegate_->CanActivate(); | 772 return can_activate_ && delegate_->CanActivate(); |
773 } | 773 } |
774 | 774 |
775 void NativeWidgetAura::OnActivated() { | 775 void NativeWidgetAura::OnActivated() { |
776 if (GetWidget()->HasFocusManager()) | 776 GetWidget()->GetFocusManager()->RestoreFocusedView(); |
777 GetWidget()->GetFocusManager()->RestoreFocusedView(); | |
778 delegate_->OnNativeWidgetActivationChanged(true); | 777 delegate_->OnNativeWidgetActivationChanged(true); |
779 if (IsVisible() && GetWidget()->non_client_view()) | 778 if (IsVisible() && GetWidget()->non_client_view()) |
780 GetWidget()->non_client_view()->SchedulePaint(); | 779 GetWidget()->non_client_view()->SchedulePaint(); |
781 } | 780 } |
782 | 781 |
783 void NativeWidgetAura::OnLostActive() { | 782 void NativeWidgetAura::OnLostActive() { |
784 if (GetWidget()->HasFocusManager()) | 783 GetWidget()->GetFocusManager()->StoreFocusedView(); |
785 GetWidget()->GetFocusManager()->StoreFocusedView(); | |
786 delegate_->OnNativeWidgetActivationChanged(false); | 784 delegate_->OnNativeWidgetActivationChanged(false); |
787 if (IsVisible() && GetWidget()->non_client_view()) | 785 if (IsVisible() && GetWidget()->non_client_view()) |
788 GetWidget()->non_client_view()->SchedulePaint(); | 786 GetWidget()->non_client_view()->SchedulePaint(); |
789 } | 787 } |
790 | 788 |
791 //////////////////////////////////////////////////////////////////////////////// | 789 //////////////////////////////////////////////////////////////////////////////// |
792 // NativeWidgetAura, aura::WindowDragDropDelegate implementation: | 790 // NativeWidgetAura, aura::WindowDragDropDelegate implementation: |
793 | 791 |
794 void NativeWidgetAura::OnDragEntered(const aura::DropTargetEvent& event) { | 792 void NativeWidgetAura::OnDragEntered(const aura::DropTargetEvent& event) { |
795 DCHECK(drop_helper_.get() != NULL); | 793 DCHECK(drop_helper_.get() != NULL); |
(...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
920 } | 918 } |
921 } | 919 } |
922 | 920 |
923 // static | 921 // static |
924 bool NativeWidgetPrivate::IsMouseButtonDown() { | 922 bool NativeWidgetPrivate::IsMouseButtonDown() { |
925 return aura::Env::GetInstance()->is_mouse_button_down(); | 923 return aura::Env::GetInstance()->is_mouse_button_down(); |
926 } | 924 } |
927 | 925 |
928 } // namespace internal | 926 } // namespace internal |
929 } // namespace views | 927 } // namespace views |
OLD | NEW |