Commit 20e93c20 authored by Elly Fong-Jones's avatar Elly Fong-Jones Committed by Commit Bot

ash: remove LoginTestBase::WidgetDelegate

It is obsoleted by the ability to set the initially focused view on
WidgetDelegate.

Bug: 1075649
Change-Id: I668de102313c3923b3e385b85aa640718e4a1d37
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2450949Reviewed-by: default avatarXiyuan Xia <xiyuan@chromium.org>
Commit-Queue: Elly Fong-Jones <ellyjones@chromium.org>
Cr-Commit-Position: refs/heads/master@{#813849}
parent 5d3e0a1c
...@@ -20,27 +20,6 @@ ...@@ -20,27 +20,6 @@
namespace ash { namespace ash {
// A WidgetDelegate which ensures that |initially_focused| gets focus.
class LoginTestBase::WidgetDelegate : public views::WidgetDelegate {
public:
explicit WidgetDelegate(views::View* content) : content_(content) {
SetOwnedByWidget(true);
}
~WidgetDelegate() override = default;
// views::WidgetDelegate:
views::View* GetInitiallyFocusedView() override { return content_; }
views::Widget* GetWidget() override { return content_->GetWidget(); }
const views::Widget* GetWidget() const override {
return content_->GetWidget();
}
private:
views::View* content_;
DISALLOW_COPY_AND_ASSIGN(WidgetDelegate);
};
LoginTestBase::LoginTestBase() = default; LoginTestBase::LoginTestBase() = default;
LoginTestBase::~LoginTestBase() = default; LoginTestBase::~LoginTestBase() = default;
...@@ -76,7 +55,10 @@ std::unique_ptr<views::Widget> LoginTestBase::CreateWidgetWithContent( ...@@ -76,7 +55,10 @@ std::unique_ptr<views::Widget> LoginTestBase::CreateWidgetWithContent(
views::Widget::InitParams::TYPE_WINDOW_FRAMELESS); views::Widget::InitParams::TYPE_WINDOW_FRAMELESS);
params.ownership = views::Widget::InitParams::WIDGET_OWNS_NATIVE_WIDGET; params.ownership = views::Widget::InitParams::WIDGET_OWNS_NATIVE_WIDGET;
params.bounds = gfx::Rect(0, 0, 800, 800); params.bounds = gfx::Rect(0, 0, 800, 800);
params.delegate = new WidgetDelegate(content);
params.delegate = new views::WidgetDelegate();
params.delegate->SetInitiallyFocusedView(content);
params.delegate->SetOwnedByWidget(true);
// Set the widget to the lock screen container, since a test may change the // Set the widget to the lock screen container, since a test may change the
// session state to locked, which will hide all widgets not associated with // session state to locked, which will hide all widgets not associated with
......
...@@ -80,8 +80,6 @@ class LoginTestBase : public AshTestBase { ...@@ -80,8 +80,6 @@ class LoginTestBase : public AshTestBase {
void TearDown() override; void TearDown() override;
private: private:
class WidgetDelegate;
// The widget created using |ShowWidgetWithContent|. // The widget created using |ShowWidgetWithContent|.
std::unique_ptr<views::Widget> widget_; std::unique_ptr<views::Widget> widget_;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment