| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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 "ash/accelerators/accelerator_controller_delegate_aura.h" | 5 #include "ash/accelerators/accelerator_controller_delegate_aura.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <cmath> | 8 #include <cmath> |
| 9 #include <string> | 9 #include <string> |
| 10 #include <utility> | 10 #include <utility> |
| (...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 66 class DeprecatedAcceleratorNotificationDelegate | 66 class DeprecatedAcceleratorNotificationDelegate |
| 67 : public message_center::NotificationDelegate { | 67 : public message_center::NotificationDelegate { |
| 68 public: | 68 public: |
| 69 DeprecatedAcceleratorNotificationDelegate() {} | 69 DeprecatedAcceleratorNotificationDelegate() {} |
| 70 | 70 |
| 71 // message_center::NotificationDelegate: | 71 // message_center::NotificationDelegate: |
| 72 bool HasClickedListener() override { return true; } | 72 bool HasClickedListener() override { return true; } |
| 73 | 73 |
| 74 void Click() override { | 74 void Click() override { |
| 75 if (!WmShell::Get()->GetSessionStateDelegate()->IsUserSessionBlocked()) | 75 if (!WmShell::Get()->GetSessionStateDelegate()->IsUserSessionBlocked()) |
| 76 WmShell::Get()->delegate()->OpenKeyboardShortcutHelpPage(); | 76 Shell::Get()->shell_delegate()->OpenKeyboardShortcutHelpPage(); |
| 77 } | 77 } |
| 78 | 78 |
| 79 private: | 79 private: |
| 80 // Private destructor since NotificationDelegate is ref-counted. | 80 // Private destructor since NotificationDelegate is ref-counted. |
| 81 ~DeprecatedAcceleratorNotificationDelegate() override {} | 81 ~DeprecatedAcceleratorNotificationDelegate() override {} |
| 82 | 82 |
| 83 DISALLOW_COPY_AND_ASSIGN(DeprecatedAcceleratorNotificationDelegate); | 83 DISALLOW_COPY_AND_ASSIGN(DeprecatedAcceleratorNotificationDelegate); |
| 84 }; | 84 }; |
| 85 | 85 |
| 86 // Ensures that there are no word breaks at the "+"s in the shortcut texts such | 86 // Ensures that there are no word breaks at the "+"s in the shortcut texts such |
| (...skipping 381 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 468 const char* const notification_id, | 468 const char* const notification_id, |
| 469 int message_id, | 469 int message_id, |
| 470 int old_shortcut_id, | 470 int old_shortcut_id, |
| 471 int new_shortcut_id) { | 471 int new_shortcut_id) { |
| 472 const base::string16 message = | 472 const base::string16 message = |
| 473 GetNotificationText(message_id, old_shortcut_id, new_shortcut_id); | 473 GetNotificationText(message_id, old_shortcut_id, new_shortcut_id); |
| 474 std::unique_ptr<message_center::Notification> notification( | 474 std::unique_ptr<message_center::Notification> notification( |
| 475 new message_center::Notification( | 475 new message_center::Notification( |
| 476 message_center::NOTIFICATION_TYPE_SIMPLE, notification_id, | 476 message_center::NOTIFICATION_TYPE_SIMPLE, notification_id, |
| 477 base::string16(), message, | 477 base::string16(), message, |
| 478 WmShell::Get()->delegate()->GetDeprecatedAcceleratorImage(), | 478 Shell::Get()->shell_delegate()->GetDeprecatedAcceleratorImage(), |
| 479 base::string16(), GURL(), | 479 base::string16(), GURL(), |
| 480 message_center::NotifierId( | 480 message_center::NotifierId( |
| 481 message_center::NotifierId::SYSTEM_COMPONENT, | 481 message_center::NotifierId::SYSTEM_COMPONENT, |
| 482 system_notifier::kNotifierDeprecatedAccelerator), | 482 system_notifier::kNotifierDeprecatedAccelerator), |
| 483 message_center::RichNotificationData(), | 483 message_center::RichNotificationData(), |
| 484 new DeprecatedAcceleratorNotificationDelegate)); | 484 new DeprecatedAcceleratorNotificationDelegate)); |
| 485 message_center::MessageCenter::Get()->AddNotification( | 485 message_center::MessageCenter::Get()->AddNotification( |
| 486 std::move(notification)); | 486 std::move(notification)); |
| 487 } | 487 } |
| 488 | 488 |
| 489 } // namespace ash | 489 } // namespace ash |
| OLD | NEW |