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

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

Issue 2859363003: cros: Initial structure for views-based lock. (Closed)
Patch Set: Address comments 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
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" 9 #include "chrome/browser/ui/ash/ash_util.h"
10 #include "services/ui/public/cpp/property_type_converters.h" 10 #include "services/ui/public/cpp/property_type_converters.h"
11 #include "services/ui/public/interfaces/window_manager.mojom.h" 11 #include "services/ui/public/interfaces/window_manager.mojom.h"
12 #include "ui/aura/window.h" 12 #include "ui/aura/window.h"
13 #include "ui/events/gestures/gesture_recognizer.h" 13 #include "ui/events/gestures/gesture_recognizer.h"
14 14
15 namespace chromeos { 15 namespace chromeos {
16 16
17 LockWindow::LockWindow(views::View* initially_focused_view) 17 LockWindow::LockWindow() {
18 : initially_focused_view_(initially_focused_view) {
19 ui::GestureRecognizer::Get()->CancelActiveTouchesExcept(nullptr); 18 ui::GestureRecognizer::Get()->CancelActiveTouchesExcept(nullptr);
20 19
21 views::Widget::InitParams params( 20 views::Widget::InitParams params(
22 views::Widget::InitParams::TYPE_WINDOW_FRAMELESS); 21 views::Widget::InitParams::TYPE_WINDOW_FRAMELESS);
23 params.delegate = this; 22 params.delegate = this;
24 params.show_state = ui::SHOW_STATE_FULLSCREEN; 23 params.show_state = ui::SHOW_STATE_FULLSCREEN;
25 params.opacity = views::Widget::InitParams::TRANSLUCENT_WINDOW; 24 params.opacity = views::Widget::InitParams::TRANSLUCENT_WINDOW;
26 const int kLockContainer = ash::kShellWindowId_LockScreenContainer; 25 const int kLockContainer = ash::kShellWindowId_LockScreenContainer;
27 if (ash_util::IsRunningInMash()) { 26 if (ash_util::IsRunningInMash()) {
28 using ui::mojom::WindowManager; 27 using ui::mojom::WindowManager;
(...skipping 11 matching lines...) Expand all
40 39
41 views::Widget* LockWindow::GetWidget() { 40 views::Widget* LockWindow::GetWidget() {
42 return this; 41 return this;
43 } 42 }
44 43
45 const views::Widget* LockWindow::GetWidget() const { 44 const views::Widget* LockWindow::GetWidget() const {
46 return this; 45 return this;
47 } 46 }
48 47
49 views::View* LockWindow::GetInitiallyFocusedView() { 48 views::View* LockWindow::GetInitiallyFocusedView() {
50 return initially_focused_view_; 49 // There are multiple GetContentsView definitions; use the views::Widget one.
50 return views::Widget::GetContentsView();
51 } 51 }
52 52
53 } // namespace chromeos 53 } // namespace chromeos
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698