OLD | NEW |
---|---|
(Empty) | |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | |
2 // Use of this source code is governed by a BSD-style license that can be | |
3 // found in the LICENSE file. | |
4 | |
5 #include "chrome/browser/chromeos/login/lock_window_aura.h" | |
6 #include "ui/aura/desktop.h" | |
7 #include "ui/aura/window.h" | |
8 #include "ui/aura_shell/shell.h" | |
9 #include "ui/aura_shell/shell_window_ids.h" | |
10 | |
11 namespace chromeos { | |
12 | |
13 LockWindow* LockWindow::Create() { | |
14 LockWindowAura* window = new LockWindowAura(); | |
15 return window; | |
16 } | |
17 | |
18 LockWindowAura::LockWindowAura() : views::Widget() { | |
19 Init(); | |
20 } | |
21 | |
22 //////////////////////////////////////////////////////////////////////////////// | |
23 // LockWindow implementation: | |
24 void LockWindowAura::SetContentsView(views::View* content) { | |
25 views::Widget::SetContentsView(content); | |
26 } | |
27 | |
28 void LockWindowAura::Show(DOMView* dom_view) { | |
29 views::Widget::Show(); | |
30 // We already have grab from the lock screen container, just call the ready | |
31 // callback immediately. | |
32 if (observer_) | |
33 observer_->OnLockWindowReady(); | |
34 } | |
35 | |
36 views::Widget* LockWindowAura::GetWidget() { | |
37 return this; | |
38 } | |
39 | |
40 //////////////////////////////////////////////////////////////////////////////// | |
41 // LockWindowAura private: | |
42 void LockWindowAura::Init() { | |
43 gfx::Rect bounds(aura::Desktop::GetInstance()->GetHostSize()); | |
44 views::Widget::InitParams params( | |
45 views::Widget::InitParams::TYPE_WINDOW_FRAMELESS); | |
46 params.bounds = bounds; | |
oshima
2011/11/29 20:18:06
nit: or just = gfx::Rect(aura::Desktop...)
up to y
flackr
2011/11/30 20:16:54
Done.
| |
47 params.parent = aura_shell::Shell::GetInstance()->GetContainer( | |
48 aura_shell::internal::kShellWindowId_LockScreenContainer); | |
49 views::Widget::Init(params); | |
50 } | |
51 | |
52 } // namespace chromeos | |
OLD | NEW |