| OLD | NEW |
| 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/chrome_browser_main.h" | 5 #include "chrome/browser/chrome_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 405 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 416 Profile* CreateProfile(const MainFunctionParams& parameters, | 416 Profile* CreateProfile(const MainFunctionParams& parameters, |
| 417 const FilePath& user_data_dir, | 417 const FilePath& user_data_dir, |
| 418 const CommandLine& parsed_command_line) { | 418 const CommandLine& parsed_command_line) { |
| 419 Profile* profile; | 419 Profile* profile; |
| 420 if (ProfileManager::IsMultipleProfilesEnabled() && | 420 if (ProfileManager::IsMultipleProfilesEnabled() && |
| 421 parsed_command_line.HasSwitch(switches::kProfileDirectory)) { | 421 parsed_command_line.HasSwitch(switches::kProfileDirectory)) { |
| 422 g_browser_process->local_state()->SetString(prefs::kProfileLastUsed, | 422 g_browser_process->local_state()->SetString(prefs::kProfileLastUsed, |
| 423 parsed_command_line.GetSwitchValueASCII( | 423 parsed_command_line.GetSwitchValueASCII( |
| 424 switches::kProfileDirectory)); | 424 switches::kProfileDirectory)); |
| 425 } | 425 } |
| 426 #if defined(OS_CHROMEOS) |
| 427 // TODO(ivankr): http://crbug.com/83792 |
| 428 profile = g_browser_process->profile_manager()->GetDefaultProfile( |
| 429 user_data_dir); |
| 430 #else |
| 426 profile = g_browser_process->profile_manager()->GetLastUsedProfile( | 431 profile = g_browser_process->profile_manager()->GetLastUsedProfile( |
| 427 user_data_dir); | 432 user_data_dir); |
| 433 #endif |
| 428 if (profile) | 434 if (profile) |
| 429 return profile; | 435 return profile; |
| 430 | 436 |
| 431 #if defined(OS_WIN) | 437 #if defined(OS_WIN) |
| 432 #if defined(USE_AURA) | 438 #if defined(USE_AURA) |
| 433 // TODO(beng): | 439 // TODO(beng): |
| 434 NOTIMPLEMENTED(); | 440 NOTIMPLEMENTED(); |
| 435 #else | 441 #else |
| 436 // Ideally, we should be able to run w/o access to disk. For now, we | 442 // Ideally, we should be able to run w/o access to disk. For now, we |
| 437 // prompt the user to pick a different user-data-dir and restart chrome | 443 // prompt the user to pick a different user-data-dir and restart chrome |
| (...skipping 1688 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2126 if (env->GetVar(chrome::kPreReadEnvironmentVariable, &pre_read) && | 2132 if (env->GetVar(chrome::kPreReadEnvironmentVariable, &pre_read) && |
| 2127 (pre_read == "0" || pre_read == "1")) { | 2133 (pre_read == "0" || pre_read == "1")) { |
| 2128 std::string uma_name(name); | 2134 std::string uma_name(name); |
| 2129 uma_name += "_PreRead"; | 2135 uma_name += "_PreRead"; |
| 2130 uma_name += pre_read == "1" ? "Enabled" : "Disabled"; | 2136 uma_name += pre_read == "1" ? "Enabled" : "Disabled"; |
| 2131 AddPreReadHistogramTime(uma_name.c_str(), time); | 2137 AddPreReadHistogramTime(uma_name.c_str(), time); |
| 2132 } | 2138 } |
| 2133 #endif | 2139 #endif |
| 2134 #endif | 2140 #endif |
| 2135 } | 2141 } |
| OLD | NEW |