Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1121)

Side by Side Diff: chrome/browser/chromeos/login/ui/lock_window.cc

Issue 2836163002: mash: Shell ref clean up for screen lock (Closed)
Patch Set: rebase, fix compile Created 3 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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.h" 5 #include "chrome/browser/chromeos/login/ui/lock_window.h"
6 6
7 #include "ash/public/cpp/shell_window_ids.h" 7 #include "ash/public/cpp/shell_window_ids.h"
8 #include "ash/shell.h" 8 #include "ash/shell.h"
9 #include "chrome/browser/ui/ash/ash_util.h"
10 #include "services/ui/public/cpp/property_type_converters.h"
11 #include "services/ui/public/interfaces/window_manager.mojom.h"
9 #include "ui/aura/window.h" 12 #include "ui/aura/window.h"
10 #include "ui/events/gestures/gesture_recognizer.h" 13 #include "ui/events/gestures/gesture_recognizer.h"
11 14
12 namespace chromeos { 15 namespace chromeos {
13 16
14 LockWindow::LockWindow(views::View* initially_focused_view) 17 LockWindow::LockWindow(views::View* initially_focused_view)
15 : initially_focused_view_(initially_focused_view) { 18 : initially_focused_view_(initially_focused_view) {
16 ui::GestureRecognizer::Get()->CancelActiveTouchesExcept(nullptr); 19 ui::GestureRecognizer::Get()->CancelActiveTouchesExcept(nullptr);
17 20
18 views::Widget::InitParams params( 21 views::Widget::InitParams params(
19 views::Widget::InitParams::TYPE_WINDOW_FRAMELESS); 22 views::Widget::InitParams::TYPE_WINDOW_FRAMELESS);
20 params.delegate = this; 23 params.delegate = this;
21 params.show_state = ui::SHOW_STATE_FULLSCREEN; 24 params.show_state = ui::SHOW_STATE_FULLSCREEN;
22 params.opacity = views::Widget::InitParams::TRANSLUCENT_WINDOW; 25 params.opacity = views::Widget::InitParams::TRANSLUCENT_WINDOW;
23 params.parent = 26 const int kLockContainer = ash::kShellWindowId_LockScreenContainer;
24 ash::Shell::GetContainer(ash::Shell::GetPrimaryRootWindow(), 27 if (ash_util::IsRunningInMash()) {
25 ash::kShellWindowId_LockScreenContainer); 28 using ui::mojom::WindowManager;
29 params.mus_properties[WindowManager::kContainerId_InitProperty] =
30 mojo::ConvertTo<std::vector<uint8_t>>(kLockContainer);
31 } else {
32 params.parent = ash::Shell::GetContainer(ash::Shell::GetPrimaryRootWindow(),
33 kLockContainer);
34 }
26 Init(params); 35 Init(params);
27 SetVisibilityAnimationTransition(views::Widget::ANIMATE_NONE); 36 SetVisibilityAnimationTransition(views::Widget::ANIMATE_NONE);
28 } 37 }
29 38
30 LockWindow::~LockWindow() {} 39 LockWindow::~LockWindow() {}
31 40
32 views::Widget* LockWindow::GetWidget() { 41 views::Widget* LockWindow::GetWidget() {
33 return this; 42 return this;
34 } 43 }
35 44
36 const views::Widget* LockWindow::GetWidget() const { 45 const views::Widget* LockWindow::GetWidget() const {
37 return this; 46 return this;
38 } 47 }
39 48
40 views::View* LockWindow::GetInitiallyFocusedView() { 49 views::View* LockWindow::GetInitiallyFocusedView() {
41 return initially_focused_view_; 50 return initially_focused_view_;
42 } 51 }
43 52
44 } // namespace chromeos 53 } // namespace chromeos
OLDNEW
« no previous file with comments | « chrome/browser/chromeos/login/lock/webui_screen_locker.cc ('k') | chrome/browser/ui/ash/session_controller_client.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698