Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(659)

Side by Side Diff: ui/views/widget/widget.cc

Issue 1753473003: A window should not get activated or get input focus if it's behind the lock screen. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix the failed try jobs Created 4 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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
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
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698