OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 #ifndef BASE_WIN_UTIL_H__ | 5 #ifndef BASE_WIN_UTIL_H__ |
6 #define BASE_WIN_UTIL_H__ | 6 #define BASE_WIN_UTIL_H__ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include <windows.h> | 9 #include <windows.h> |
10 | 10 |
11 #include <string> | 11 #include <string> |
12 | 12 |
13 #include "base/keyboard_codes.h" | 13 #include "base/keyboard_codes.h" |
| 14 #include "base/string16.h" |
14 | 15 |
15 struct IPropertyStore; | 16 struct IPropertyStore; |
16 struct _tagpropertykey; | 17 struct _tagpropertykey; |
17 typedef _tagpropertykey PROPERTYKEY; | 18 typedef _tagpropertykey PROPERTYKEY; |
18 | 19 |
19 namespace win_util { | 20 namespace win_util { |
20 | 21 |
21 // NOTE: Keep these in order so callers can do things like | 22 // NOTE: Keep these in order so callers can do things like |
22 // "if (GetWinVersion() > WINVERSION_2000) ...". It's OK to change the values, | 23 // "if (GetWinVersion() > WINVERSION_2000) ...". It's OK to change the values, |
23 // though. | 24 // though. |
(...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
118 // Methods to convert base::KeyboardCode/Windows virtual key type methods. | 119 // Methods to convert base::KeyboardCode/Windows virtual key type methods. |
119 WORD KeyboardCodeToWin(base::KeyboardCode keycode); | 120 WORD KeyboardCodeToWin(base::KeyboardCode keycode); |
120 base::KeyboardCode WinToKeyboardCode(WORD keycode); | 121 base::KeyboardCode WinToKeyboardCode(WORD keycode); |
121 | 122 |
122 // Sets the application id in given IPropertyStore. The function is intended | 123 // Sets the application id in given IPropertyStore. The function is intended |
123 // for tagging application/chromium shortcut, browser window and jump list for | 124 // for tagging application/chromium shortcut, browser window and jump list for |
124 // Win7. | 125 // Win7. |
125 bool SetAppIdForPropertyStore(IPropertyStore* property_store, | 126 bool SetAppIdForPropertyStore(IPropertyStore* property_store, |
126 const wchar_t* app_id); | 127 const wchar_t* app_id); |
127 | 128 |
| 129 // Adds the specified |command| using the specified |name| to the AutoRun key. |
| 130 // |root_key| could be HKCU or HKLM or the root of any user hive. |
| 131 bool AddCommandToAutoRun(HKEY root_key, const string16& name, |
| 132 const string16& command); |
| 133 // Removes the command specified by |name| from the AutoRun key. |root_key| |
| 134 // could be HKCU or HKLM or the root of any user hive. |
| 135 bool RemoveCommandFromAutoRun(HKEY root_key, const string16& name); |
| 136 |
128 } // namespace win_util | 137 } // namespace win_util |
129 | 138 |
130 #endif // BASE_WIN_UTIL_H__ | 139 #endif // BASE_WIN_UTIL_H__ |
OLD | NEW |