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

Side by Side 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: Address sky@'s comment. 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 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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/test/widget_test.h" 5 #include "ui/views/test/widget_test.h"
6 6
7 #include "build/build_config.h" 7 #include "build/build_config.h"
8 #include "ui/gfx/native_widget_types.h" 8 #include "ui/gfx/native_widget_types.h"
9 #include "ui/views/test/native_widget_factory.h" 9 #include "ui/views/test/native_widget_factory.h"
10 #include "ui/views/widget/root_view.h" 10 #include "ui/views/widget/root_view.h"
(...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after
125 } 125 }
126 126
127 View* TestDesktopWidgetDelegate::GetContentsView() { 127 View* TestDesktopWidgetDelegate::GetContentsView() {
128 return contents_view_ ? contents_view_ : WidgetDelegate::GetContentsView(); 128 return contents_view_ ? contents_view_ : WidgetDelegate::GetContentsView();
129 } 129 }
130 130
131 bool TestDesktopWidgetDelegate::ShouldAdvanceFocusToTopLevelWidget() const { 131 bool TestDesktopWidgetDelegate::ShouldAdvanceFocusToTopLevelWidget() const {
132 return true; // Same default as DefaultWidgetDelegate in widget.cc. 132 return true; // Same default as DefaultWidgetDelegate in widget.cc.
133 } 133 }
134 134
135 TestInitialFocusWidgetDelegate::TestInitialFocusWidgetDelegate(
136 gfx::NativeWindow context)
137 : view_(new View) {
138 view_->SetFocusable(true);
139
140 Widget::InitParams params(Widget::InitParams::TYPE_WINDOW);
141 params.context = context;
142 InitWidget(params);
143 GetWidget()->GetContentsView()->AddChildView(view_);
144 }
145
146 TestInitialFocusWidgetDelegate::~TestInitialFocusWidgetDelegate() {}
147
148 View* TestInitialFocusWidgetDelegate::GetInitiallyFocusedView() {
149 return view_;
150 }
151
135 } // namespace test 152 } // namespace test
136 } // namespace views 153 } // namespace views
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698