OLD | NEW |
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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/chromeos/chrome_browser_main_chromeos.h" | 5 #include "chrome/browser/chromeos/chrome_browser_main_chromeos.h" |
6 | 6 |
7 #include <string> | 7 #include <string> |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "ash/ash_switches.h" | 10 #include "ash/ash_switches.h" |
11 #include "ash/shell.h" | 11 #include "ash/shell.h" |
12 #include "base/bind.h" | 12 #include "base/bind.h" |
13 #include "base/callback.h" | 13 #include "base/callback.h" |
14 #include "base/chromeos/chromeos_version.h" | 14 #include "base/chromeos/chromeos_version.h" |
15 #include "base/command_line.h" | 15 #include "base/command_line.h" |
16 #include "base/file_util.h" | 16 #include "base/file_util.h" |
17 #include "base/lazy_instance.h" | 17 #include "base/lazy_instance.h" |
18 #include "base/linux_util.h" | 18 #include "base/linux_util.h" |
19 #include "base/message_loop/message_loop.h" | 19 #include "base/message_loop/message_loop.h" |
20 #include "base/path_service.h" | 20 #include "base/path_service.h" |
21 #include "base/prefs/pref_service.h" | 21 #include "base/prefs/pref_service.h" |
22 #include "base/strings/string_number_conversions.h" | 22 #include "base/strings/string_number_conversions.h" |
23 #include "base/strings/string_split.h" | 23 #include "base/strings/string_split.h" |
| 24 #include "base/sys_info.h" |
24 #include "chrome/browser/browser_process.h" | 25 #include "chrome/browser/browser_process.h" |
25 #include "chrome/browser/browser_process_platform_part_chromeos.h" | 26 #include "chrome/browser/browser_process_platform_part_chromeos.h" |
26 #include "chrome/browser/chrome_notification_types.h" | 27 #include "chrome/browser/chrome_notification_types.h" |
27 #include "chrome/browser/chromeos/accessibility/accessibility_manager.h" | 28 #include "chrome/browser/chromeos/accessibility/accessibility_manager.h" |
28 #include "chrome/browser/chromeos/accessibility/magnification_manager.h" | 29 #include "chrome/browser/chromeos/accessibility/magnification_manager.h" |
29 #include "chrome/browser/chromeos/app_mode/kiosk_app_launch_error.h" | 30 #include "chrome/browser/chromeos/app_mode/kiosk_app_launch_error.h" |
30 #include "chrome/browser/chromeos/app_mode/kiosk_app_manager.h" | 31 #include "chrome/browser/chromeos/app_mode/kiosk_app_manager.h" |
31 #include "chrome/browser/chromeos/boot_times_loader.h" | 32 #include "chrome/browser/chromeos/boot_times_loader.h" |
32 #include "chrome/browser/chromeos/contacts/contact_manager.h" | 33 #include "chrome/browser/chromeos/contacts/contact_manager.h" |
33 #include "chrome/browser/chromeos/dbus/cros_dbus_service.h" | 34 #include "chrome/browser/chromeos/dbus/cros_dbus_service.h" |
(...skipping 347 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
381 } | 382 } |
382 LOG(INFO) << "Running as stub user with profile dir: " | 383 LOG(INFO) << "Running as stub user with profile dir: " |
383 << singleton_command_line->GetSwitchValuePath( | 384 << singleton_command_line->GetSwitchValuePath( |
384 switches::kLoginProfile).value(); | 385 switches::kLoginProfile).value(); |
385 } | 386 } |
386 | 387 |
387 // Initialize the statistics provider, which will ensure that the Chrome | 388 // Initialize the statistics provider, which will ensure that the Chrome |
388 // channel info is read and made available early. | 389 // channel info is read and made available early. |
389 system::StatisticsProvider::GetInstance()->Init(); | 390 system::StatisticsProvider::GetInstance()->Init(); |
390 | 391 |
| 392 #if defined(GOOGLE_CHROME_BUILD) |
| 393 const char kChromeOSReleaseTrack[] = "CHROMEOS_RELEASE_TRACK"; |
| 394 std::string channel; |
| 395 if (base::SysInfo::GetLsbReleaseValue(kChromeOSReleaseTrack, &channel)) |
| 396 chrome::VersionInfo::SetChannel(channel); |
| 397 #endif |
| 398 |
391 ChromeBrowserMainPartsLinux::PreEarlyInitialization(); | 399 ChromeBrowserMainPartsLinux::PreEarlyInitialization(); |
392 } | 400 } |
393 | 401 |
394 void ChromeBrowserMainPartsChromeos::PreMainMessageLoopStart() { | 402 void ChromeBrowserMainPartsChromeos::PreMainMessageLoopStart() { |
395 // Replace the default NetworkChangeNotifierFactory with ChromeOS specific | 403 // Replace the default NetworkChangeNotifierFactory with ChromeOS specific |
396 // implementation. This must be done before BrowserMainLoop calls | 404 // implementation. This must be done before BrowserMainLoop calls |
397 // net::NetworkChangeNotifier::Create() in MainMessageLoopStart(). | 405 // net::NetworkChangeNotifier::Create() in MainMessageLoopStart(). |
398 net::NetworkChangeNotifier::SetFactory( | 406 net::NetworkChangeNotifier::SetFactory( |
399 new NetworkChangeNotifierFactoryChromeos()); | 407 new NetworkChangeNotifierFactoryChromeos()); |
400 ChromeBrowserMainPartsLinux::PreMainMessageLoopStart(); | 408 ChromeBrowserMainPartsLinux::PreMainMessageLoopStart(); |
(...skipping 381 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
782 | 790 |
783 // Destroy DeviceSettingsService after g_browser_process. | 791 // Destroy DeviceSettingsService after g_browser_process. |
784 DeviceSettingsService::Shutdown(); | 792 DeviceSettingsService::Shutdown(); |
785 } | 793 } |
786 | 794 |
787 void ChromeBrowserMainPartsChromeos::SetupPlatformFieldTrials() { | 795 void ChromeBrowserMainPartsChromeos::SetupPlatformFieldTrials() { |
788 default_pinned_apps_field_trial::SetupTrial(); | 796 default_pinned_apps_field_trial::SetupTrial(); |
789 } | 797 } |
790 | 798 |
791 } // namespace chromeos | 799 } // namespace chromeos |
OLD | NEW |