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/logging.h" | 7 #include "base/logging.h" |
8 #include "base/macros.h" | 8 #include "base/macros.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 1289 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1300 // If not focusing the window now, tell the focus manager which view to | 1300 // If not focusing the window now, tell the focus manager which view to |
1301 // focus when the window is restored. | 1301 // focus when the window is restored. |
1302 if (v && focus_manager) | 1302 if (v && focus_manager) |
1303 focus_manager->SetStoredFocusView(v); | 1303 focus_manager->SetStoredFocusView(v); |
1304 return true; | 1304 return true; |
1305 } | 1305 } |
1306 if (v) { | 1306 if (v) { |
1307 v->RequestFocus(); | 1307 v->RequestFocus(); |
1308 // If the request for focus was unsuccessful, fall back to using the first | 1308 // If the request for focus was unsuccessful, fall back to using the first |
1309 // focusable View instead. | 1309 // focusable View instead. |
1310 if (focus_manager && focus_manager->GetFocusedView() == nullptr) | 1310 if (focus_manager && focus_manager->GetFocusedView() == nullptr && |
1311 focus_manager->GetStoredFocusView() == nullptr) { | |
sky
2017/02/10 18:18:18
Can you clarify why we end up here? I'm specifical
Patti Lor
2017/02/15 03:15:21
The RequestFocus() call doesn't really fail, it ju
sky
2017/02/15 16:28:28
In that case can you check the active status rathe
Patti Lor
2017/02/16 22:58:49
Done.
| |
1311 focus_manager->AdvanceFocus(false); | 1312 focus_manager->AdvanceFocus(false); |
1313 } | |
1312 } | 1314 } |
1313 return !!focus_manager->GetFocusedView(); | 1315 return !!focus_manager->GetFocusedView(); |
1314 } | 1316 } |
1315 | 1317 |
1316 bool Widget::ShouldDescendIntoChildForEventHandling( | 1318 bool Widget::ShouldDescendIntoChildForEventHandling( |
1317 ui::Layer* root_layer, | 1319 ui::Layer* root_layer, |
1318 gfx::NativeView child, | 1320 gfx::NativeView child, |
1319 ui::Layer* child_layer, | 1321 ui::Layer* child_layer, |
1320 const gfx::Point& location) { | 1322 const gfx::Point& location) { |
1321 if (widget_delegate_ && | 1323 if (widget_delegate_ && |
(...skipping 222 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1544 | 1546 |
1545 //////////////////////////////////////////////////////////////////////////////// | 1547 //////////////////////////////////////////////////////////////////////////////// |
1546 // internal::NativeWidgetPrivate, NativeWidget implementation: | 1548 // internal::NativeWidgetPrivate, NativeWidget implementation: |
1547 | 1549 |
1548 internal::NativeWidgetPrivate* NativeWidgetPrivate::AsNativeWidgetPrivate() { | 1550 internal::NativeWidgetPrivate* NativeWidgetPrivate::AsNativeWidgetPrivate() { |
1549 return this; | 1551 return this; |
1550 } | 1552 } |
1551 | 1553 |
1552 } // namespace internal | 1554 } // namespace internal |
1553 } // namespace views | 1555 } // namespace views |
OLD | NEW |