| OLD | NEW | 
|    1 // Copyright (c) 2006-2009 The Chromium Authors. All rights reserved. |    1 // Copyright (c) 2006-2009 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  |    8  | 
|    9 #include "app/l10n_util.h" |    9 #include "app/l10n_util.h" | 
|   10 #include "app/resource_bundle.h" |   10 #include "app/resource_bundle.h" | 
| (...skipping 602 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
|  613       parsed_command_line.HasSwitch(switches::kShowIcons)) { |  613       parsed_command_line.HasSwitch(switches::kShowIcons)) { | 
|  614     return HandleIconsCommands(parsed_command_line); |  614     return HandleIconsCommands(parsed_command_line); | 
|  615   } else if (parsed_command_line.HasSwitch(switches::kMakeDefaultBrowser)) { |  615   } else if (parsed_command_line.HasSwitch(switches::kMakeDefaultBrowser)) { | 
|  616     if (ShellIntegration::SetAsDefaultBrowser()) { |  616     if (ShellIntegration::SetAsDefaultBrowser()) { | 
|  617       return ResultCodes::NORMAL_EXIT; |  617       return ResultCodes::NORMAL_EXIT; | 
|  618     } else { |  618     } else { | 
|  619       return ResultCodes::SHELL_INTEGRATION_FAILED; |  619       return ResultCodes::SHELL_INTEGRATION_FAILED; | 
|  620     } |  620     } | 
|  621   } |  621   } | 
|  622  |  622  | 
 |  623   // Create the child threads.  We need to do this since ChromeThread::PostTask | 
 |  624   // silently deletes a posted task if the target message loop isn't created. | 
 |  625   // Note: must be done before FirstRun code is run. | 
 |  626   browser_process->db_thread(); | 
 |  627   browser_process->file_thread(); | 
 |  628   browser_process->io_thread(); | 
 |  629  | 
|  623   // Importing other browser settings is done in a browser-like process |  630   // Importing other browser settings is done in a browser-like process | 
|  624   // that exits when this task has finished. |  631   // that exits when this task has finished. | 
|  625 #if defined(OS_WIN) |  632 #if defined(OS_WIN) | 
|  626   if (parsed_command_line.HasSwitch(switches::kImport)) |  633   if (parsed_command_line.HasSwitch(switches::kImport)) | 
|  627     return FirstRun::ImportNow(profile, parsed_command_line); |  634     return FirstRun::ImportNow(profile, parsed_command_line); | 
|  628 #endif |  635 #endif | 
|  629  |  636  | 
|  630   // When another process is running, use it instead of starting us. |  637   // When another process is running, use it instead of starting us. | 
|  631   switch (process_singleton.NotifyOtherProcess()) { |  638   switch (process_singleton.NotifyOtherProcess()) { | 
|  632     case ProcessSingleton::PROCESS_NONE: |  639     case ProcessSingleton::PROCESS_NONE: | 
| (...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
|  694   // Sets things up so that if we crash from this point on, a dialog will |  701   // Sets things up so that if we crash from this point on, a dialog will | 
|  695   // popup asking the user to restart chrome. It is done this late to avoid |  702   // popup asking the user to restart chrome. It is done this late to avoid | 
|  696   // testing against a bunch of special cases that are taken care early on. |  703   // testing against a bunch of special cases that are taken care early on. | 
|  697   PrepareRestartOnCrashEnviroment(parsed_command_line); |  704   PrepareRestartOnCrashEnviroment(parsed_command_line); | 
|  698  |  705  | 
|  699 #if defined(OS_WIN) |  706 #if defined(OS_WIN) | 
|  700   // Initialize Winsock. |  707   // Initialize Winsock. | 
|  701   net::EnsureWinsockInit(); |  708   net::EnsureWinsockInit(); | 
|  702 #endif  // defined(OS_WIN) |  709 #endif  // defined(OS_WIN) | 
|  703  |  710  | 
|  704   // Create the child threads.  We need to do this since ChromeThread::PostTask |  | 
|  705   // silently deletes a posted task if the target message loop isn't created. |  | 
|  706   browser_process->db_thread(); |  | 
|  707   browser_process->file_thread(); |  | 
|  708   browser_process->io_thread(); |  | 
|  709  |  | 
|  710   // Initialize and maintain DNS prefetcher module. |  711   // Initialize and maintain DNS prefetcher module. | 
|  711   chrome_browser_net::DnsPrefetcherInit dns_prefetch(user_prefs, local_state); |  712   chrome_browser_net::DnsPrefetcherInit dns_prefetch(user_prefs, local_state); | 
|  712  |  713  | 
|  713   scoped_refptr<FieldTrial> http_prioritization_trial = |  714   scoped_refptr<FieldTrial> http_prioritization_trial = | 
|  714       new FieldTrial("HttpPrioritization", 100); |  715       new FieldTrial("HttpPrioritization", 100); | 
|  715   // Put 10% of people in the fallback experiment with the http prioritization |  716   // Put 10% of people in the fallback experiment with the http prioritization | 
|  716   // code disabled. |  717   // code disabled. | 
|  717   const int holdback_group = |  718   const int holdback_group = | 
|  718       http_prioritization_trial->AppendGroup("_no_http_prioritization", 10); |  719       http_prioritization_trial->AppendGroup("_no_http_prioritization", 10); | 
|  719   if (http_prioritization_trial->group() == holdback_group) { |  720   if (http_prioritization_trial->group() == holdback_group) { | 
| (...skipping 164 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
|  884   if (metrics) |  885   if (metrics) | 
|  885     metrics->Stop(); |  886     metrics->Stop(); | 
|  886  |  887  | 
|  887   // browser_shutdown takes care of deleting browser_process, so we need to |  888   // browser_shutdown takes care of deleting browser_process, so we need to | 
|  888   // release it. |  889   // release it. | 
|  889   browser_process.release(); |  890   browser_process.release(); | 
|  890   browser_shutdown::Shutdown(); |  891   browser_shutdown::Shutdown(); | 
|  891  |  892  | 
|  892   return result_code; |  893   return result_code; | 
|  893 } |  894 } | 
| OLD | NEW |