Chromium Code Reviews| 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 747 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 758 } | 758 } |
| 759 | 759 |
| 760 void NativeWidgetAura::OnWindowVisibilityChanged(bool visible) { | 760 void NativeWidgetAura::OnWindowVisibilityChanged(bool visible) { |
| 761 delegate_->OnNativeWidgetVisibilityChanged(visible); | 761 delegate_->OnNativeWidgetVisibilityChanged(visible); |
| 762 } | 762 } |
| 763 | 763 |
| 764 //////////////////////////////////////////////////////////////////////////////// | 764 //////////////////////////////////////////////////////////////////////////////// |
| 765 // NativeWidgetAura, aura::ActivationDelegate implementation: | 765 // NativeWidgetAura, aura::ActivationDelegate implementation: |
| 766 | 766 |
| 767 bool NativeWidgetAura::ShouldActivate(aura::Event* event) { | 767 bool NativeWidgetAura::ShouldActivate(aura::Event* event) { |
| 768 return can_activate_; | 768 return can_activate_ && delegate_->CanActivate(); |
|
Ben Goodger (Google)
2012/02/16 02:57:43
I don't think this can work... did you test this?
| |
| 769 } | 769 } |
| 770 | 770 |
| 771 void NativeWidgetAura::OnActivated() { | 771 void NativeWidgetAura::OnActivated() { |
| 772 GetWidget()->GetFocusManager()->RestoreFocusedView(); | 772 GetWidget()->GetFocusManager()->RestoreFocusedView(); |
| 773 delegate_->OnNativeWidgetActivationChanged(true); | 773 delegate_->OnNativeWidgetActivationChanged(true); |
| 774 if (IsVisible() && GetWidget()->non_client_view()) | 774 if (IsVisible() && GetWidget()->non_client_view()) |
| 775 GetWidget()->non_client_view()->SchedulePaint(); | 775 GetWidget()->non_client_view()->SchedulePaint(); |
| 776 } | 776 } |
| 777 | 777 |
| 778 void NativeWidgetAura::OnLostActive() { | 778 void NativeWidgetAura::OnLostActive() { |
| (...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 914 } | 914 } |
| 915 } | 915 } |
| 916 | 916 |
| 917 // static | 917 // static |
| 918 bool NativeWidgetPrivate::IsMouseButtonDown() { | 918 bool NativeWidgetPrivate::IsMouseButtonDown() { |
| 919 return aura::RootWindow::GetInstance()->IsMouseButtonDown(); | 919 return aura::RootWindow::GetInstance()->IsMouseButtonDown(); |
| 920 } | 920 } |
| 921 | 921 |
| 922 } // namespace internal | 922 } // namespace internal |
| 923 } // namespace views | 923 } // namespace views |
| OLD | NEW |