| 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 <algorithm> | 7 #include <algorithm> |
| 8 #include <set> | 8 #include <set> |
| 9 #include <string> | 9 #include <string> |
| 10 #include <vector> | 10 #include <vector> |
| (...skipping 156 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 167 void BluetoothDeviceConnectError( | 167 void BluetoothDeviceConnectError( |
| 168 device::BluetoothDevice::ConnectErrorCode error_code) { | 168 device::BluetoothDevice::ConnectErrorCode error_code) { |
| 169 // TODO(sad): Do something? | 169 // TODO(sad): Do something? |
| 170 } | 170 } |
| 171 | 171 |
| 172 void ShowSettingsSubPageForActiveUser(const std::string& sub_page) { | 172 void ShowSettingsSubPageForActiveUser(const std::string& sub_page) { |
| 173 chrome::ShowSettingsSubPageForProfile( | 173 chrome::ShowSettingsSubPageForProfile( |
| 174 ProfileManager::GetActiveUserProfile(), sub_page); | 174 ProfileManager::GetActiveUserProfile(), sub_page); |
| 175 } | 175 } |
| 176 | 176 |
| 177 void ShowNetworkSettingsPage(const std::string& service_path) { | |
| 178 std::string page = chrome::kInternetOptionsSubPage; | |
| 179 page += "?servicePath=" + net::EscapeUrlEncodedData(service_path, true); | |
| 180 content::RecordAction(base::UserMetricsAction("OpenInternetOptionsDialog")); | |
| 181 ShowSettingsSubPageForActiveUser(page); | |
| 182 } | |
| 183 | |
| 184 void OnAcceptMultiprofilesIntro(bool no_show_again) { | 177 void OnAcceptMultiprofilesIntro(bool no_show_again) { |
| 185 PrefService* prefs = ProfileManager::GetActiveUserProfile()->GetPrefs(); | 178 PrefService* prefs = ProfileManager::GetActiveUserProfile()->GetPrefs(); |
| 186 prefs->SetBoolean(prefs::kMultiProfileNeverShowIntro, no_show_again); | 179 prefs->SetBoolean(prefs::kMultiProfileNeverShowIntro, no_show_again); |
| 187 UserAddingScreen::Get()->Start(); | 180 UserAddingScreen::Get()->Start(); |
| 188 } | 181 } |
| 189 | 182 |
| 190 } // namespace | 183 } // namespace |
| 191 | 184 |
| 192 SystemTrayDelegateChromeOS::SystemTrayDelegateChromeOS() | 185 SystemTrayDelegateChromeOS::SystemTrayDelegateChromeOS() |
| 193 : user_profile_(NULL), | 186 : user_profile_(NULL), |
| (...skipping 252 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 446 std::string(chrome::kSearchSubPage) + "#" + | 439 std::string(chrome::kSearchSubPage) + "#" + |
| 447 l10n_util::GetStringUTF8(IDS_OPTIONS_SETTINGS_SECTION_TITLE_DATETIME); | 440 l10n_util::GetStringUTF8(IDS_OPTIONS_SETTINGS_SECTION_TITLE_DATETIME); |
| 448 // Everybody can change the time zone (even though it is a device setting). | 441 // Everybody can change the time zone (even though it is a device setting). |
| 449 ShowSettingsSubPageForActiveUser(sub_page); | 442 ShowSettingsSubPageForActiveUser(sub_page); |
| 450 } | 443 } |
| 451 | 444 |
| 452 void SystemTrayDelegateChromeOS::ShowSetTimeDialog() { | 445 void SystemTrayDelegateChromeOS::ShowSetTimeDialog() { |
| 453 SetTimeDialog::ShowDialog(GetNativeWindow()); | 446 SetTimeDialog::ShowDialog(GetNativeWindow()); |
| 454 } | 447 } |
| 455 | 448 |
| 456 void SystemTrayDelegateChromeOS::ShowNetworkSettings( | 449 void SystemTrayDelegateChromeOS::ShowNetworkSettingsForGuid( |
| 457 const std::string& service_path) { | 450 const std::string& guid) { |
| 458 bool userAddingRunning = ash::Shell::GetInstance() | 451 bool userAddingRunning = ash::Shell::GetInstance() |
| 459 ->session_state_delegate() | 452 ->session_state_delegate() |
| 460 ->IsInSecondaryLoginScreen(); | 453 ->IsInSecondaryLoginScreen(); |
| 461 | 454 |
| 462 if (!LoginState::Get()->IsUserLoggedIn() || userAddingRunning) | 455 if (!LoginState::Get()->IsUserLoggedIn() || userAddingRunning) |
| 463 return; | 456 return; |
| 464 ShowNetworkSettingsPage(service_path); | 457 std::string page = chrome::kInternetOptionsSubPage; |
| 458 if (!guid.empty()) |
| 459 page += "?guid=" + net::EscapeUrlEncodedData(guid, true); |
| 460 content::RecordAction(base::UserMetricsAction("OpenInternetOptionsDialog")); |
| 461 ShowSettingsSubPageForActiveUser(page); |
| 465 } | 462 } |
| 466 | 463 |
| 467 void SystemTrayDelegateChromeOS::ShowBluetoothSettings() { | 464 void SystemTrayDelegateChromeOS::ShowBluetoothSettings() { |
| 468 // TODO(sad): Make this work. | 465 // TODO(sad): Make this work. |
| 469 } | 466 } |
| 470 | 467 |
| 471 void SystemTrayDelegateChromeOS::ShowDisplaySettings() { | 468 void SystemTrayDelegateChromeOS::ShowDisplaySettings() { |
| 472 content::RecordAction(base::UserMetricsAction("ShowDisplayOptions")); | 469 content::RecordAction(base::UserMetricsAction("ShowDisplayOptions")); |
| 473 ShowSettingsSubPageForActiveUser(kDisplaySettingsSubPageName); | 470 ShowSettingsSubPageForActiveUser(kDisplaySettingsSubPageName); |
| 474 } | 471 } |
| (...skipping 912 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1387 LOG(WARNING) << "SystemTrayDelegateChromeOS::GetChildUserMessage call while " | 1384 LOG(WARNING) << "SystemTrayDelegateChromeOS::GetChildUserMessage call while " |
| 1388 << "ENABLE_SUPERVISED_USERS undefined."; | 1385 << "ENABLE_SUPERVISED_USERS undefined."; |
| 1389 return base::string16(); | 1386 return base::string16(); |
| 1390 } | 1387 } |
| 1391 | 1388 |
| 1392 ash::SystemTrayDelegate* CreateSystemTrayDelegate() { | 1389 ash::SystemTrayDelegate* CreateSystemTrayDelegate() { |
| 1393 return new SystemTrayDelegateChromeOS(); | 1390 return new SystemTrayDelegateChromeOS(); |
| 1394 } | 1391 } |
| 1395 | 1392 |
| 1396 } // namespace chromeos | 1393 } // namespace chromeos |
| OLD | NEW |