| 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/ui/startup/startup_browser_creator.h" | 5 #include "chrome/browser/ui/startup/startup_browser_creator.h" |
| 6 | 6 |
| 7 #include <algorithm> // For max(). | 7 #include <algorithm> // For max(). |
| 8 #include <set> | 8 #include <set> |
| 9 | 9 |
| 10 #include "apps/app_load_service.h" | 10 #include "apps/app_load_service.h" |
| (...skipping 222 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 233 base::LazyInstance<ProfileLaunchObserver> profile_launch_observer = | 233 base::LazyInstance<ProfileLaunchObserver> profile_launch_observer = |
| 234 LAZY_INSTANCE_INITIALIZER; | 234 LAZY_INSTANCE_INITIALIZER; |
| 235 | 235 |
| 236 // Dumps the current set of the browser process's histograms to |output_file|. | 236 // Dumps the current set of the browser process's histograms to |output_file|. |
| 237 // The file is overwritten if it exists. This function should only be called in | 237 // The file is overwritten if it exists. This function should only be called in |
| 238 // the blocking pool. | 238 // the blocking pool. |
| 239 void DumpBrowserHistograms(const base::FilePath& output_file) { | 239 void DumpBrowserHistograms(const base::FilePath& output_file) { |
| 240 base::ThreadRestrictions::AssertIOAllowed(); | 240 base::ThreadRestrictions::AssertIOAllowed(); |
| 241 | 241 |
| 242 std::string output_string(base::StatisticsRecorder::ToJSON(std::string())); | 242 std::string output_string(base::StatisticsRecorder::ToJSON(std::string())); |
| 243 file_util::WriteFile(output_file, output_string.data(), | 243 base::WriteFile(output_file, output_string.data(), |
| 244 static_cast<int>(output_string.size())); | 244 static_cast<int>(output_string.size())); |
| 245 } | 245 } |
| 246 | 246 |
| 247 } // namespace | 247 } // namespace |
| 248 | 248 |
| 249 StartupBrowserCreator::StartupBrowserCreator() | 249 StartupBrowserCreator::StartupBrowserCreator() |
| 250 : is_default_browser_dialog_suppressed_(false), | 250 : is_default_browser_dialog_suppressed_(false), |
| 251 show_main_browser_window_(true) { | 251 show_main_browser_window_(true) { |
| 252 } | 252 } |
| 253 | 253 |
| 254 StartupBrowserCreator::~StartupBrowserCreator() {} | 254 StartupBrowserCreator::~StartupBrowserCreator() {} |
| (...skipping 562 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 817 } | 817 } |
| 818 | 818 |
| 819 if (command_line.HasSwitch(switches::kProfileDirectory)) { | 819 if (command_line.HasSwitch(switches::kProfileDirectory)) { |
| 820 return user_data_dir.Append( | 820 return user_data_dir.Append( |
| 821 command_line.GetSwitchValuePath(switches::kProfileDirectory)); | 821 command_line.GetSwitchValuePath(switches::kProfileDirectory)); |
| 822 } | 822 } |
| 823 | 823 |
| 824 return g_browser_process->profile_manager()->GetLastUsedProfileDir( | 824 return g_browser_process->profile_manager()->GetLastUsedProfileDir( |
| 825 user_data_dir); | 825 user_data_dir); |
| 826 } | 826 } |
| OLD | NEW |