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/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 |
11 #include "ui/base/l10n/l10n_util.h" | 11 #include "ui/base/l10n/l10n_util.h" |
Scott Byer
2011/01/24 20:18:38
Go ahead and move this include line to it's proper
| |
12 #include "base/at_exit.h" | 12 #include "base/at_exit.h" |
13 #include "base/command_line.h" | 13 #include "base/command_line.h" |
14 #include "base/debug/trace_event.h" | 14 #include "base/debug/trace_event.h" |
15 #include "base/file_path.h" | 15 #include "base/file_path.h" |
16 #include "base/file_util.h" | 16 #include "base/file_util.h" |
17 #include "base/mac/scoped_nsautorelease_pool.h" | 17 #include "base/mac/scoped_nsautorelease_pool.h" |
18 #include "base/metrics/field_trial.h" | 18 #include "base/metrics/field_trial.h" |
19 #include "base/metrics/histogram.h" | 19 #include "base/metrics/histogram.h" |
20 #include "base/path_service.h" | 20 #include "base/path_service.h" |
21 #include "base/process_util.h" | 21 #include "base/process_util.h" |
(...skipping 28 matching lines...) Expand all Loading... | |
50 #include "chrome/browser/net/chrome_dns_cert_provenance_checker_factory.h" | 50 #include "chrome/browser/net/chrome_dns_cert_provenance_checker_factory.h" |
51 #include "chrome/browser/net/metadata_url_request.h" | 51 #include "chrome/browser/net/metadata_url_request.h" |
52 #include "chrome/browser/net/predictor_api.h" | 52 #include "chrome/browser/net/predictor_api.h" |
53 #include "chrome/browser/net/sdch_dictionary_fetcher.h" | 53 #include "chrome/browser/net/sdch_dictionary_fetcher.h" |
54 #include "chrome/browser/net/websocket_experiment/websocket_experiment_runner.h" | 54 #include "chrome/browser/net/websocket_experiment/websocket_experiment_runner.h" |
55 #include "chrome/browser/plugin_service.h" | 55 #include "chrome/browser/plugin_service.h" |
56 #include "chrome/browser/prefs/browser_prefs.h" | 56 #include "chrome/browser/prefs/browser_prefs.h" |
57 #include "chrome/browser/prefs/pref_service.h" | 57 #include "chrome/browser/prefs/pref_service.h" |
58 #include "chrome/browser/prefs/pref_value_store.h" | 58 #include "chrome/browser/prefs/pref_value_store.h" |
59 #include "chrome/browser/printing/cloud_print/cloud_print_proxy_service.h" | 59 #include "chrome/browser/printing/cloud_print/cloud_print_proxy_service.h" |
60 #include "chrome/browser/printing/print_dialog_cloud.h" | |
60 #include "chrome/browser/process_singleton.h" | 61 #include "chrome/browser/process_singleton.h" |
61 #include "chrome/browser/profiles/profile.h" | 62 #include "chrome/browser/profiles/profile.h" |
62 #include "chrome/browser/profiles/profile_manager.h" | 63 #include "chrome/browser/profiles/profile_manager.h" |
63 #include "chrome/browser/renderer_host/resource_dispatcher_host.h" | 64 #include "chrome/browser/renderer_host/resource_dispatcher_host.h" |
64 #include "chrome/browser/search_engines/search_engine_type.h" | 65 #include "chrome/browser/search_engines/search_engine_type.h" |
65 #include "chrome/browser/search_engines/template_url.h" | 66 #include "chrome/browser/search_engines/template_url.h" |
66 #include "chrome/browser/search_engines/template_url_model.h" | 67 #include "chrome/browser/search_engines/template_url_model.h" |
67 #include "chrome/browser/service/service_process_control.h" | 68 #include "chrome/browser/service/service_process_control.h" |
68 #include "chrome/browser/service/service_process_control_manager.h" | 69 #include "chrome/browser/service/service_process_control_manager.h" |
69 #include "chrome/browser/shell_integration.h" | 70 #include "chrome/browser/shell_integration.h" |
(...skipping 1560 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1630 // TODO(hclam): Need to check for cloud print proxy too. | 1631 // TODO(hclam): Need to check for cloud print proxy too. |
1631 if (parsed_command_line.HasSwitch(switches::kEnableRemoting)) { | 1632 if (parsed_command_line.HasSwitch(switches::kEnableRemoting)) { |
1632 if (user_prefs->GetBoolean(prefs::kRemotingHasSetupCompleted)) { | 1633 if (user_prefs->GetBoolean(prefs::kRemotingHasSetupCompleted)) { |
1633 ServiceProcessControl* control = | 1634 ServiceProcessControl* control = |
1634 ServiceProcessControlManager::GetInstance()->GetProcessControl( | 1635 ServiceProcessControlManager::GetInstance()->GetProcessControl( |
1635 profile); | 1636 profile); |
1636 control->Launch(NULL, NULL); | 1637 control->Launch(NULL, NULL); |
1637 } | 1638 } |
1638 } | 1639 } |
1639 | 1640 |
1641 if (parsed_command_line.HasSwitch(switches::kCloudPrintFile)) { | |
1642 FilePath cloud_print_file; | |
1643 cloud_print_file = | |
1644 parsed_command_line.GetSwitchValuePath(switches::kCloudPrintFile); | |
1645 if (!cloud_print_file.empty()) { | |
1646 string16 print_job_title; | |
1647 if (parsed_command_line.HasSwitch(switches::kCloudPrintJobTitle)) { | |
1648 #ifdef OS_WIN | |
1649 CommandLine::StringType native_job_title; | |
1650 native_job_title = CommandLine::ForCurrentProcess()->GetSwitchValueNative( | |
1651 switches::kCloudPrintJobTitle); | |
1652 print_job_title = string16(native_job_title); | |
1653 #elif defined(OS_POSIX) | |
1654 // TODO(abodenha@google.com) Implement this for OS_POSIX | |
1655 // Command line string types are different | |
1656 #endif | |
1657 } | |
1658 PrintDialogCloud::CreatePrintDialogForPdf(cloud_print_file, | |
1659 print_job_title, | |
1660 false); | |
1661 } | |
1662 } | |
1663 | |
1640 #if defined(OS_CHROMEOS) | 1664 #if defined(OS_CHROMEOS) |
1641 // Run the Out of Memory priority manager while in this scope. Wait | 1665 // Run the Out of Memory priority manager while in this scope. Wait |
1642 // until here to start so that we give the most amount of time for | 1666 // until here to start so that we give the most amount of time for |
1643 // the other services to start up before we start adjusting the oom | 1667 // the other services to start up before we start adjusting the oom |
1644 // priority. In reality, it doesn't matter much where in this scope | 1668 // priority. In reality, it doesn't matter much where in this scope |
1645 // this is started, but it must be started in this scope so it will | 1669 // this is started, but it must be started in this scope so it will |
1646 // also be terminated when this scope exits. | 1670 // also be terminated when this scope exits. |
1647 scoped_ptr<browser::OomPriorityManager> oom_priority_manager( | 1671 scoped_ptr<browser::OomPriorityManager> oom_priority_manager( |
1648 new browser::OomPriorityManager); | 1672 new browser::OomPriorityManager); |
1649 #endif | 1673 #endif |
(...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1749 #if defined(OS_CHROMEOS) | 1773 #if defined(OS_CHROMEOS) |
1750 // To be precise, logout (browser shutdown) is not yet done, but the | 1774 // To be precise, logout (browser shutdown) is not yet done, but the |
1751 // remaining work is negligible, hence we say LogoutDone here. | 1775 // remaining work is negligible, hence we say LogoutDone here. |
1752 chromeos::BootTimesLoader::Get()->AddLogoutTimeMarker("LogoutDone", | 1776 chromeos::BootTimesLoader::Get()->AddLogoutTimeMarker("LogoutDone", |
1753 false); | 1777 false); |
1754 chromeos::BootTimesLoader::Get()->WriteLogoutTimes(); | 1778 chromeos::BootTimesLoader::Get()->WriteLogoutTimes(); |
1755 #endif | 1779 #endif |
1756 TRACE_EVENT_END("BrowserMain", 0, 0); | 1780 TRACE_EVENT_END("BrowserMain", 0, 0); |
1757 return result_code; | 1781 return result_code; |
1758 } | 1782 } |
OLD | NEW |