Chromium Code Reviews| 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" |
| (...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 89 #include "chromeos/audio/cras_audio_handler.h" | 89 #include "chromeos/audio/cras_audio_handler.h" |
| 90 #include "chromeos/cert_loader.h" | 90 #include "chromeos/cert_loader.h" |
| 91 #include "chromeos/chromeos_paths.h" | 91 #include "chromeos/chromeos_paths.h" |
| 92 #include "chromeos/chromeos_switches.h" | 92 #include "chromeos/chromeos_switches.h" |
| 93 #include "chromeos/cryptohome/async_method_caller.h" | 93 #include "chromeos/cryptohome/async_method_caller.h" |
| 94 #include "chromeos/cryptohome/homedir_methods.h" | 94 #include "chromeos/cryptohome/homedir_methods.h" |
| 95 #include "chromeos/cryptohome/system_salt_getter.h" | 95 #include "chromeos/cryptohome/system_salt_getter.h" |
| 96 #include "chromeos/dbus/dbus_thread_manager.h" | 96 #include "chromeos/dbus/dbus_thread_manager.h" |
| 97 #include "chromeos/dbus/power_policy_controller.h" | 97 #include "chromeos/dbus/power_policy_controller.h" |
| 98 #include "chromeos/dbus/session_manager_client.h" | 98 #include "chromeos/dbus/session_manager_client.h" |
| 99 #include "chromeos/dbus/shill_manager_client.h" | |
| 99 #include "chromeos/disks/disk_mount_manager.h" | 100 #include "chromeos/disks/disk_mount_manager.h" |
| 100 #include "chromeos/ime/ime_keyboard.h" | 101 #include "chromeos/ime/ime_keyboard.h" |
| 101 #include "chromeos/ime/input_method_manager.h" | 102 #include "chromeos/ime/input_method_manager.h" |
| 102 #include "chromeos/login/login_state.h" | 103 #include "chromeos/login/login_state.h" |
| 103 #include "chromeos/network/network_change_notifier_chromeos.h" | 104 #include "chromeos/network/network_change_notifier_chromeos.h" |
| 104 #include "chromeos/network/network_change_notifier_factory_chromeos.h" | 105 #include "chromeos/network/network_change_notifier_factory_chromeos.h" |
| 105 #include "chromeos/network/network_handler.h" | 106 #include "chromeos/network/network_handler.h" |
| 106 #include "chromeos/system/statistics_provider.h" | 107 #include "chromeos/system/statistics_provider.h" |
| 107 #include "chromeos/tpm_token_loader.h" | 108 #include "chromeos/tpm_token_loader.h" |
| 109 #include "components/gcm_driver/gcm_driver.h" | |
| 108 #include "components/metrics/metrics_service.h" | 110 #include "components/metrics/metrics_service.h" |
| 109 #include "content/public/browser/browser_thread.h" | 111 #include "content/public/browser/browser_thread.h" |
| 110 #include "content/public/browser/notification_service.h" | 112 #include "content/public/browser/notification_service.h" |
| 111 #include "content/public/browser/power_save_blocker.h" | 113 #include "content/public/browser/power_save_blocker.h" |
| 112 #include "content/public/common/main_function_params.h" | 114 #include "content/public/common/main_function_params.h" |
| 113 #include "grit/platform_locale_settings.h" | 115 #include "grit/platform_locale_settings.h" |
| 114 #include "media/audio/sounds/sounds_manager.h" | 116 #include "media/audio/sounds/sounds_manager.h" |
| 115 #include "net/base/network_change_notifier.h" | 117 #include "net/base/network_change_notifier.h" |
| 116 #include "net/url_request/url_request.h" | 118 #include "net/url_request/url_request.h" |
| 117 #include "net/url_request/url_request_context_getter.h" | 119 #include "net/url_request/url_request_context_getter.h" |
| (...skipping 628 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 746 | 748 |
| 747 if (ui::ShouldDefaultToNaturalScroll()) { | 749 if (ui::ShouldDefaultToNaturalScroll()) { |
| 748 CommandLine::ForCurrentProcess()->AppendSwitch( | 750 CommandLine::ForCurrentProcess()->AppendSwitch( |
| 749 chromeos::switches::kNaturalScrollDefault); | 751 chromeos::switches::kNaturalScrollDefault); |
| 750 system::InputDeviceSettings::Get()->SetTapToClick(true); | 752 system::InputDeviceSettings::Get()->SetTapToClick(true); |
| 751 } | 753 } |
| 752 | 754 |
| 753 ChromeBrowserMainPartsLinux::PreBrowserStart(); | 755 ChromeBrowserMainPartsLinux::PreBrowserStart(); |
| 754 } | 756 } |
| 755 | 757 |
| 758 // static | |
| 759 void ChromeBrowserMainPartsChromeos::GCMErrorCallback( | |
| 760 const std::string &error_name, | |
| 761 const std::string &error) { | |
| 762 LOG(ERROR) << "GCM callback error " << error_name << ": " << error; | |
| 763 } | |
| 764 | |
| 765 // static | |
| 766 void ChromeBrowserMainPartsChromeos::OnGCMConnected( | |
| 767 const net::IPEndPoint& ip_endpoint) { | |
| 768 const std::string ip_endpoint_string = ip_endpoint.ToString(); | |
| 769 chromeos::DBusThreadManager::Get()-> | |
| 770 GetShillManagerClient()-> | |
| 771 AddWakeOnPacketConnection( | |
| 772 ip_endpoint_string, | |
| 773 base::Bind(&base::DoNothing), | |
| 774 base::Bind(&ChromeBrowserMainPartsChromeos::GCMErrorCallback)); | |
| 775 } | |
| 776 | |
| 777 void ChromeBrowserMainPartsChromeos::OnGCMDisconnected() { | |
|
Daniel Erat
2014/08/21 22:17:37
nit: add a "static" comment here too
Luigi Semenzato
2014/08/22 01:08:19
Sorry---this is going away.
| |
| 778 } | |
| 779 | |
| 756 void ChromeBrowserMainPartsChromeos::PostBrowserStart() { | 780 void ChromeBrowserMainPartsChromeos::PostBrowserStart() { |
| 757 // These are dependent on the ash::Shell singleton already having been | 781 // These are dependent on the ash::Shell singleton already having been |
| 758 // initialized. | 782 // initialized. |
| 759 power_button_observer_.reset(new PowerButtonObserver); | 783 power_button_observer_.reset(new PowerButtonObserver); |
| 760 data_promo_notification_.reset(new DataPromoNotification()), | 784 data_promo_notification_.reset(new DataPromoNotification()), |
| 761 keyboard_event_rewriters_->Init(); | 785 keyboard_event_rewriters_->Init(); |
| 762 | 786 |
| 763 ChromeBrowserMainPartsLinux::PostBrowserStart(); | 787 ChromeBrowserMainPartsLinux::PostBrowserStart(); |
| 764 } | 788 } |
| 765 | 789 |
| (...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 865 // Destroy DBus services immediately after threads are stopped. | 889 // Destroy DBus services immediately after threads are stopped. |
| 866 dbus_services_.reset(); | 890 dbus_services_.reset(); |
| 867 | 891 |
| 868 ChromeBrowserMainPartsLinux::PostDestroyThreads(); | 892 ChromeBrowserMainPartsLinux::PostDestroyThreads(); |
| 869 | 893 |
| 870 // Destroy DeviceSettingsService after g_browser_process. | 894 // Destroy DeviceSettingsService after g_browser_process. |
| 871 DeviceSettingsService::Shutdown(); | 895 DeviceSettingsService::Shutdown(); |
| 872 } | 896 } |
| 873 | 897 |
| 874 } // namespace chromeos | 898 } // namespace chromeos |
| OLD | NEW |