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/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 "base/bind.h" | 10 #include "base/bind.h" |
11 #include "base/callback.h" | 11 #include "base/callback.h" |
12 #include "base/chromeos/chromeos_version.h" | 12 #include "base/chromeos/chromeos_version.h" |
13 #include "base/command_line.h" | 13 #include "base/command_line.h" |
14 #include "base/lazy_instance.h" | 14 #include "base/lazy_instance.h" |
15 #include "base/message_loop.h" | 15 #include "base/message_loop.h" |
16 #include "base/string_number_conversions.h" | 16 #include "base/string_number_conversions.h" |
17 #include "base/string_split.h" | 17 #include "base/string_split.h" |
18 #include "chrome/browser/browser_process_impl.h" | 18 #include "chrome/browser/browser_process_impl.h" |
19 #include "chrome/browser/chromeos/audio/audio_handler.h" | 19 #include "chrome/browser/chromeos/audio/audio_handler.h" |
20 #include "chrome/browser/chromeos/boot_times_loader.h" | 20 #include "chrome/browser/chromeos/boot_times_loader.h" |
| 21 #include "chrome/browser/chromeos/contacts/contact_manager.h" |
21 #include "chrome/browser/chromeos/cros/cros_library.h" | 22 #include "chrome/browser/chromeos/cros/cros_library.h" |
22 #include "chrome/browser/chromeos/cryptohome/async_method_caller.h" | 23 #include "chrome/browser/chromeos/cryptohome/async_method_caller.h" |
23 #include "chrome/browser/chromeos/dbus/cros_dbus_service.h" | 24 #include "chrome/browser/chromeos/dbus/cros_dbus_service.h" |
24 #include "chrome/browser/chromeos/disks/disk_mount_manager.h" | 25 #include "chrome/browser/chromeos/disks/disk_mount_manager.h" |
25 #include "chrome/browser/chromeos/external_metrics.h" | 26 #include "chrome/browser/chromeos/external_metrics.h" |
26 #include "chrome/browser/chromeos/imageburner/burn_manager.h" | 27 #include "chrome/browser/chromeos/imageburner/burn_manager.h" |
27 #include "chrome/browser/chromeos/input_method/input_method_manager.h" | 28 #include "chrome/browser/chromeos/input_method/input_method_manager.h" |
28 #include "chrome/browser/chromeos/input_method/xkeyboard.h" | 29 #include "chrome/browser/chromeos/input_method/xkeyboard.h" |
29 #include "chrome/browser/chromeos/kiosk_mode/kiosk_mode_idle_logout.h" | 30 #include "chrome/browser/chromeos/kiosk_mode/kiosk_mode_idle_logout.h" |
30 #include "chrome/browser/chromeos/kiosk_mode/kiosk_mode_screensaver.h" | 31 #include "chrome/browser/chromeos/kiosk_mode/kiosk_mode_screensaver.h" |
(...skipping 328 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
359 | 360 |
360 // This forces the ProfileManager to be created and register for the | 361 // This forces the ProfileManager to be created and register for the |
361 // notification it needs to track the logged in user. | 362 // notification it needs to track the logged in user. |
362 g_browser_process->profile_manager(); | 363 g_browser_process->profile_manager(); |
363 | 364 |
364 // TODO(abarth): Should this move to InitializeNetworkOptions()? | 365 // TODO(abarth): Should this move to InitializeNetworkOptions()? |
365 // Allow access to file:// on ChromeOS for tests. | 366 // Allow access to file:// on ChromeOS for tests. |
366 if (parsed_command_line().HasSwitch(switches::kAllowFileAccess)) | 367 if (parsed_command_line().HasSwitch(switches::kAllowFileAccess)) |
367 ChromeNetworkDelegate::AllowAccessToAllFiles(); | 368 ChromeNetworkDelegate::AllowAccessToAllFiles(); |
368 | 369 |
| 370 contact_manager_.reset(new contacts::ContactManager()); |
| 371 contact_manager_->Init(); |
| 372 |
369 // There are two use cases for kLoginUser: | 373 // There are two use cases for kLoginUser: |
370 // 1) if passed in tandem with kLoginPassword, to drive a "StubLogin" | 374 // 1) if passed in tandem with kLoginPassword, to drive a "StubLogin" |
371 // 2) if passed alone, to signal that the indicated user has already | 375 // 2) if passed alone, to signal that the indicated user has already |
372 // logged in and we should behave accordingly. | 376 // logged in and we should behave accordingly. |
373 // This handles case 2. | 377 // This handles case 2. |
374 if (parsed_command_line().HasSwitch(switches::kLoginUser) && | 378 if (parsed_command_line().HasSwitch(switches::kLoginUser) && |
375 !parsed_command_line().HasSwitch(switches::kLoginPassword)) { | 379 !parsed_command_line().HasSwitch(switches::kLoginPassword)) { |
376 std::string username = | 380 std::string username = |
377 parsed_command_line().GetSwitchValueASCII(switches::kLoginUser); | 381 parsed_command_line().GetSwitchValueASCII(switches::kLoginUser); |
378 VLOG(1) << "Relaunching browser for user: " << username; | 382 VLOG(1) << "Relaunching browser for user: " << username; |
(...skipping 202 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
581 LOG(WARNING) << "low_mem: Part of '100MB' experiment"; | 585 LOG(WARNING) << "low_mem: Part of '100MB' experiment"; |
582 chromeos::LowMemoryObserver::SetLowMemoryMargin(100); | 586 chromeos::LowMemoryObserver::SetLowMemoryMargin(100); |
583 } else if (trial->group() == margin_200mb) { | 587 } else if (trial->group() == margin_200mb) { |
584 LOG(WARNING) << "low_mem: Part of '200MB' experiment"; | 588 LOG(WARNING) << "low_mem: Part of '200MB' experiment"; |
585 chromeos::LowMemoryObserver::SetLowMemoryMargin(200); | 589 chromeos::LowMemoryObserver::SetLowMemoryMargin(200); |
586 } else { | 590 } else { |
587 LOG(WARNING) << "low_mem: Part of 'default' experiment"; | 591 LOG(WARNING) << "low_mem: Part of 'default' experiment"; |
588 } | 592 } |
589 } | 593 } |
590 } | 594 } |
OLD | NEW |