| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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.h" | 5 #include "ash/accelerators/accelerator_controller.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 126 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 137 // The plus sign surrounded by the word joiner to guarantee an non-breaking | 137 // The plus sign surrounded by the word joiner to guarantee an non-breaking |
| 138 // shortcut. | 138 // shortcut. |
| 139 const base::string16 non_breaking_plus = | 139 const base::string16 non_breaking_plus = |
| 140 base::UTF8ToUTF16("\xe2\x81\xa0+\xe2\x81\xa0"); | 140 base::UTF8ToUTF16("\xe2\x81\xa0+\xe2\x81\xa0"); |
| 141 shortcut_text->clear(); | 141 shortcut_text->clear(); |
| 142 for (size_t i = 0; i < keys.size() - 1; ++i) { | 142 for (size_t i = 0; i < keys.size() - 1; ++i) { |
| 143 *shortcut_text += keys[i]; | 143 *shortcut_text += keys[i]; |
| 144 *shortcut_text += non_breaking_plus; | 144 *shortcut_text += non_breaking_plus; |
| 145 } | 145 } |
| 146 | 146 |
| 147 *shortcut_text += keys[keys.size() - 1]; | 147 *shortcut_text += keys.back(); |
| 148 } | 148 } |
| 149 | 149 |
| 150 // Gets the notification message after it formats it in such a way that there | 150 // Gets the notification message after it formats it in such a way that there |
| 151 // are no line breaks in the middle of the shortcut texts. | 151 // are no line breaks in the middle of the shortcut texts. |
| 152 base::string16 GetNotificationText(int message_id, | 152 base::string16 GetNotificationText(int message_id, |
| 153 int old_shortcut_id, | 153 int old_shortcut_id, |
| 154 int new_shortcut_id) { | 154 int new_shortcut_id) { |
| 155 base::string16 old_shortcut = l10n_util::GetStringUTF16(old_shortcut_id); | 155 base::string16 old_shortcut = l10n_util::GetStringUTF16(old_shortcut_id); |
| 156 base::string16 new_shortcut = l10n_util::GetStringUTF16(new_shortcut_id); | 156 base::string16 new_shortcut = l10n_util::GetStringUTF16(new_shortcut_id); |
| 157 EnsureNoWordBreaks(&old_shortcut); | 157 EnsureNoWordBreaks(&old_shortcut); |
| (...skipping 1250 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1408 if (wm_shell->mru_window_tracker()->BuildMruWindowList().empty() && | 1408 if (wm_shell->mru_window_tracker()->BuildMruWindowList().empty() && |
| 1409 actions_needing_window_.find(action) != actions_needing_window_.end()) { | 1409 actions_needing_window_.find(action) != actions_needing_window_.end()) { |
| 1410 wm_shell->GetAccessibilityDelegate()->TriggerAccessibilityAlert( | 1410 wm_shell->GetAccessibilityDelegate()->TriggerAccessibilityAlert( |
| 1411 A11Y_ALERT_WINDOW_NEEDED); | 1411 A11Y_ALERT_WINDOW_NEEDED); |
| 1412 return RESTRICTION_PREVENT_PROCESSING_AND_PROPAGATION; | 1412 return RESTRICTION_PREVENT_PROCESSING_AND_PROPAGATION; |
| 1413 } | 1413 } |
| 1414 return RESTRICTION_NONE; | 1414 return RESTRICTION_NONE; |
| 1415 } | 1415 } |
| 1416 | 1416 |
| 1417 } // namespace ash | 1417 } // namespace ash |
| OLD | NEW |