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

Side by Side Diff: base/win/win_util.h

Issue 6747014: Base: Last set of files to use BASE_API (for base.dll) (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 9 years, 9 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
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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 // ============================================================================= 5 // =============================================================================
6 // PLEASE READ 6 // PLEASE READ
7 // 7 //
8 // In general, you should not be adding stuff to this file. 8 // In general, you should not be adding stuff to this file.
9 // 9 //
10 // - If your thing is only used in one place, just put it in a reasonable 10 // - If your thing is only used in one place, just put it in a reasonable
11 // location in or near that one place. It's nice you want people to be able 11 // location in or near that one place. It's nice you want people to be able
12 // to re-use your function, but realistically, if it hasn't been necessary 12 // to re-use your function, but realistically, if it hasn't been necessary
13 // before after so many years of development, it's probably not going to be 13 // before after so many years of development, it's probably not going to be
14 // used in other places in the future unless you know of them now. 14 // used in other places in the future unless you know of them now.
15 // 15 //
16 // - If your thing is used by multiple callers and is UI-related, it should 16 // - If your thing is used by multiple callers and is UI-related, it should
17 // probably be in app/win/ instead. Try to put it in the most specific file 17 // probably be in app/win/ instead. Try to put it in the most specific file
18 // possible (avoiding the *_util files when practical). 18 // possible (avoiding the *_util files when practical).
19 // 19 //
20 // ============================================================================= 20 // =============================================================================
21 21
22 #ifndef BASE_WIN_WIN_UTIL_H_ 22 #ifndef BASE_WIN_WIN_UTIL_H_
23 #define BASE_WIN_WIN_UTIL_H_ 23 #define BASE_WIN_WIN_UTIL_H_
24 #pragma once 24 #pragma once
25 25
26 #include <windows.h> 26 #include <windows.h>
27 27
28 #include <string> 28 #include <string>
29 29
30 #include "base/base_api.h"
30 #include "base/string16.h" 31 #include "base/string16.h"
31 32
32 struct IPropertyStore; 33 struct IPropertyStore;
33 struct _tagpropertykey; 34 struct _tagpropertykey;
34 typedef _tagpropertykey PROPERTYKEY; 35 typedef _tagpropertykey PROPERTYKEY;
35 36
36 namespace base { 37 namespace base {
37 namespace win { 38 namespace win {
38 39
39 void GetNonClientMetrics(NONCLIENTMETRICS* metrics); 40 BASE_API void GetNonClientMetrics(NONCLIENTMETRICS* metrics);
40 41
41 // Returns the string representing the current user sid. 42 // Returns the string representing the current user sid.
42 bool GetUserSidString(std::wstring* user_sid); 43 BASE_API bool GetUserSidString(std::wstring* user_sid);
43 44
44 // Returns true if the shift key is currently pressed. 45 // Returns true if the shift key is currently pressed.
45 bool IsShiftPressed(); 46 BASE_API bool IsShiftPressed();
46 47
47 // Returns true if the ctrl key is currently pressed. 48 // Returns true if the ctrl key is currently pressed.
48 bool IsCtrlPressed(); 49 BASE_API bool IsCtrlPressed();
49 50
50 // Returns true if the alt key is currently pressed. 51 // Returns true if the alt key is currently pressed.
51 bool IsAltPressed(); 52 BASE_API bool IsAltPressed();
52 53
53 // Returns false if user account control (UAC) has been disabled with the 54 // Returns false if user account control (UAC) has been disabled with the
54 // EnableLUA registry flag. Returns true if user account control is enabled. 55 // EnableLUA registry flag. Returns true if user account control is enabled.
55 // NOTE: The EnableLUA registry flag, which is ignored on Windows XP 56 // NOTE: The EnableLUA registry flag, which is ignored on Windows XP
56 // machines, might still exist and be set to 0 (UAC disabled), in which case 57 // machines, might still exist and be set to 0 (UAC disabled), in which case
57 // this function will return false. You should therefore check this flag only 58 // this function will return false. You should therefore check this flag only
58 // if the OS is Vista or later. 59 // if the OS is Vista or later.
59 bool UserAccountControlIsEnabled(); 60 BASE_API bool UserAccountControlIsEnabled();
60 61
61 // Sets the application id in given IPropertyStore. The function is intended 62 // Sets the application id in given IPropertyStore. The function is intended
62 // for tagging application/chromium shortcut, browser window and jump list for 63 // for tagging application/chromium shortcut, browser window and jump list for
63 // Win7. 64 // Win7.
64 bool SetAppIdForPropertyStore(IPropertyStore* property_store, 65 BASE_API bool SetAppIdForPropertyStore(IPropertyStore* property_store,
65 const wchar_t* app_id); 66 const wchar_t* app_id);
66 67
67 // Adds the specified |command| using the specified |name| to the AutoRun key. 68 // Adds the specified |command| using the specified |name| to the AutoRun key.
68 // |root_key| could be HKCU or HKLM or the root of any user hive. 69 // |root_key| could be HKCU or HKLM or the root of any user hive.
69 bool AddCommandToAutoRun(HKEY root_key, const string16& name, 70 BASE_API bool AddCommandToAutoRun(HKEY root_key, const string16& name,
70 const string16& command); 71 const string16& command);
71 // Removes the command specified by |name| from the AutoRun key. |root_key| 72 // Removes the command specified by |name| from the AutoRun key. |root_key|
72 // could be HKCU or HKLM or the root of any user hive. 73 // could be HKCU or HKLM or the root of any user hive.
73 bool RemoveCommandFromAutoRun(HKEY root_key, const string16& name); 74 BASE_API bool RemoveCommandFromAutoRun(HKEY root_key, const string16& name);
74 75
75 // Reads the command specified by |name| from the AutoRun key. |root_key| 76 // Reads the command specified by |name| from the AutoRun key. |root_key|
76 // could be HKCU or HKLM or the root of any user hive. Used for unit-tests. 77 // could be HKCU or HKLM or the root of any user hive. Used for unit-tests.
77 bool ReadCommandFromAutoRun(HKEY root_key, 78 BASE_API bool ReadCommandFromAutoRun(HKEY root_key,
78 const string16& name, 79 const string16& name,
79 string16* command); 80 string16* command);
80 } // namespace win 81 } // namespace win
81 } // namespace base 82 } // namespace base
82 83
83 #endif // BASE_WIN_WIN_UTIL_H_ 84 #endif // BASE_WIN_WIN_UTIL_H_
OLDNEW
« base/base_api.h ('K') | « base/win/scoped_variant.h ('k') | base/win/wrapped_window_proc.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698