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

Side by Side Diff: chrome/browser/browser_main.cc

Issue 2458002: Initialize screen locker before letting user logged in. (Closed) Base URL: http://src.chromium.org/git/chromium.git
Patch Set: fix login_browsertest Created 10 years, 6 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 | « no previous file | chrome/browser/chromeos/login/login_browsertest.cc » ('j') | 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) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 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/browser_main.h" 5 #include "chrome/browser/browser_main.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <string> 8 #include <string>
9 #include <vector> 9 #include <vector>
10 10
(...skipping 597 matching lines...) Expand 10 before | Expand all | Expand 10 after
608 // Allow the size of the login window to be set explicitly. If not set, 608 // Allow the size of the login window to be set explicitly. If not set,
609 // default to the entire screen. This is mostly useful for testing. 609 // default to the entire screen. This is mostly useful for testing.
610 if (size_arg.size()) { 610 if (size_arg.size()) {
611 std::vector<std::string> dimensions; 611 std::vector<std::string> dimensions;
612 SplitString(size_arg, ',', &dimensions); 612 SplitString(size_arg, ',', &dimensions);
613 if (dimensions.size() == 2) 613 if (dimensions.size() == 2)
614 size.SetSize(StringToInt(dimensions[0]), StringToInt(dimensions[1])); 614 size.SetSize(StringToInt(dimensions[0]), StringToInt(dimensions[1]));
615 } 615 }
616 browser::ShowLoginWizard(first_screen, size); 616 browser::ShowLoginWizard(first_screen, size);
617 } 617 }
618 chromeos::ScreenLocker::InitClass();
619 } 618 }
620 #else 619 #else
621 void OptionallyRunChromeOSLoginManager(const CommandLine& parsed_command_line) { 620 void OptionallyRunChromeOSLoginManager(const CommandLine& parsed_command_line) {
622 // Dummy empty function for non-ChromeOS builds to avoid extra ifdefs below. 621 // Dummy empty function for non-ChromeOS builds to avoid extra ifdefs below.
623 } 622 }
624 #endif 623 #endif
625 624
626 #if defined(OS_MACOSX) 625 #if defined(OS_MACOSX)
627 OSStatus KeychainCallback(SecKeychainEvent keychain_event, 626 OSStatus KeychainCallback(SecKeychainEvent keychain_event,
628 SecKeychainCallbackInfo *info, void *context) { 627 SecKeychainCallbackInfo *info, void *context) {
(...skipping 401 matching lines...) Expand 10 before | Expand all | Expand 10 after
1030 default: 1029 default:
1031 NOTREACHED(); 1030 NOTREACHED();
1032 } 1031 }
1033 #if !defined(OS_MACOSX) // closing brace for if 1032 #if !defined(OS_MACOSX) // closing brace for if
1034 } 1033 }
1035 #endif 1034 #endif
1036 1035
1037 // Profile creation ---------------------------------------------------------- 1036 // Profile creation ----------------------------------------------------------
1038 1037
1039 #if defined(OS_CHROMEOS) 1038 #if defined(OS_CHROMEOS)
1039 // Initialize the screen locker now so that it can receive
1040 // LOGIN_USER_CHANGED notification from UserManager.
1041 chromeos::ScreenLocker::InitClass();
1042
1040 // This forces the ProfileManager to be created and register for the 1043 // This forces the ProfileManager to be created and register for the
1041 // notification it needs to track the logged in user. 1044 // notification it needs to track the logged in user.
1042 g_browser_process->profile_manager()->GetDefaultProfile(); 1045 g_browser_process->profile_manager()->GetDefaultProfile();
1043 1046
1044 if (parsed_command_line.HasSwitch(switches::kLoginUser)) { 1047 if (parsed_command_line.HasSwitch(switches::kLoginUser)) {
1045 std::string username = 1048 std::string username =
1046 parsed_command_line.GetSwitchValueASCII(switches::kLoginUser); 1049 parsed_command_line.GetSwitchValueASCII(switches::kLoginUser);
1047 LOG(INFO) << "Relaunching browser for user: " << username; 1050 LOG(INFO) << "Relaunching browser for user: " << username;
1048 chromeos::UserManager::Get()->UserLoggedIn(username); 1051 chromeos::UserManager::Get()->UserLoggedIn(username);
1049 } 1052 }
(...skipping 262 matching lines...) Expand 10 before | Expand all | Expand 10 after
1312 1315
1313 metrics->Stop(); 1316 metrics->Stop();
1314 1317
1315 // browser_shutdown takes care of deleting browser_process, so we need to 1318 // browser_shutdown takes care of deleting browser_process, so we need to
1316 // release it. 1319 // release it.
1317 ignore_result(browser_process.release()); 1320 ignore_result(browser_process.release());
1318 browser_shutdown::Shutdown(); 1321 browser_shutdown::Shutdown();
1319 1322
1320 return result_code; 1323 return result_code;
1321 } 1324 }
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/chromeos/login/login_browsertest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698