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

Unified Diff: ui/views/test/widget_test.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: Modify the test to use NativeWidgetAura when initializing widget. 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ui/views/test/widget_test.h ('k') | ui/views/widget/native_widget_aura.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/views/test/widget_test.cc
diff --git a/ui/views/test/widget_test.cc b/ui/views/test/widget_test.cc
index 9beca6d8d9e5cb18543e0103570f49f47fa27152..0f4b35139e5e7fecb013a791ca2194fe841a1f37 100644
--- a/ui/views/test/widget_test.cc
+++ b/ui/views/test/widget_test.cc
@@ -132,5 +132,23 @@ bool TestDesktopWidgetDelegate::ShouldAdvanceFocusToTopLevelWidget() const {
return true; // Same default as DefaultWidgetDelegate in widget.cc.
}
+TestInitialFocusWidgetDelegate::TestInitialFocusWidgetDelegate(
+ gfx::NativeWindow context)
+ : view_(new View) {
+ view_->SetFocusable(true);
+
+ Widget::InitParams params(Widget::InitParams::TYPE_WINDOW);
+ params.context = context;
+ params.delegate = this;
+ GetWidget()->Init(params);
+ GetWidget()->GetContentsView()->AddChildView(view_);
+}
+
+TestInitialFocusWidgetDelegate::~TestInitialFocusWidgetDelegate() {}
+
+View* TestInitialFocusWidgetDelegate::GetInitiallyFocusedView() {
+ return view_;
+}
+
} // namespace test
} // namespace views
« no previous file with comments | « ui/views/test/widget_test.h ('k') | ui/views/widget/native_widget_aura.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698