OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/session_state_delegate.h" | 5 #include "ash/session_state_delegate.h" |
6 #include "ash/shell.h" | 6 #include "ash/shell.h" |
7 #include "ash/shell/example_factory.h" | 7 #include "ash/shell/example_factory.h" |
8 #include "ash/shell_window_ids.h" | 8 #include "ash/shell_window_ids.h" |
9 #include "base/strings/utf_string_conversions.h" | 9 #include "base/strings/utf_string_conversions.h" |
10 #include "ui/aura/window.h" | 10 #include "ui/aura/window.h" |
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
87 views::Widget* widget = new views::Widget; | 87 views::Widget* widget = new views::Widget; |
88 views::Widget::InitParams params( | 88 views::Widget::InitParams params( |
89 views::Widget::InitParams::TYPE_WINDOW_FRAMELESS); | 89 views::Widget::InitParams::TYPE_WINDOW_FRAMELESS); |
90 gfx::Size ps = lock_view->GetPreferredSize(); | 90 gfx::Size ps = lock_view->GetPreferredSize(); |
91 | 91 |
92 gfx::Size root_window_size = Shell::GetPrimaryRootWindow()->bounds().size(); | 92 gfx::Size root_window_size = Shell::GetPrimaryRootWindow()->bounds().size(); |
93 params.bounds = gfx::Rect((root_window_size.width() - ps.width()) / 2, | 93 params.bounds = gfx::Rect((root_window_size.width() - ps.width()) / 2, |
94 (root_window_size.height() - ps.height()) / 2, | 94 (root_window_size.height() - ps.height()) / 2, |
95 ps.width(), ps.height()); | 95 ps.width(), ps.height()); |
96 params.delegate = lock_view; | 96 params.delegate = lock_view; |
97 params.parent = Shell::GetContainer( | 97 params.parent = Shell::GetContainer(Shell::GetPrimaryRootWindow(), |
98 Shell::GetPrimaryRootWindow(), | 98 kShellWindowId_LockScreenContainer); |
99 internal::kShellWindowId_LockScreenContainer); | |
100 widget->Init(params); | 99 widget->Init(params); |
101 widget->SetContentsView(lock_view); | 100 widget->SetContentsView(lock_view); |
102 widget->Show(); | 101 widget->Show(); |
103 widget->GetNativeView()->SetName("LockView"); | 102 widget->GetNativeView()->SetName("LockView"); |
104 widget->GetNativeView()->Focus(); | 103 widget->GetNativeView()->Focus(); |
105 | 104 |
106 // TODO: it shouldn't be necessary to invoke UpdateTooltip() here. | 105 // TODO: it shouldn't be necessary to invoke UpdateTooltip() here. |
107 Shell::GetInstance()->tooltip_controller()->UpdateTooltip( | 106 Shell::GetInstance()->tooltip_controller()->UpdateTooltip( |
108 widget->GetNativeView()); | 107 widget->GetNativeView()); |
109 } | 108 } |
110 | 109 |
111 } // namespace shell | 110 } // namespace shell |
112 } // namespace ash | 111 } // namespace ash |
OLD | NEW |