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

Side by Side Diff: ui/views/widget/native_widget_aura.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: Address sky@'s comments 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/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/strings/string_util.h" 8 #include "base/strings/string_util.h"
9 #include "build/build_config.h" 9 #include "build/build_config.h"
10 #include "third_party/skia/include/core/SkRegion.h" 10 #include "third_party/skia/include/core/SkRegion.h"
(...skipping 471 matching lines...) Expand 10 before | Expand all | Expand 10 after
482 482
483 void NativeWidgetAura::ShowWithWindowState(ui::WindowShowState state) { 483 void NativeWidgetAura::ShowWithWindowState(ui::WindowShowState state) {
484 if (!window_) 484 if (!window_)
485 return; 485 return;
486 486
487 if (state == ui::SHOW_STATE_MAXIMIZED || state == ui::SHOW_STATE_FULLSCREEN || 487 if (state == ui::SHOW_STATE_MAXIMIZED || state == ui::SHOW_STATE_FULLSCREEN ||
488 state == ui::SHOW_STATE_DOCKED) { 488 state == ui::SHOW_STATE_DOCKED) {
489 window_->SetProperty(aura::client::kShowStateKey, state); 489 window_->SetProperty(aura::client::kShowStateKey, state);
490 } 490 }
491 window_->Show(); 491 window_->Show();
492 if (delegate_->CanActivate()) { 492 if (delegate_->CanActivate() && wm::CanActivateWindow(window_)) {
sky 2016/03/03 20:22:47 I think this is the wrong place for the fix. If yo
xdai1 2016/03/03 22:01:31 You're right. Since the goal is to prevent SetInit
sky 2016/03/03 23:39:33 What is SetInitialFocus doing that is wrong? I thi
493 if (state != ui::SHOW_STATE_INACTIVE) 493 if (state != ui::SHOW_STATE_INACTIVE)
494 Activate(); 494 Activate();
495 // SetInitialFocus() should be always be called, even for 495 // SetInitialFocus() should be always be called, even for
496 // SHOW_STATE_INACTIVE. If the window has to stay inactive, the method will 496 // SHOW_STATE_INACTIVE. If the window has to stay inactive, the method will
497 // do the right thing. 497 // do the right thing.
498 SetInitialFocus(state); 498 SetInitialFocus(state);
499 } 499 }
500 500
501 // On desktop aura, a window is activated first even when it is shown as 501 // On desktop aura, a window is activated first even when it is shown as
502 // minimized. Do the same for consistency. 502 // minimized. Do the same for consistency.
(...skipping 664 matching lines...) Expand 10 before | Expand all | Expand 10 after
1167 l10n_util::AdjustUIFont(&(ncm.lfCaptionFont)); 1167 l10n_util::AdjustUIFont(&(ncm.lfCaptionFont));
1168 base::win::ScopedHFONT caption_font(CreateFontIndirect(&(ncm.lfCaptionFont))); 1168 base::win::ScopedHFONT caption_font(CreateFontIndirect(&(ncm.lfCaptionFont)));
1169 return gfx::FontList(gfx::Font(caption_font.get())); 1169 return gfx::FontList(gfx::Font(caption_font.get()));
1170 #else 1170 #else
1171 return gfx::FontList(); 1171 return gfx::FontList();
1172 #endif 1172 #endif
1173 } 1173 }
1174 1174
1175 } // namespace internal 1175 } // namespace internal
1176 } // namespace views 1176 } // namespace views
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698