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

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

Issue 1610823003: Migrate call sites LoginDisplayHostImpl::default_host to LoginDisplayHost. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@fix-add-supervised-user
Patch Set: Address comments Created 4 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/startup_utils.h" 11 #include "chrome/browser/chromeos/login/startup_utils.h"
12 #include "chrome/browser/chromeos/login/ui/login_display_host_impl.h" 12 #include "chrome/browser/chromeos/login/ui/login_display_host.h"
13 #include "chrome/browser/chromeos/login/ui/user_adding_screen.h" 13 #include "chrome/browser/chromeos/login/ui/user_adding_screen.h"
14 #include "chrome/browser/chromeos/login/ui/webui_login_view.h" 14 #include "chrome/browser/chromeos/login/ui/webui_login_view.h"
15 #include "chrome/browser/chromeos/login/users/wallpaper/wallpaper_manager.h" 15 #include "chrome/browser/chromeos/login/users/wallpaper/wallpaper_manager.h"
16 #include "chrome/browser/profiles/profile_manager.h" 16 #include "chrome/browser/profiles/profile_manager.h"
17 #include "chrome/browser/ui/browser_window.h" 17 #include "chrome/browser/ui/browser_window.h"
18 #include "chrome/grit/chromium_strings.h" 18 #include "chrome/grit/chromium_strings.h"
19 #include "chrome/grit/generated_resources.h" 19 #include "chrome/grit/generated_resources.h"
20 #include "chromeos/login/user_names.h" 20 #include "chromeos/login/user_names.h"
21 #include "components/signin/core/account_id/account_id.h" 21 #include "components/signin/core/account_id/account_id.h"
22 #include "components/user_manager/user_manager.h" 22 #include "components/user_manager/user_manager.h"
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after
90 // TODO(nkostylev): Cleanup this condition, 90 // TODO(nkostylev): Cleanup this condition,
91 // see http://crbug.com/157885 and http://crbug.com/158255. 91 // see http://crbug.com/157885 and http://crbug.com/158255.
92 // Allow this call only before user sign in or at lock screen. 92 // Allow this call only before user sign in or at lock screen.
93 // If this call is made after new user signs in but login screen is still 93 // If this call is made after new user signs in but login screen is still
94 // around that would trigger a sign in extension refresh. 94 // around that would trigger a sign in extension refresh.
95 if (is_enabled && (!user_manager::UserManager::Get()->IsUserLoggedIn() || 95 if (is_enabled && (!user_manager::UserManager::Get()->IsUserLoggedIn() ||
96 ScreenLocker::default_screen_locker())) { 96 ScreenLocker::default_screen_locker())) {
97 ClearAndEnablePassword(); 97 ClearAndEnablePassword();
98 } 98 }
99 99
100 if (chromeos::LoginDisplayHost* host = 100 LoginDisplayHost* host = LoginDisplayHost::default_host();
101 chromeos::LoginDisplayHostImpl::default_host()) { 101 if (host && host->GetWebUILoginView())
102 if (chromeos::WebUILoginView* login_view = host->GetWebUILoginView()) 102 host->GetWebUILoginView()->SetUIEnabled(is_enabled);
103 login_view->SetUIEnabled(is_enabled);
104 }
105 } 103 }
106 104
107 void WebUILoginDisplay::ShowError(int error_msg_id, 105 void WebUILoginDisplay::ShowError(int error_msg_id,
108 int login_attempts, 106 int login_attempts,
109 HelpAppLauncher::HelpTopic help_topic_id) { 107 HelpAppLauncher::HelpTopic help_topic_id) {
110 VLOG(1) << "Show error, error_id: " << error_msg_id 108 VLOG(1) << "Show error, error_id: " << error_msg_id
111 << ", attempts:" << login_attempts 109 << ", attempts:" << login_attempts
112 << ", help_topic_id: " << help_topic_id; 110 << ", help_topic_id: " << help_topic_id;
113 if (!webui_handler_) 111 if (!webui_handler_)
114 return; 112 return;
(...skipping 207 matching lines...) Expand 10 before | Expand all | Expand 10 after
322 } 320 }
323 321
324 bool WebUILoginDisplay::IsUserWhitelisted(const AccountId& account_id) { 322 bool WebUILoginDisplay::IsUserWhitelisted(const AccountId& account_id) {
325 DCHECK(delegate_); 323 DCHECK(delegate_);
326 if (delegate_) 324 if (delegate_)
327 return delegate_->IsUserWhitelisted(account_id); 325 return delegate_->IsUserWhitelisted(account_id);
328 return true; 326 return true;
329 } 327 }
330 328
331 } // namespace chromeos 329 } // namespace chromeos
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698