| 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_change_observer.h" | 10 #include "ui/aura/client/activation_change_observer.h" |
| (...skipping 832 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 843 } | 843 } |
| 844 | 844 |
| 845 ui::EventResult NativeWidgetAura::OnGestureEvent(ui::GestureEvent* event) { | 845 ui::EventResult NativeWidgetAura::OnGestureEvent(ui::GestureEvent* event) { |
| 846 DCHECK(window_->IsVisible()); | 846 DCHECK(window_->IsVisible()); |
| 847 return delegate_->OnGestureEvent(event); | 847 return delegate_->OnGestureEvent(event); |
| 848 } | 848 } |
| 849 | 849 |
| 850 //////////////////////////////////////////////////////////////////////////////// | 850 //////////////////////////////////////////////////////////////////////////////// |
| 851 // NativeWidgetAura, aura::ActivationDelegate implementation: | 851 // NativeWidgetAura, aura::ActivationDelegate implementation: |
| 852 | 852 |
| 853 bool NativeWidgetAura::ShouldActivate() const { | 853 bool NativeWidgetAura::ShouldActivate(const ui::Event* event) { |
| 854 return can_activate_ && delegate_->CanActivate(); | 854 return can_activate_ && delegate_->CanActivate(); |
| 855 } | 855 } |
| 856 | 856 |
| 857 void NativeWidgetAura::OnActivated() { | 857 void NativeWidgetAura::OnActivated() { |
| 858 if (GetWidget()->HasFocusManager()) | 858 if (GetWidget()->HasFocusManager()) |
| 859 GetWidget()->GetFocusManager()->RestoreFocusedView(); | 859 GetWidget()->GetFocusManager()->RestoreFocusedView(); |
| 860 delegate_->OnNativeWidgetActivationChanged(true); | 860 delegate_->OnNativeWidgetActivationChanged(true); |
| 861 if (IsVisible() && GetWidget()->non_client_view()) | 861 if (IsVisible() && GetWidget()->non_client_view()) |
| 862 GetWidget()->non_client_view()->SchedulePaint(); | 862 GetWidget()->non_client_view()->SchedulePaint(); |
| 863 } | 863 } |
| (...skipping 196 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1060 return aura::Env::GetInstance()->is_mouse_button_down(); | 1060 return aura::Env::GetInstance()->is_mouse_button_down(); |
| 1061 } | 1061 } |
| 1062 | 1062 |
| 1063 // static | 1063 // static |
| 1064 bool NativeWidgetPrivate::IsTouchDown() { | 1064 bool NativeWidgetPrivate::IsTouchDown() { |
| 1065 return aura::Env::GetInstance()->is_touch_down(); | 1065 return aura::Env::GetInstance()->is_touch_down(); |
| 1066 } | 1066 } |
| 1067 | 1067 |
| 1068 } // namespace internal | 1068 } // namespace internal |
| 1069 } // namespace views | 1069 } // namespace views |
| OLD | NEW |