OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 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 | 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 "ash/shell.h" | 5 #include "ash/shell.h" |
6 #include "ash/shell_window_ids.h" | 6 #include "ash/shell_window_ids.h" |
7 #include "ash/shell/example_factory.h" | 7 #include "ash/shell/example_factory.h" |
8 #include "base/utf_string_conversions.h" | 8 #include "base/utf_string_conversions.h" |
9 #include "ui/aura/root_window.h" | 9 #include "ui/aura/root_window.h" |
10 #include "ui/aura/window.h" | 10 #include "ui/aura/window.h" |
11 #include "ui/gfx/canvas.h" | 11 #include "ui/gfx/canvas.h" |
12 #include "ui/gfx/font.h" | 12 #include "ui/gfx/font.h" |
13 #include "ui/views/widget/widget.h" | 13 #include "ui/views/widget/widget.h" |
14 #include "ui/views/widget/widget_delegate.h" | 14 #include "ui/views/widget/widget_delegate.h" |
15 | 15 |
16 using aura_shell::Shell; | 16 using ash::Shell; |
17 | 17 |
18 namespace ash { | 18 namespace ash { |
19 namespace shell { | 19 namespace shell { |
20 | 20 |
21 class LockView : public views::WidgetDelegateView { | 21 class LockView : public views::WidgetDelegateView { |
22 public: | 22 public: |
23 LockView() {} | 23 LockView() {} |
24 virtual ~LockView() {} | 24 virtual ~LockView() {} |
25 | 25 |
26 // Overridden from View: | 26 // Overridden from View: |
(...skipping 29 matching lines...) Expand all Loading... |
56 views::Widget::InitParams params(views::Widget::InitParams::TYPE_CONTROL); | 56 views::Widget::InitParams params(views::Widget::InitParams::TYPE_CONTROL); |
57 gfx::Size ps = lock_view->GetPreferredSize(); | 57 gfx::Size ps = lock_view->GetPreferredSize(); |
58 | 58 |
59 gfx::Size root_window_size = aura::RootWindow::GetInstance()->GetHostSize(); | 59 gfx::Size root_window_size = aura::RootWindow::GetInstance()->GetHostSize(); |
60 params.bounds = gfx::Rect((root_window_size.width() - ps.width()) / 2, | 60 params.bounds = gfx::Rect((root_window_size.width() - ps.width()) / 2, |
61 (root_window_size.height() - ps.height()) / 2, | 61 (root_window_size.height() - ps.height()) / 2, |
62 ps.width(), ps.height()); | 62 ps.width(), ps.height()); |
63 params.delegate = lock_view; | 63 params.delegate = lock_view; |
64 widget->Init(params); | 64 widget->Init(params); |
65 Shell::GetInstance()->GetContainer( | 65 Shell::GetInstance()->GetContainer( |
66 aura_shell::internal::kShellWindowId_LockScreenContainer)-> | 66 ash::internal::kShellWindowId_LockScreenContainer)-> |
67 AddChild(widget->GetNativeView()); | 67 AddChild(widget->GetNativeView()); |
68 widget->SetContentsView(lock_view); | 68 widget->SetContentsView(lock_view); |
69 widget->Show(); | 69 widget->Show(); |
70 widget->GetNativeView()->SetName("LockView"); | 70 widget->GetNativeView()->SetName("LockView"); |
71 } | 71 } |
72 | 72 |
73 } // namespace shell | 73 } // namespace shell |
74 } // namespace ash | 74 } // namespace ash |
OLD | NEW |