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

Side by Side Diff: chrome/common/extensions/command.cc

Issue 10446010: wip: Add ui::EventType parameter. Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: wip - views_unittests Created 8 years, 7 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 | Annotate | Revision Log
« no previous file with comments | « chrome/browser/ui/views/wrench_menu.cc ('k') | chrome/common/extensions/command_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 "chrome/common/extensions/command.h" 5 #include "chrome/common/extensions/command.h"
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 #include "base/string_number_conversions.h" 8 #include "base/string_number_conversions.h"
9 #include "base/string_split.h" 9 #include "base/string_split.h"
10 #include "base/values.h" 10 #include "base/values.h"
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after
90 // http://blogs.msdn.com/b/oldnewthing/archive/2004/03/29/101121.aspx. 90 // http://blogs.msdn.com/b/oldnewthing/archive/2004/03/29/101121.aspx.
91 if (key == ui::VKEY_UNKNOWN || (ctrl && alt)) { 91 if (key == ui::VKEY_UNKNOWN || (ctrl && alt)) {
92 *error = ExtensionErrorUtils::FormatErrorMessageUTF16( 92 *error = ExtensionErrorUtils::FormatErrorMessageUTF16(
93 errors::kInvalidKeyBinding, 93 errors::kInvalidKeyBinding,
94 base::IntToString(index), 94 base::IntToString(index),
95 platform_key, 95 platform_key,
96 shortcut); 96 shortcut);
97 return ui::Accelerator(); 97 return ui::Accelerator();
98 } 98 }
99 99
100 return ui::Accelerator(key, modifiers); 100 return ui::Accelerator(key, modifiers, ui::ET_KEY_PRESSED);
101 } 101 }
102 102
103 // static 103 // static
104 std::string Command::CommandPlatform() { 104 std::string Command::CommandPlatform() {
105 #if defined(OS_WIN) 105 #if defined(OS_WIN)
106 return values::kKeybindingPlatformWin; 106 return values::kKeybindingPlatformWin;
107 #elif defined(OS_MACOSX) 107 #elif defined(OS_MACOSX)
108 return values::kKeybindingPlatformMac; 108 return values::kKeybindingPlatformMac;
109 #elif defined(OS_CHROMEOS) 109 #elif defined(OS_CHROMEOS)
110 return values::kKeybindingPlatformChromeOs; 110 return values::kKeybindingPlatformChromeOs;
(...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after
229 command_description = description(); 229 command_description = description();
230 } 230 }
231 extension_data->SetString("description", command_description); 231 extension_data->SetString("description", command_description);
232 extension_data->SetBoolean("active", active); 232 extension_data->SetBoolean("active", active);
233 extension_data->SetString("keybinding", accelerator().GetShortcutText()); 233 extension_data->SetString("keybinding", accelerator().GetShortcutText());
234 234
235 return extension_data; 235 return extension_data;
236 } 236 }
237 237
238 } // namespace extensions 238 } // namespace extensions
OLDNEW
« no previous file with comments | « chrome/browser/ui/views/wrench_menu.cc ('k') | chrome/common/extensions/command_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698