Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 "chrome/browser/chromeos/login/ui/lock_window_aura.h" | 5 #include "chrome/browser/chromeos/login/ui/lock_window_aura.h" |
| 6 | 6 |
| 7 #include "ash/shell.h" | 7 #include "ash/shell.h" |
| 8 #include "ash/shell_window_ids.h" | 8 #include "ash/shell_window_ids.h" |
| 9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
| 10 #include "chrome/browser/profiles/profile_manager.h" | |
| 11 #include "chrome/browser/themes/theme_service.h" | |
| 12 #include "chrome/browser/themes/theme_service_factory.h" | |
| 13 #include "chrome/browser/ui/ash/multi_user/multi_user_util.h" | |
| 10 #include "ui/aura/window.h" | 14 #include "ui/aura/window.h" |
| 11 #include "ui/aura/window_event_dispatcher.h" | 15 #include "ui/aura/window_event_dispatcher.h" |
| 12 | 16 |
| 13 namespace chromeos { | 17 namespace chromeos { |
| 14 | 18 |
| 15 LockWindow* LockWindow::Create() { | 19 LockWindow* LockWindow::Create() { |
| 16 LockWindowAura* lock_window = new LockWindowAura(); | 20 LockWindowAura* lock_window = new LockWindowAura(); |
| 17 // Cancel existing touch events when screen is locked. | 21 // Cancel existing touch events when screen is locked. |
| 18 ui::GestureRecognizer::Get()->CancelActiveTouchesExcept(nullptr); | 22 ui::GestureRecognizer::Get()->CancelActiveTouchesExcept(nullptr); |
| 19 return lock_window; | 23 return lock_window; |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 54 void LockWindowAura::Init() { | 58 void LockWindowAura::Init() { |
| 55 views::Widget::InitParams params( | 59 views::Widget::InitParams params( |
| 56 views::Widget::InitParams::TYPE_WINDOW_FRAMELESS); | 60 views::Widget::InitParams::TYPE_WINDOW_FRAMELESS); |
| 57 params.delegate = this; | 61 params.delegate = this; |
| 58 params.show_state = ui::SHOW_STATE_FULLSCREEN; | 62 params.show_state = ui::SHOW_STATE_FULLSCREEN; |
| 59 params.opacity = views::Widget::InitParams::TRANSLUCENT_WINDOW; | 63 params.opacity = views::Widget::InitParams::TRANSLUCENT_WINDOW; |
| 60 // TODO(oshima): move the lock screen harness to ash. | 64 // TODO(oshima): move the lock screen harness to ash. |
| 61 params.parent = | 65 params.parent = |
| 62 ash::Shell::GetContainer(ash::Shell::GetPrimaryRootWindow(), | 66 ash::Shell::GetContainer(ash::Shell::GetPrimaryRootWindow(), |
| 63 ash::kShellWindowId_LockScreenContainer); | 67 ash::kShellWindowId_LockScreenContainer); |
| 68 // On login screen and logged in as an anonymous user you might not get a | |
| 69 // profile. Which indicates that multi-user is not active and an anonymous | |
|
tdanderson
2015/09/09 17:38:58
nit: change . to , between first two sentences (he
| |
| 70 // profile is in use. Take the active profile to find the theme. | |
| 71 Profile* profile = multi_user_util::GetProfileFromWindow(params.parent); | |
| 72 if (!profile) | |
| 73 profile = ProfileManager::GetActiveUserProfile(); | |
| 74 params.theme_provider = ThemeServiceFactory::GetForProfile(profile); | |
| 64 views::Widget::Init(params); | 75 views::Widget::Init(params); |
| 65 SetVisibilityAnimationTransition(views::Widget::ANIMATE_NONE); | 76 SetVisibilityAnimationTransition(views::Widget::ANIMATE_NONE); |
| 66 } | 77 } |
| 67 | 78 |
| 68 } // namespace chromeos | 79 } // namespace chromeos |
| OLD | NEW |