| 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/widget.h" | 5 #include "ui/views/widget/widget.h" |
| 6 | 6 |
| 7 #include "base/debug/trace_event.h" | 7 #include "base/debug/trace_event.h" |
| 8 #include "base/logging.h" | 8 #include "base/logging.h" |
| 9 #include "base/message_loop/message_loop.h" | 9 #include "base/message_loop/message_loop.h" |
| 10 #include "base/strings/utf_string_conversions.h" | 10 #include "base/strings/utf_string_conversions.h" |
| (...skipping 1016 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1027 SaveWindowPlacement(); | 1027 SaveWindowPlacement(); |
| 1028 | 1028 |
| 1029 FOR_EACH_OBSERVER(WidgetObserver, observers_, | 1029 FOR_EACH_OBSERVER(WidgetObserver, observers_, |
| 1030 OnWidgetActivationChanged(this, active)); | 1030 OnWidgetActivationChanged(this, active)); |
| 1031 | 1031 |
| 1032 if (IsVisible() && non_client_view()) | 1032 if (IsVisible() && non_client_view()) |
| 1033 non_client_view()->frame_view()->SchedulePaint(); | 1033 non_client_view()->frame_view()->SchedulePaint(); |
| 1034 } | 1034 } |
| 1035 | 1035 |
| 1036 void Widget::OnNativeFocus(gfx::NativeView old_focused_view) { | 1036 void Widget::OnNativeFocus(gfx::NativeView old_focused_view) { |
| 1037 // Ensure the focused view's TextInputClient is used for text input. |
| 1038 views::FocusManager* focus_manager = GetFocusManager(); |
| 1039 focus_manager->FocusTextInputClient(focus_manager->GetFocusedView()); |
| 1040 |
| 1037 WidgetFocusManager::GetInstance()->OnWidgetFocusEvent(old_focused_view, | 1041 WidgetFocusManager::GetInstance()->OnWidgetFocusEvent(old_focused_view, |
| 1038 GetNativeView()); | 1042 GetNativeView()); |
| 1039 } | 1043 } |
| 1040 | 1044 |
| 1041 void Widget::OnNativeBlur(gfx::NativeView new_focused_view) { | 1045 void Widget::OnNativeBlur(gfx::NativeView new_focused_view) { |
| 1046 // Ensure the focused view's TextInputClient is not used for text input. |
| 1047 views::FocusManager* focus_manager = GetFocusManager(); |
| 1048 focus_manager->BlurTextInputClient(focus_manager->GetFocusedView()); |
| 1049 |
| 1042 WidgetFocusManager::GetInstance()->OnWidgetFocusEvent(GetNativeView(), | 1050 WidgetFocusManager::GetInstance()->OnWidgetFocusEvent(GetNativeView(), |
| 1043 new_focused_view); | 1051 new_focused_view); |
| 1044 } | 1052 } |
| 1045 | 1053 |
| 1046 void Widget::OnNativeWidgetVisibilityChanging(bool visible) { | 1054 void Widget::OnNativeWidgetVisibilityChanging(bool visible) { |
| 1047 FOR_EACH_OBSERVER(WidgetObserver, observers_, | 1055 FOR_EACH_OBSERVER(WidgetObserver, observers_, |
| 1048 OnWidgetVisibilityChanging(this, visible)); | 1056 OnWidgetVisibilityChanging(this, visible)); |
| 1049 } | 1057 } |
| 1050 | 1058 |
| 1051 void Widget::OnNativeWidgetVisibilityChanged(bool visible) { | 1059 void Widget::OnNativeWidgetVisibilityChanged(bool visible) { |
| (...skipping 451 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1503 | 1511 |
| 1504 //////////////////////////////////////////////////////////////////////////////// | 1512 //////////////////////////////////////////////////////////////////////////////// |
| 1505 // internal::NativeWidgetPrivate, NativeWidget implementation: | 1513 // internal::NativeWidgetPrivate, NativeWidget implementation: |
| 1506 | 1514 |
| 1507 internal::NativeWidgetPrivate* NativeWidgetPrivate::AsNativeWidgetPrivate() { | 1515 internal::NativeWidgetPrivate* NativeWidgetPrivate::AsNativeWidgetPrivate() { |
| 1508 return this; | 1516 return this; |
| 1509 } | 1517 } |
| 1510 | 1518 |
| 1511 } // namespace internal | 1519 } // namespace internal |
| 1512 } // namespace views | 1520 } // namespace views |
| OLD | NEW |