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/common/session/session_state_delegate.h" | 5 #include "ash/common/session/session_state_delegate.h" |
6 #include "ash/common/shell_window_ids.h" | 6 #include "ash/common/shell_window_ids.h" |
7 #include "ash/common/wm_shell.h" | 7 #include "ash/common/wm_shell.h" |
8 #include "ash/shell.h" | 8 #include "ash/shell.h" |
9 #include "ash/shell/example_factory.h" | 9 #include "ash/shell/example_factory.h" |
10 #include "base/strings/utf_string_conversions.h" | 10 #include "base/strings/utf_string_conversions.h" |
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
85 gfx::Size ps = lock_view->GetPreferredSize(); | 85 gfx::Size ps = lock_view->GetPreferredSize(); |
86 | 86 |
87 gfx::Size root_window_size = Shell::GetPrimaryRootWindow()->bounds().size(); | 87 gfx::Size root_window_size = Shell::GetPrimaryRootWindow()->bounds().size(); |
88 params.bounds = gfx::Rect((root_window_size.width() - ps.width()) / 2, | 88 params.bounds = gfx::Rect((root_window_size.width() - ps.width()) / 2, |
89 (root_window_size.height() - ps.height()) / 2, | 89 (root_window_size.height() - ps.height()) / 2, |
90 ps.width(), ps.height()); | 90 ps.width(), ps.height()); |
91 params.delegate = lock_view; | 91 params.delegate = lock_view; |
92 params.parent = Shell::GetContainer(Shell::GetPrimaryRootWindow(), | 92 params.parent = Shell::GetContainer(Shell::GetPrimaryRootWindow(), |
93 kShellWindowId_LockScreenContainer); | 93 kShellWindowId_LockScreenContainer); |
94 widget->Init(params); | 94 widget->Init(params); |
95 widget->SetContentsView(lock_view); | |
96 widget->Show(); | 95 widget->Show(); |
97 widget->GetNativeView()->SetName("LockView"); | 96 widget->GetNativeView()->SetName("LockView"); |
98 widget->GetNativeView()->Focus(); | 97 widget->GetNativeView()->Focus(); |
99 | 98 |
100 // TODO: it shouldn't be necessary to invoke UpdateTooltip() here. | 99 // TODO: it shouldn't be necessary to invoke UpdateTooltip() here. |
101 Shell::GetInstance()->tooltip_controller()->UpdateTooltip( | 100 Shell::GetInstance()->tooltip_controller()->UpdateTooltip( |
102 widget->GetNativeView()); | 101 widget->GetNativeView()); |
103 } | 102 } |
104 | 103 |
105 } // namespace shell | 104 } // namespace shell |
106 } // namespace ash | 105 } // namespace ash |
OLD | NEW |