| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 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/ui/ash/system_tray_delegate_chromeos.h" | 5 #include "chrome/browser/ui/ash/system_tray_delegate_chromeos.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 | 8 |
| 9 #include <algorithm> | 9 #include <algorithm> |
| 10 #include <set> | 10 #include <set> |
| (...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 138 void BluetoothDeviceConnectError( | 138 void BluetoothDeviceConnectError( |
| 139 device::BluetoothDevice::ConnectErrorCode error_code) { | 139 device::BluetoothDevice::ConnectErrorCode error_code) { |
| 140 } | 140 } |
| 141 | 141 |
| 142 std::unique_ptr<ash::CastConfigDelegate> CreateCastConfigDelegate() { | 142 std::unique_ptr<ash::CastConfigDelegate> CreateCastConfigDelegate() { |
| 143 if (CastConfigDelegateMediaRouter::IsEnabled()) | 143 if (CastConfigDelegateMediaRouter::IsEnabled()) |
| 144 return base::MakeUnique<CastConfigDelegateMediaRouter>(); | 144 return base::MakeUnique<CastConfigDelegateMediaRouter>(); |
| 145 return base::MakeUnique<CastConfigDelegateChromeos>(); | 145 return base::MakeUnique<CastConfigDelegateChromeos>(); |
| 146 } | 146 } |
| 147 | 147 |
| 148 void ShowSettingsSubPageForActiveUser(const std::string& sub_page) { | |
| 149 chrome::ShowSettingsSubPageForProfile( | |
| 150 ProfileManager::GetActiveUserProfile(), sub_page); | |
| 151 } | |
| 152 | |
| 153 void OnAcceptMultiprofilesIntro(bool no_show_again) { | 148 void OnAcceptMultiprofilesIntro(bool no_show_again) { |
| 154 PrefService* prefs = ProfileManager::GetActiveUserProfile()->GetPrefs(); | 149 PrefService* prefs = ProfileManager::GetActiveUserProfile()->GetPrefs(); |
| 155 prefs->SetBoolean(prefs::kMultiProfileNeverShowIntro, no_show_again); | 150 prefs->SetBoolean(prefs::kMultiProfileNeverShowIntro, no_show_again); |
| 156 UserAddingScreen::Get()->Start(); | 151 UserAddingScreen::Get()->Start(); |
| 157 } | 152 } |
| 158 | 153 |
| 159 } // namespace | 154 } // namespace |
| 160 | 155 |
| 161 SystemTrayDelegateChromeOS::SystemTrayDelegateChromeOS() | 156 SystemTrayDelegateChromeOS::SystemTrayDelegateChromeOS() |
| 162 : user_profile_(NULL), | 157 : user_profile_(NULL), |
| (...skipping 377 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 540 input_method::InputMethodSwitchRecorder::Get()->RecordSwitch( | 535 input_method::InputMethodSwitchRecorder::Get()->RecordSwitch( |
| 541 true /* by_tray_menu */); | 536 true /* by_tray_menu */); |
| 542 } | 537 } |
| 543 | 538 |
| 544 void SystemTrayDelegateChromeOS::ActivateIMEProperty(const std::string& key) { | 539 void SystemTrayDelegateChromeOS::ActivateIMEProperty(const std::string& key) { |
| 545 input_method::InputMethodManager::Get()->ActivateInputMethodMenuItem(key); | 540 input_method::InputMethodManager::Get()->ActivateInputMethodMenuItem(key); |
| 546 } | 541 } |
| 547 | 542 |
| 548 void SystemTrayDelegateChromeOS::ManageBluetoothDevices() { | 543 void SystemTrayDelegateChromeOS::ManageBluetoothDevices() { |
| 549 content::RecordAction(base::UserMetricsAction("ShowBluetoothSettingsPage")); | 544 content::RecordAction(base::UserMetricsAction("ShowBluetoothSettingsPage")); |
| 550 std::string sub_page = | 545 chrome::ShowSettingsSubPageForProfile(ProfileManager::GetActiveUserProfile(), |
| 551 std::string(chrome::kSearchSubPage) + "#" + | 546 chrome::kBluetoothSubPage); |
| 552 l10n_util::GetStringUTF8(IDS_OPTIONS_SETTINGS_SECTION_TITLE_BLUETOOTH); | |
| 553 ShowSettingsSubPageForActiveUser(sub_page); | |
| 554 } | 547 } |
| 555 | 548 |
| 556 void SystemTrayDelegateChromeOS::ToggleBluetooth() { | 549 void SystemTrayDelegateChromeOS::ToggleBluetooth() { |
| 557 bluetooth_adapter_->SetPowered(!bluetooth_adapter_->IsPowered(), | 550 bluetooth_adapter_->SetPowered(!bluetooth_adapter_->IsPowered(), |
| 558 base::Bind(&base::DoNothing), | 551 base::Bind(&base::DoNothing), |
| 559 base::Bind(&base::DoNothing)); | 552 base::Bind(&base::DoNothing)); |
| 560 } | 553 } |
| 561 | 554 |
| 562 bool SystemTrayDelegateChromeOS::GetBluetoothAvailable() { | 555 bool SystemTrayDelegateChromeOS::GetBluetoothAvailable() { |
| 563 return bluetooth_adapter_ && bluetooth_adapter_->IsPresent(); | 556 return bluetooth_adapter_ && bluetooth_adapter_->IsPresent(); |
| (...skipping 519 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1083 LOG(WARNING) << "SystemTrayDelegateChromeOS::GetChildUserMessage call while " | 1076 LOG(WARNING) << "SystemTrayDelegateChromeOS::GetChildUserMessage call while " |
| 1084 << "ENABLE_SUPERVISED_USERS undefined."; | 1077 << "ENABLE_SUPERVISED_USERS undefined."; |
| 1085 return base::string16(); | 1078 return base::string16(); |
| 1086 } | 1079 } |
| 1087 | 1080 |
| 1088 ash::SystemTrayDelegate* CreateSystemTrayDelegate() { | 1081 ash::SystemTrayDelegate* CreateSystemTrayDelegate() { |
| 1089 return new SystemTrayDelegateChromeOS(); | 1082 return new SystemTrayDelegateChromeOS(); |
| 1090 } | 1083 } |
| 1091 | 1084 |
| 1092 } // namespace chromeos | 1085 } // namespace chromeos |
| OLD | NEW |