| 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 #include <algorithm> | 8 #include <algorithm> |
| 9 #include <set> | 9 #include <set> |
| 10 #include <string> | 10 #include <string> |
| (...skipping 445 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 456 if (!LoginState::Get()->IsUserLoggedIn() || userAddingRunning) | 456 if (!LoginState::Get()->IsUserLoggedIn() || userAddingRunning) |
| 457 return; | 457 return; |
| 458 std::string page = chrome::kInternetOptionsSubPage; | 458 std::string page = chrome::kInternetOptionsSubPage; |
| 459 if (!guid.empty()) | 459 if (!guid.empty()) |
| 460 page += "?guid=" + net::EscapeUrlEncodedData(guid, true); | 460 page += "?guid=" + net::EscapeUrlEncodedData(guid, true); |
| 461 content::RecordAction(base::UserMetricsAction("OpenInternetOptionsDialog")); | 461 content::RecordAction(base::UserMetricsAction("OpenInternetOptionsDialog")); |
| 462 ShowSettingsSubPageForActiveUser(page); | 462 ShowSettingsSubPageForActiveUser(page); |
| 463 } | 463 } |
| 464 | 464 |
| 465 void SystemTrayDelegateChromeOS::ShowDisplaySettings() { | 465 void SystemTrayDelegateChromeOS::ShowDisplaySettings() { |
| 466 // TODO(michaelpg): Allow display settings to be shown when they are updated | |
| 467 // to work for 3+ displays. See issue 467195. | |
| 468 if (ash::Shell::GetInstance()->display_manager()->num_connected_displays() > | |
| 469 2) { | |
| 470 return; | |
| 471 } | |
| 472 content::RecordAction(base::UserMetricsAction("ShowDisplayOptions")); | 466 content::RecordAction(base::UserMetricsAction("ShowDisplayOptions")); |
| 473 ShowSettingsSubPageForActiveUser(kDisplaySettingsSubPageName); | 467 ShowSettingsSubPageForActiveUser(kDisplaySettingsSubPageName); |
| 474 } | 468 } |
| 475 | 469 |
| 476 void SystemTrayDelegateChromeOS::ShowPowerSettings() { | 470 void SystemTrayDelegateChromeOS::ShowPowerSettings() { |
| 477 if (!(switches::PowerOverlayEnabled() || | 471 if (!(switches::PowerOverlayEnabled() || |
| 478 (ash::PowerStatus::Get()->IsBatteryPresent() && | 472 (ash::PowerStatus::Get()->IsBatteryPresent() && |
| 479 ash::PowerStatus::Get()->SupportsDualRoleDevices()))) { | 473 ash::PowerStatus::Get()->SupportsDualRoleDevices()))) { |
| 480 return; | 474 return; |
| 481 } | 475 } |
| (...skipping 854 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1336 LOG(WARNING) << "SystemTrayDelegateChromeOS::GetChildUserMessage call while " | 1330 LOG(WARNING) << "SystemTrayDelegateChromeOS::GetChildUserMessage call while " |
| 1337 << "ENABLE_SUPERVISED_USERS undefined."; | 1331 << "ENABLE_SUPERVISED_USERS undefined."; |
| 1338 return base::string16(); | 1332 return base::string16(); |
| 1339 } | 1333 } |
| 1340 | 1334 |
| 1341 ash::SystemTrayDelegate* CreateSystemTrayDelegate() { | 1335 ash::SystemTrayDelegate* CreateSystemTrayDelegate() { |
| 1342 return new SystemTrayDelegateChromeOS(); | 1336 return new SystemTrayDelegateChromeOS(); |
| 1343 } | 1337 } |
| 1344 | 1338 |
| 1345 } // namespace chromeos | 1339 } // namespace chromeos |
| OLD | NEW |