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

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

Issue 8854007: Add checks to delegate in SigninScreenHandler (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 years 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 | Annotate | Revision Log
« no previous file with comments | « chrome/browser/chromeos/login/webui_login_display_host.cc ('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
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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/ui/webui/chromeos/login/signin_screen_handler.h" 5 #include "chrome/browser/ui/webui/chromeos/login/signin_screen_handler.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/bind_helpers.h" 8 #include "base/bind_helpers.h"
9 #include "base/command_line.h" 9 #include "base/command_line.h"
10 #include "base/hash_tables.h" 10 #include "base/hash_tables.h"
(...skipping 283 matching lines...) Expand 10 before | Expand all | Expand 10 after
294 l10n_util::GetStringUTF16(IDS_CREATE_ACCOUNT_HTML)); 294 l10n_util::GetStringUTF16(IDS_CREATE_ACCOUNT_HTML));
295 localized_strings->SetString("guestSignin", 295 localized_strings->SetString("guestSignin",
296 l10n_util::GetStringUTF16(IDS_BROWSE_WITHOUT_SIGNING_IN_HTML)); 296 l10n_util::GetStringUTF16(IDS_BROWSE_WITHOUT_SIGNING_IN_HTML));
297 localized_strings->SetString("removeUser", 297 localized_strings->SetString("removeUser",
298 l10n_util::GetStringUTF16(IDS_LOGIN_REMOVE)); 298 l10n_util::GetStringUTF16(IDS_LOGIN_REMOVE));
299 299
300 localized_strings->SetString("authType", "ext"); 300 localized_strings->SetString("authType", "ext");
301 } 301 }
302 302
303 void SigninScreenHandler::Show(bool oobe_ui) { 303 void SigninScreenHandler::Show(bool oobe_ui) {
304 CHECK(delegate_);
305
304 oobe_ui_ = oobe_ui; 306 oobe_ui_ = oobe_ui;
305 if (!page_is_ready()) { 307 if (!page_is_ready()) {
306 show_on_init_ = true; 308 show_on_init_ = true;
307 return; 309 return;
308 } 310 }
309 311
310 if (oobe_ui) { 312 if (oobe_ui) {
311 // Shows new user sign-in for OOBE. 313 // Shows new user sign-in for OOBE.
312 HandleShowAddUser(NULL); 314 HandleShowAddUser(NULL);
313 } else { 315 } else {
314 // Populates account picker. Animation is turned off for now until we 316 // Populates account picker. Animation is turned off for now until we
315 // figure out how to make it fast enough. 317 // figure out how to make it fast enough.
316 SendUserList(false); 318 SendUserList(false);
317 319
318 // Reset Caps Lock state when login screen is shown. 320 // Reset Caps Lock state when login screen is shown.
319 input_method::InputMethodManager::GetInstance()->GetXKeyboard()-> 321 input_method::InputMethodManager::GetInstance()->GetXKeyboard()->
320 SetCapsLockEnabled(false); 322 SetCapsLockEnabled(false);
321 323
322 ShowScreen(kAccountPickerScreen, NULL); 324 ShowScreen(kAccountPickerScreen, NULL);
323 } 325 }
324 } 326 }
325 327
326 void SigninScreenHandler::SetDelegate(SigninScreenHandlerDelegate* delegate) { 328 void SigninScreenHandler::SetDelegate(SigninScreenHandlerDelegate* delegate) {
329 CHECK(delegate);
327 delegate_ = delegate; 330 delegate_ = delegate;
328 DCHECK(delegate_);
329 delegate_->SetWebUIHandler(this); 331 delegate_->SetWebUIHandler(this);
330 } 332 }
331 333
332 // SigninScreenHandler, private: ----------------------------------------------- 334 // SigninScreenHandler, private: -----------------------------------------------
333 335
334 void SigninScreenHandler::Initialize() { 336 void SigninScreenHandler::Initialize() {
335 // Register for Caps Lock state change notifications; 337 // Register for Caps Lock state change notifications;
336 key_event_listener_ = SystemKeyEventListener::GetInstance(); 338 key_event_listener_ = SystemKeyEventListener::GetInstance();
337 if (key_event_listener_) 339 if (key_event_listener_)
338 key_event_listener_->AddCapsLockObserver(this); 340 key_event_listener_->AddCapsLockObserver(this);
(...skipping 409 matching lines...) Expand 10 before | Expand all | Expand 10 after
748 750
749 cookie_remover_ = new BrowsingDataRemover( 751 cookie_remover_ = new BrowsingDataRemover(
750 Profile::FromBrowserContext(web_ui_->tab_contents()->browser_context()), 752 Profile::FromBrowserContext(web_ui_->tab_contents()->browser_context()),
751 BrowsingDataRemover::EVERYTHING, 753 BrowsingDataRemover::EVERYTHING,
752 base::Time()); 754 base::Time());
753 cookie_remover_->AddObserver(this); 755 cookie_remover_->AddObserver(this);
754 cookie_remover_->Remove(BrowsingDataRemover::REMOVE_SITE_DATA); 756 cookie_remover_->Remove(BrowsingDataRemover::REMOVE_SITE_DATA);
755 } 757 }
756 758
757 } // namespace chromeos 759 } // namespace chromeos
OLDNEW
« no previous file with comments | « chrome/browser/chromeos/login/webui_login_display_host.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698