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

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

Issue 833893003: Move UserActivityDetector to ui/base/user_activity/. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: don't build test on android Created 5 years, 11 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/webui_login_display.h" 5 #include "chrome/browser/chromeos/login/ui/webui_login_display.h"
6 6
7 #include "chrome/browser/chromeos/accessibility/accessibility_manager.h" 7 #include "chrome/browser/chromeos/accessibility/accessibility_manager.h"
8 #include "chrome/browser/chromeos/login/lock/screen_locker.h" 8 #include "chrome/browser/chromeos/login/lock/screen_locker.h"
9 #include "chrome/browser/chromeos/login/screens/chrome_user_selection_screen.h" 9 #include "chrome/browser/chromeos/login/screens/chrome_user_selection_screen.h"
10 #include "chrome/browser/chromeos/login/signin_screen_controller.h" 10 #include "chrome/browser/chromeos/login/signin_screen_controller.h"
11 #include "chrome/browser/chromeos/login/ui/login_display_host_impl.h" 11 #include "chrome/browser/chromeos/login/ui/login_display_host_impl.h"
12 #include "chrome/browser/chromeos/login/ui/user_adding_screen.h" 12 #include "chrome/browser/chromeos/login/ui/user_adding_screen.h"
13 #include "chrome/browser/chromeos/login/ui/webui_login_view.h" 13 #include "chrome/browser/chromeos/login/ui/webui_login_view.h"
14 #include "chrome/browser/profiles/profile_manager.h" 14 #include "chrome/browser/profiles/profile_manager.h"
15 #include "chrome/browser/ui/browser_window.h" 15 #include "chrome/browser/ui/browser_window.h"
16 #include "chrome/grit/chromium_strings.h" 16 #include "chrome/grit/chromium_strings.h"
17 #include "chrome/grit/generated_resources.h" 17 #include "chrome/grit/generated_resources.h"
18 #include "chromeos/login/user_names.h" 18 #include "chromeos/login/user_names.h"
19 #include "components/user_manager/user_manager.h" 19 #include "components/user_manager/user_manager.h"
20 #include "grit/components_strings.h" 20 #include "grit/components_strings.h"
21 #include "ui/base/ime/chromeos/ime_keyboard.h" 21 #include "ui/base/ime/chromeos/ime_keyboard.h"
22 #include "ui/base/ime/chromeos/input_method_manager.h" 22 #include "ui/base/ime/chromeos/input_method_manager.h"
23 #include "ui/base/l10n/l10n_util.h" 23 #include "ui/base/l10n/l10n_util.h"
24 #include "ui/base/user_activity/user_activity_detector.h"
24 #include "ui/views/widget/widget.h" 25 #include "ui/views/widget/widget.h"
25 #include "ui/wm/core/user_activity_detector.h"
26 26
27 #if !defined(USE_ATHENA) 27 #if !defined(USE_ATHENA)
28 #include "chrome/browser/chromeos/login/users/wallpaper/wallpaper_manager.h" 28 #include "chrome/browser/chromeos/login/users/wallpaper/wallpaper_manager.h"
29 #endif 29 #endif
30 30
31 namespace chromeos { 31 namespace chromeos {
32 32
33 // WebUILoginDisplay, public: -------------------------------------------------- 33 // WebUILoginDisplay, public: --------------------------------------------------
34 34
35 WebUILoginDisplay::~WebUILoginDisplay() { 35 WebUILoginDisplay::~WebUILoginDisplay() {
36 if (webui_handler_) 36 if (webui_handler_)
37 webui_handler_->ResetSigninScreenHandlerDelegate(); 37 webui_handler_->ResetSigninScreenHandlerDelegate();
38 wm::UserActivityDetector* activity_detector = wm::UserActivityDetector::Get(); 38 ui::UserActivityDetector* activity_detector = ui::UserActivityDetector::Get();
39 if (activity_detector->HasObserver(this)) 39 if (activity_detector->HasObserver(this))
40 activity_detector->RemoveObserver(this); 40 activity_detector->RemoveObserver(this);
41 } 41 }
42 42
43 // LoginDisplay implementation: ------------------------------------------------ 43 // LoginDisplay implementation: ------------------------------------------------
44 44
45 WebUILoginDisplay::WebUILoginDisplay(LoginDisplay::Delegate* delegate) 45 WebUILoginDisplay::WebUILoginDisplay(LoginDisplay::Delegate* delegate)
46 : LoginDisplay(delegate, gfx::Rect()), 46 : LoginDisplay(delegate, gfx::Rect()),
47 show_guest_(false), 47 show_guest_(false),
48 show_new_user_(false), 48 show_new_user_(false),
49 webui_handler_(NULL) { 49 webui_handler_(NULL) {
50 } 50 }
51 51
52 void WebUILoginDisplay::ClearAndEnablePassword() { 52 void WebUILoginDisplay::ClearAndEnablePassword() {
53 if (webui_handler_) 53 if (webui_handler_)
54 webui_handler_->ClearAndEnablePassword(); 54 webui_handler_->ClearAndEnablePassword();
55 } 55 }
56 56
57 void WebUILoginDisplay::Init(const user_manager::UserList& users, 57 void WebUILoginDisplay::Init(const user_manager::UserList& users,
58 bool show_guest, 58 bool show_guest,
59 bool show_users, 59 bool show_users,
60 bool show_new_user) { 60 bool show_new_user) {
61 // Testing that the delegate has been set. 61 // Testing that the delegate has been set.
62 DCHECK(delegate_); 62 DCHECK(delegate_);
63 SignInScreenController::Get()->Init(users, show_guest); 63 SignInScreenController::Get()->Init(users, show_guest);
64 show_guest_ = show_guest; 64 show_guest_ = show_guest;
65 show_users_ = show_users; 65 show_users_ = show_users;
66 show_new_user_ = show_new_user; 66 show_new_user_ = show_new_user;
67 67
68 wm::UserActivityDetector* activity_detector = wm::UserActivityDetector::Get(); 68 ui::UserActivityDetector* activity_detector = ui::UserActivityDetector::Get();
69 if (!activity_detector->HasObserver(this)) 69 if (!activity_detector->HasObserver(this))
70 activity_detector->AddObserver(this); 70 activity_detector->AddObserver(this);
71 } 71 }
72 72
73 // ---- Common methods 73 // ---- Common methods
74 74
75 // ---- User selection screen methods 75 // ---- User selection screen methods
76 76
77 void WebUILoginDisplay::HandleGetUsers() { 77 void WebUILoginDisplay::HandleGetUsers() {
78 SignInScreenController::Get()->SendUserList(); 78 SignInScreenController::Get()->SendUserList();
(...skipping 251 matching lines...) Expand 10 before | Expand all | Expand 10 after
330 delegate_->Signout(); 330 delegate_->Signout();
331 } 331 }
332 332
333 void WebUILoginDisplay::OnUserActivity(const ui::Event* event) { 333 void WebUILoginDisplay::OnUserActivity(const ui::Event* event) {
334 if (delegate_) 334 if (delegate_)
335 delegate_->ResetPublicSessionAutoLoginTimer(); 335 delegate_->ResetPublicSessionAutoLoginTimer();
336 } 336 }
337 337
338 338
339 } // namespace chromeos 339 } // namespace chromeos
OLDNEW
« no previous file with comments | « chrome/browser/chromeos/login/ui/webui_login_display.h ('k') | chrome/browser/chromeos/policy/recommendation_restorer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698