| 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 841 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 852 // focus and doesn't expect a blur). OnBlur() shouldn't be called during | 852 // focus and doesn't expect a blur). OnBlur() shouldn't be called during |
| 853 // destruction unless WIDGET_OWNS_NATIVE_WIDGET is set (which is just the | 853 // destruction unless WIDGET_OWNS_NATIVE_WIDGET is set (which is just the |
| 854 // case in tests). | 854 // case in tests). |
| 855 if (!destroying_) { | 855 if (!destroying_) { |
| 856 if (GetWidget()->GetInputMethod()) | 856 if (GetWidget()->GetInputMethod()) |
| 857 GetWidget()->GetInputMethod()->OnBlur(); | 857 GetWidget()->GetInputMethod()->OnBlur(); |
| 858 } else { | 858 } else { |
| 859 DCHECK_EQ(ownership_, Widget::InitParams::WIDGET_OWNS_NATIVE_WIDGET); | 859 DCHECK_EQ(ownership_, Widget::InitParams::WIDGET_OWNS_NATIVE_WIDGET); |
| 860 } | 860 } |
| 861 | 861 |
| 862 delegate_->OnNativeBlur( | 862 aura::client::FocusClient* client = aura::client::GetFocusClient(window_); |
| 863 aura::client::GetFocusClient(window_)->GetFocusedWindow()); | 863 if (client) // NULL during destruction of aura::Window. |
| 864 delegate_->OnNativeBlur(client->GetFocusedWindow()); |
| 864 } | 865 } |
| 865 } | 866 } |
| 866 | 867 |
| 867 //////////////////////////////////////////////////////////////////////////////// | 868 //////////////////////////////////////////////////////////////////////////////// |
| 868 // NativeWidgetAura, aura::WindowDragDropDelegate implementation: | 869 // NativeWidgetAura, aura::WindowDragDropDelegate implementation: |
| 869 | 870 |
| 870 void NativeWidgetAura::OnDragEntered(const ui::DropTargetEvent& event) { | 871 void NativeWidgetAura::OnDragEntered(const ui::DropTargetEvent& event) { |
| 871 DCHECK(drop_helper_.get() != NULL); | 872 DCHECK(drop_helper_.get() != NULL); |
| 872 last_drop_operation_ = drop_helper_->OnDragOver(event.data(), | 873 last_drop_operation_ = drop_helper_->OnDragOver(event.data(), |
| 873 event.location(), event.source_operations()); | 874 event.location(), event.source_operations()); |
| (...skipping 180 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1054 return aura::Env::GetInstance()->is_mouse_button_down(); | 1055 return aura::Env::GetInstance()->is_mouse_button_down(); |
| 1055 } | 1056 } |
| 1056 | 1057 |
| 1057 // static | 1058 // static |
| 1058 bool NativeWidgetPrivate::IsTouchDown() { | 1059 bool NativeWidgetPrivate::IsTouchDown() { |
| 1059 return aura::Env::GetInstance()->is_touch_down(); | 1060 return aura::Env::GetInstance()->is_touch_down(); |
| 1060 } | 1061 } |
| 1061 | 1062 |
| 1062 } // namespace internal | 1063 } // namespace internal |
| 1063 } // namespace views | 1064 } // namespace views |
| OLD | NEW |