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/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 1299 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1310 const Widget* Widget::AsWidget() const { | 1310 const Widget* Widget::AsWidget() const { |
| 1311 return this; | 1311 return this; |
| 1312 } | 1312 } |
| 1313 | 1313 |
| 1314 bool Widget::SetInitialFocus(ui::WindowShowState show_state) { | 1314 bool Widget::SetInitialFocus(ui::WindowShowState show_state) { |
| 1315 View* v = widget_delegate_->GetInitiallyFocusedView(); | 1315 View* v = widget_delegate_->GetInitiallyFocusedView(); |
| 1316 if (!focus_on_creation_ || show_state == ui::SHOW_STATE_INACTIVE || | 1316 if (!focus_on_creation_ || show_state == ui::SHOW_STATE_INACTIVE || |
| 1317 show_state == ui::SHOW_STATE_MINIMIZED) { | 1317 show_state == ui::SHOW_STATE_MINIMIZED) { |
| 1318 // If not focusing the window now, tell the focus manager which view to | 1318 // If not focusing the window now, tell the focus manager which view to |
| 1319 // focus when the window is restored. | 1319 // focus when the window is restored. |
| 1320 if (v) | 1320 if (v && focus_manager_) |
|
xdai1
2016/03/08 18:30:17
focus_manager_ is null for non top level windows.
sky
2016/03/08 22:42:04
A null focus_manager_ wasn't possible before, so i
xdai1
2016/03/10 01:12:57
According to the comment in https://code.google.co
| |
| 1321 focus_manager_->SetStoredFocusView(v); | 1321 focus_manager_->SetStoredFocusView(v); |
| 1322 return true; | 1322 return true; |
| 1323 } | 1323 } |
| 1324 if (v) | 1324 if (v) |
| 1325 v->RequestFocus(); | 1325 v->RequestFocus(); |
| 1326 return !!v; | 1326 return !!v; |
| 1327 } | 1327 } |
| 1328 | 1328 |
| 1329 //////////////////////////////////////////////////////////////////////////////// | 1329 //////////////////////////////////////////////////////////////////////////////// |
| 1330 // Widget, ui::EventSource implementation: | 1330 // Widget, ui::EventSource implementation: |
| (...skipping 165 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1496 | 1496 |
| 1497 //////////////////////////////////////////////////////////////////////////////// | 1497 //////////////////////////////////////////////////////////////////////////////// |
| 1498 // internal::NativeWidgetPrivate, NativeWidget implementation: | 1498 // internal::NativeWidgetPrivate, NativeWidget implementation: |
| 1499 | 1499 |
| 1500 internal::NativeWidgetPrivate* NativeWidgetPrivate::AsNativeWidgetPrivate() { | 1500 internal::NativeWidgetPrivate* NativeWidgetPrivate::AsNativeWidgetPrivate() { |
| 1501 return this; | 1501 return this; |
| 1502 } | 1502 } |
| 1503 | 1503 |
| 1504 } // namespace internal | 1504 } // namespace internal |
| 1505 } // namespace views | 1505 } // namespace views |
| OLD | NEW |