Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(248)

Side by Side Diff: ui/base/accelerators/accelerator.cc

Issue 23445013: Parse media keys for named command in the manifest. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: nit fix. Created 7 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 "ui/base/accelerators/accelerator.h" 5 #include "ui/base/accelerators/accelerator.h"
6 6
7 #if defined(OS_WIN) 7 #if defined(OS_WIN)
8 #include <windows.h> 8 #include <windows.h>
9 #elif defined(TOOLKIT_GTK) 9 #elif defined(TOOLKIT_GTK)
10 #include <gdk/gdk.h> 10 #include <gdk/gdk.h>
(...skipping 137 matching lines...) Expand 10 before | Expand all | Expand 10 after
148 break; 148 break;
149 case ui::VKEY_F11: 149 case ui::VKEY_F11:
150 string_id = IDS_APP_F11_KEY; 150 string_id = IDS_APP_F11_KEY;
151 break; 151 break;
152 case ui::VKEY_OEM_COMMA: 152 case ui::VKEY_OEM_COMMA:
153 string_id = IDS_APP_COMMA_KEY; 153 string_id = IDS_APP_COMMA_KEY;
154 break; 154 break;
155 case ui::VKEY_OEM_PERIOD: 155 case ui::VKEY_OEM_PERIOD:
156 string_id = IDS_APP_PERIOD_KEY; 156 string_id = IDS_APP_PERIOD_KEY;
157 break; 157 break;
158 case ui::VKEY_MEDIA_NEXT_TRACK:
159 string_id = IDS_APP_MEDIA_NEXT_TRACK_KEY;
160 break;
161 case ui::VKEY_MEDIA_PLAY_PAUSE:
162 string_id = IDS_APP_MEDIA_PLAY_PAUSE_KEY;
163 break;
164 case ui::VKEY_MEDIA_PREV_TRACK:
165 string_id = IDS_APP_MEDIA_PREV_TRACK_KEY;
166 break;
167 case ui::VKEY_MEDIA_STOP:
168 string_id = IDS_APP_MEDIA_STOP_KEY;
169 break;
158 default: 170 default:
159 break; 171 break;
160 } 172 }
161 173
162 base::string16 shortcut; 174 base::string16 shortcut;
163 if (!string_id) { 175 if (!string_id) {
164 #if defined(OS_WIN) 176 #if defined(OS_WIN)
165 // Our fallback is to try translate the key code to a regular character 177 // Our fallback is to try translate the key code to a regular character
166 // unless it is one of digits (VK_0 to VK_9). Some keyboard 178 // unless it is one of digits (VK_0 to VK_9). Some keyboard
167 // layouts have characters other than digits assigned in 179 // layouts have characters other than digits assigned in
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after
254 266
255 // Subtracting the size of the shortcut key and 1 for the '+' sign. 267 // Subtracting the size of the shortcut key and 1 for the '+' sign.
256 shortcut_rtl.append(shortcut, 0, shortcut.length() - key_length - 1); 268 shortcut_rtl.append(shortcut, 0, shortcut.length() - key_length - 1);
257 shortcut.swap(shortcut_rtl); 269 shortcut.swap(shortcut_rtl);
258 } 270 }
259 271
260 return shortcut; 272 return shortcut;
261 } 273 }
262 274
263 } // namespace ui 275 } // namespace ui
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698