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 141 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
152 #endif | 152 #endif |
153 | 153 |
154 #if defined(OS_LINUX) && !defined(OS_CHROMEOS) | 154 #if defined(OS_LINUX) && !defined(OS_CHROMEOS) |
155 #include "chrome/browser/first_run/upgrade_util_linux.h" | 155 #include "chrome/browser/first_run/upgrade_util_linux.h" |
156 #endif | 156 #endif |
157 | 157 |
158 #if defined(OS_CHROMEOS) | 158 #if defined(OS_CHROMEOS) |
159 #include "chrome/browser/chromeos/cros/cros_library.h" | 159 #include "chrome/browser/chromeos/cros/cros_library.h" |
160 #include "chrome/browser/chromeos/settings/cros_settings.h" | 160 #include "chrome/browser/chromeos/settings/cros_settings.h" |
161 #include "chrome/browser/chromeos/settings/cros_settings_names.h" | 161 #include "chrome/browser/chromeos/settings/cros_settings_names.h" |
| 162 #include "chromeos/chromeos_switches.h" |
162 #endif | 163 #endif |
163 | 164 |
164 // TODO(port): several win-only methods have been pulled out of this, but | 165 // TODO(port): several win-only methods have been pulled out of this, but |
165 // BrowserMain() as a whole needs to be broken apart so that it's usable by | 166 // BrowserMain() as a whole needs to be broken apart so that it's usable by |
166 // other platforms. For now, it's just a stub. This is a serious work in | 167 // other platforms. For now, it's just a stub. This is a serious work in |
167 // progress and should not be taken as an indication of a real refactoring. | 168 // progress and should not be taken as an indication of a real refactoring. |
168 | 169 |
169 #if defined(OS_WIN) | 170 #if defined(OS_WIN) |
170 #include "base/environment.h" // For PreRead experiment. | 171 #include "base/environment.h" // For PreRead experiment. |
171 #include "base/win/windows_version.h" | 172 #include "base/win/windows_version.h" |
(...skipping 140 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
312 registry, | 313 registry, |
313 false)); | 314 false)); |
314 registry->RegisterStringPref(prefs::kApplicationLocale, std::string()); | 315 registry->RegisterStringPref(prefs::kApplicationLocale, std::string()); |
315 // Right now, we only inherit the locale setting from the parent profile. | 316 // Right now, we only inherit the locale setting from the parent profile. |
316 local_state->SetString( | 317 local_state->SetString( |
317 prefs::kApplicationLocale, | 318 prefs::kApplicationLocale, |
318 parent_local_state->GetString(prefs::kApplicationLocale)); | 319 parent_local_state->GetString(prefs::kApplicationLocale)); |
319 } | 320 } |
320 | 321 |
321 #if defined(OS_CHROMEOS) | 322 #if defined(OS_CHROMEOS) |
322 if (parsed_command_line.HasSwitch(switches::kLoginManager)) { | 323 if (parsed_command_line.HasSwitch(chromeos::switches::kLoginManager)) { |
323 std::string owner_locale = local_state->GetString(prefs::kOwnerLocale); | 324 std::string owner_locale = local_state->GetString(prefs::kOwnerLocale); |
324 // Ensure that we start with owner's locale. | 325 // Ensure that we start with owner's locale. |
325 if (!owner_locale.empty() && | 326 if (!owner_locale.empty() && |
326 local_state->GetString(prefs::kApplicationLocale) != owner_locale && | 327 local_state->GetString(prefs::kApplicationLocale) != owner_locale && |
327 !local_state->IsManagedPreference(prefs::kApplicationLocale)) { | 328 !local_state->IsManagedPreference(prefs::kApplicationLocale)) { |
328 local_state->SetString(prefs::kApplicationLocale, owner_locale); | 329 local_state->SetString(prefs::kApplicationLocale, owner_locale); |
329 } | 330 } |
330 } | 331 } |
331 #endif | 332 #endif |
332 | 333 |
(...skipping 1464 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1797 if (base::win::GetVersion() <= base::win::VERSION_XP) | 1798 if (base::win::GetVersion() <= base::win::VERSION_XP) |
1798 uma_name += "_XP"; | 1799 uma_name += "_XP"; |
1799 | 1800 |
1800 uma_name += "_PreRead_"; | 1801 uma_name += "_PreRead_"; |
1801 uma_name += pre_read_percentage; | 1802 uma_name += pre_read_percentage; |
1802 AddPreReadHistogramTime(uma_name.c_str(), time); | 1803 AddPreReadHistogramTime(uma_name.c_str(), time); |
1803 } | 1804 } |
1804 #endif | 1805 #endif |
1805 #endif | 1806 #endif |
1806 } | 1807 } |
OLD | NEW |