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

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

Issue 2867173003: cros: Move LockWindow from chrome to ash (Closed)
Patch Set: Reorder patches so view -> ui lands first Created 3 years, 7 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
« no previous file with comments | « chrome/browser/chromeos/login/ui/lock_window.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
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
3 // found in the LICENSE file.
4
5 #include "chrome/browser/chromeos/login/ui/lock_window.h"
6
7 #include "ash/public/cpp/shell_window_ids.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"
12 #include "ui/aura/window.h"
13 #include "ui/events/gestures/gesture_recognizer.h"
14
15 namespace chromeos {
16
17 LockWindow::LockWindow() {
18 ui::GestureRecognizer::Get()->CancelActiveTouchesExcept(nullptr);
19
20 views::Widget::InitParams params(
21 views::Widget::InitParams::TYPE_WINDOW_FRAMELESS);
22 params.delegate = this;
23 params.show_state = ui::SHOW_STATE_FULLSCREEN;
24 params.opacity = views::Widget::InitParams::TRANSLUCENT_WINDOW;
25 const int kLockContainer = ash::kShellWindowId_LockScreenContainer;
26 if (ash_util::IsRunningInMash()) {
27 using ui::mojom::WindowManager;
28 params.mus_properties[WindowManager::kContainerId_InitProperty] =
29 mojo::ConvertTo<std::vector<uint8_t>>(kLockContainer);
30 } else {
31 params.parent = ash::Shell::GetContainer(ash::Shell::GetPrimaryRootWindow(),
32 kLockContainer);
33 }
34 Init(params);
35 SetVisibilityAnimationTransition(views::Widget::ANIMATE_NONE);
36 }
37
38 LockWindow::~LockWindow() {}
39
40 views::Widget* LockWindow::GetWidget() {
41 return this;
42 }
43
44 const views::Widget* LockWindow::GetWidget() const {
45 return this;
46 }
47
48 views::View* LockWindow::GetInitiallyFocusedView() {
49 // There are multiple GetContentsView definitions; use the views::Widget one.
50 return views::Widget::GetContentsView();
51 }
52
53 } // namespace chromeos
OLDNEW
« no previous file with comments | « chrome/browser/chromeos/login/ui/lock_window.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698