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 |
(...skipping 189 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
200 #include "views/widget/widget.h" | 200 #include "views/widget/widget.h" |
201 #if defined(TOOLKIT_USES_GTK) | 201 #if defined(TOOLKIT_USES_GTK) |
202 #include "views/widget/native_widget_gtk.h" | 202 #include "views/widget/native_widget_gtk.h" |
203 #endif | 203 #endif |
204 #endif | 204 #endif |
205 | 205 |
206 #if defined(TOOLKIT_USES_GTK) | 206 #if defined(TOOLKIT_USES_GTK) |
207 #include "ui/gfx/gtk_util.h" | 207 #include "ui/gfx/gtk_util.h" |
208 #endif | 208 #endif |
209 | 209 |
210 #if defined(TOUCH_UI) && defined(HAVE_XINPUT2) | 210 #if defined(TOUCH_UI) |
211 #include "views/touchui/touch_factory.h" | 211 #include "views/touchui/touch_factory.h" |
212 #endif | 212 #endif |
213 | 213 |
214 namespace { | 214 namespace { |
215 void SetSocketReusePolicy(int warmest_socket_trial_group, | 215 void SetSocketReusePolicy(int warmest_socket_trial_group, |
216 const int socket_policy[], | 216 const int socket_policy[], |
217 int num_groups) { | 217 int num_groups) { |
218 const int* result = std::find(socket_policy, socket_policy + num_groups, | 218 const int* result = std::find(socket_policy, socket_policy + num_groups, |
219 warmest_socket_trial_group); | 219 warmest_socket_trial_group); |
220 DCHECK_NE(result, socket_policy + num_groups) | 220 DCHECK_NE(result, socket_policy + num_groups) |
(...skipping 1661 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1882 InstallJankometer(parsed_command_line); | 1882 InstallJankometer(parsed_command_line); |
1883 | 1883 |
1884 #if defined(OS_WIN) && !defined(GOOGLE_CHROME_BUILD) | 1884 #if defined(OS_WIN) && !defined(GOOGLE_CHROME_BUILD) |
1885 if (parsed_command_line.HasSwitch(switches::kDebugPrint)) { | 1885 if (parsed_command_line.HasSwitch(switches::kDebugPrint)) { |
1886 FilePath path = | 1886 FilePath path = |
1887 parsed_command_line.GetSwitchValuePath(switches::kDebugPrint); | 1887 parsed_command_line.GetSwitchValuePath(switches::kDebugPrint); |
1888 printing::PrintedDocument::set_debug_dump_path(path); | 1888 printing::PrintedDocument::set_debug_dump_path(path); |
1889 } | 1889 } |
1890 #endif | 1890 #endif |
1891 | 1891 |
1892 #if defined(TOUCH_UI) && defined(HAVE_XINPUT2) | 1892 #if defined(TOUCH_UI) |
1893 views::TouchFactory::GetInstance()->set_keep_mouse_cursor( | 1893 views::TouchFactory::GetInstance()->set_keep_mouse_cursor( |
1894 CommandLine::ForCurrentProcess()->HasSwitch(switches::kKeepMouseCursor)); | 1894 CommandLine::ForCurrentProcess()->HasSwitch(switches::kKeepMouseCursor)); |
1895 #endif | 1895 #endif |
1896 | 1896 |
1897 HandleTestParameters(parsed_command_line); | 1897 HandleTestParameters(parsed_command_line); |
1898 RecordBreakpadStatusUMA(metrics); | 1898 RecordBreakpadStatusUMA(metrics); |
1899 about_flags::RecordUMAStatistics(local_state); | 1899 about_flags::RecordUMAStatistics(local_state); |
1900 LanguageUsageMetrics::RecordAcceptLanguages( | 1900 LanguageUsageMetrics::RecordAcceptLanguages( |
1901 profile->GetPrefs()->GetString(prefs::kAcceptLanguages)); | 1901 profile->GetPrefs()->GetString(prefs::kAcceptLanguages)); |
1902 LanguageUsageMetrics::RecordApplicationLanguage( | 1902 LanguageUsageMetrics::RecordApplicationLanguage( |
1903 g_browser_process->GetApplicationLocale()); | 1903 g_browser_process->GetApplicationLocale()); |
1904 | 1904 |
1905 #if defined(OS_CHROMEOS) | 1905 #if defined(OS_CHROMEOS) |
1906 metrics->StartExternalMetrics(); | 1906 metrics->StartExternalMetrics(); |
1907 | 1907 |
1908 // Initialize the brightness observer so that we'll display an onscreen | 1908 // Initialize the brightness observer so that we'll display an onscreen |
1909 // indication of brightness changes during login. | 1909 // indication of brightness changes during login. |
1910 static chromeos::BrightnessObserver* brightness_observer = | 1910 static chromeos::BrightnessObserver* brightness_observer = |
1911 new chromeos::BrightnessObserver(); | 1911 new chromeos::BrightnessObserver(); |
1912 chromeos::CrosLibrary::Get()->GetBrightnessLibrary()->AddObserver( | 1912 chromeos::CrosLibrary::Get()->GetBrightnessLibrary()->AddObserver( |
1913 brightness_observer); | 1913 brightness_observer); |
1914 | 1914 |
1915 // Listen for system key events so that the user will be able to adjust the | 1915 // Listen for system key events so that the user will be able to adjust the |
1916 // volume on the login screen. | 1916 // volume on the login screen. |
1917 chromeos::SystemKeyEventListener::GetInstance(); | 1917 chromeos::SystemKeyEventListener::GetInstance(); |
1918 | 1918 |
1919 // TODO(yusukes): Remove the #if once the ARM bot (crbug.com/84694) is fixed. | |
1920 #if defined(HAVE_XINPUT2) | |
1921 // Listen for XI_HierarchyChanged events. | 1919 // Listen for XI_HierarchyChanged events. |
1922 chromeos::XInputHierarchyChangedEventListener::GetInstance(); | 1920 chromeos::XInputHierarchyChangedEventListener::GetInstance(); |
1923 #endif | 1921 #endif |
1924 #endif | |
1925 | 1922 |
1926 // The extension service may be available at this point. If the command line | 1923 // The extension service may be available at this point. If the command line |
1927 // specifies --uninstall-extension, attempt the uninstall extension startup | 1924 // specifies --uninstall-extension, attempt the uninstall extension startup |
1928 // action. | 1925 // action. |
1929 if (parsed_command_line.HasSwitch(switches::kUninstallExtension)) { | 1926 if (parsed_command_line.HasSwitch(switches::kUninstallExtension)) { |
1930 ExtensionsStartupUtil ext_startup_util; | 1927 ExtensionsStartupUtil ext_startup_util; |
1931 if (ext_startup_util.UninstallExtension(parsed_command_line, profile)) { | 1928 if (ext_startup_util.UninstallExtension(parsed_command_line, profile)) { |
1932 return content::RESULT_CODE_NORMAL_EXIT; | 1929 return content::RESULT_CODE_NORMAL_EXIT; |
1933 } else { | 1930 } else { |
1934 return chrome::RESULT_CODE_UNINSTALL_EXTENSION_ERROR; | 1931 return chrome::RESULT_CODE_UNINSTALL_EXTENSION_ERROR; |
(...skipping 171 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2106 #if defined(OS_CHROMEOS) | 2103 #if defined(OS_CHROMEOS) |
2107 // To be precise, logout (browser shutdown) is not yet done, but the | 2104 // To be precise, logout (browser shutdown) is not yet done, but the |
2108 // remaining work is negligible, hence we say LogoutDone here. | 2105 // remaining work is negligible, hence we say LogoutDone here. |
2109 chromeos::BootTimesLoader::Get()->AddLogoutTimeMarker("LogoutDone", | 2106 chromeos::BootTimesLoader::Get()->AddLogoutTimeMarker("LogoutDone", |
2110 false); | 2107 false); |
2111 chromeos::BootTimesLoader::Get()->WriteLogoutTimes(); | 2108 chromeos::BootTimesLoader::Get()->WriteLogoutTimes(); |
2112 #endif | 2109 #endif |
2113 TRACE_EVENT_END_ETW("BrowserMain", 0, 0); | 2110 TRACE_EVENT_END_ETW("BrowserMain", 0, 0); |
2114 return result_code; | 2111 return result_code; |
2115 } | 2112 } |
OLD | NEW |