| Index: ash/login/ui/lock_screen.cc
|
| diff --git a/ash/login/ui/lock_screen.cc b/ash/login/ui/lock_screen.cc
|
| index baaf5bfd80b602c59fc51ead9cfa6aae0027c8f9..245cc77d51e6d1669f5b1c6d67632eb070a32707 100644
|
| --- a/ash/login/ui/lock_screen.cc
|
| +++ b/ash/login/ui/lock_screen.cc
|
| @@ -6,21 +6,37 @@
|
|
|
| #include "ash/login/ui/lock_contents_view.h"
|
| #include "ash/login/ui/lock_window.h"
|
| +#include "components/user_manager/user_manager.h"
|
| #include "ui/display/display.h"
|
| #include "ui/display/screen.h"
|
| #include "ui/views/widget/widget.h"
|
|
|
| namespace ash {
|
|
|
| +namespace {
|
| +// Reference to global lock screen instance. There can only ever be one lock
|
| +// screen display at the same time.
|
| +LockWindow* window_ = nullptr;
|
| +} // namespace
|
| +
|
| bool ShowLockScreen() {
|
| - LockWindow* window = new LockWindow();
|
| - window->SetBounds(display::Screen::GetScreen()->GetPrimaryDisplay().bounds());
|
| + CHECK(!window_);
|
| + window_ = new LockWindow();
|
| + window_->SetBounds(
|
| + display::Screen::GetScreen()->GetPrimaryDisplay().bounds());
|
| +
|
| + auto* contents = new LockContentsView();
|
|
|
| - views::View* contents = new LockContentsView();
|
| - window->SetContentsView(contents);
|
| - window->Show();
|
| + window_->SetContentsView(contents);
|
| + window_->Show();
|
|
|
| return true;
|
| }
|
|
|
| +void DestroyLockScreen() {
|
| + CHECK(window_);
|
| + window_->Close();
|
| + window_ = nullptr;
|
| +}
|
| +
|
| } // namespace ash
|
|
|