OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 #if defined(TOOLKIT_GTK) | 7 #if defined(TOOLKIT_GTK) |
8 #include <gtk/gtk.h> | 8 #include <gtk/gtk.h> |
9 #endif | 9 #endif |
10 | 10 |
(...skipping 1234 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1245 } | 1245 } |
1246 | 1246 |
1247 // Profile creation ---------------------------------------------------------- | 1247 // Profile creation ---------------------------------------------------------- |
1248 | 1248 |
1249 if (do_first_run_tasks_) { | 1249 if (do_first_run_tasks_) { |
1250 // Warn the ProfileManager that an import process will run, possibly | 1250 // Warn the ProfileManager that an import process will run, possibly |
1251 // locking the WebDataService directory of the next Profile created. | 1251 // locking the WebDataService directory of the next Profile created. |
1252 browser_process_->profile_manager()->SetWillImport(); | 1252 browser_process_->profile_manager()->SetWillImport(); |
1253 } | 1253 } |
1254 | 1254 |
| 1255 // Called before CreateProfile because creating the profile can trigger |
| 1256 // calls to GetDefaultProfile(). |
| 1257 ProfileManager::AllowGetDefaultProfile(); |
| 1258 |
1255 profile_ = CreateProfile(parameters(), user_data_dir_, parsed_command_line()); | 1259 profile_ = CreateProfile(parameters(), user_data_dir_, parsed_command_line()); |
1256 if (!profile_) | 1260 if (!profile_) |
1257 return content::RESULT_CODE_NORMAL_EXIT; | 1261 return content::RESULT_CODE_NORMAL_EXIT; |
1258 | 1262 |
1259 #if defined(ENABLE_BACKGROUND) | 1263 #if defined(ENABLE_BACKGROUND) |
1260 // Autoload any profiles which are running background apps. | 1264 // Autoload any profiles which are running background apps. |
1261 // TODO(rlp): Do this on a separate thread. See http://crbug.com/99075. | 1265 // TODO(rlp): Do this on a separate thread. See http://crbug.com/99075. |
1262 browser_process_->profile_manager()->AutoloadProfiles(); | 1266 browser_process_->profile_manager()->AutoloadProfiles(); |
1263 #endif | 1267 #endif |
1264 // Post-profile init --------------------------------------------------------- | 1268 // Post-profile init --------------------------------------------------------- |
(...skipping 525 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1790 if (base::win::GetVersion() <= base::win::VERSION_XP) | 1794 if (base::win::GetVersion() <= base::win::VERSION_XP) |
1791 uma_name += "_XP"; | 1795 uma_name += "_XP"; |
1792 | 1796 |
1793 uma_name += "_PreRead_"; | 1797 uma_name += "_PreRead_"; |
1794 uma_name += pre_read_percentage; | 1798 uma_name += pre_read_percentage; |
1795 AddPreReadHistogramTime(uma_name.c_str(), time); | 1799 AddPreReadHistogramTime(uma_name.c_str(), time); |
1796 } | 1800 } |
1797 #endif | 1801 #endif |
1798 #endif | 1802 #endif |
1799 } | 1803 } |
OLD | NEW |