diff options
author | gab@chromium.org <gab@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-10-18 00:37:54 +0000 |
---|---|---|
committer | gab@chromium.org <gab@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-10-18 00:37:54 +0000 |
commit | 73ba56828ffca9a79e1747775653ba381c3a6d99 (patch) | |
tree | 2e69eeead0398fd381d8209509bdc9b76ac8ea91 /base/win | |
parent | 18c0fac7d1d48e2b85db9feb5bfc14ed0354cc8f (diff) | |
download | chromium_src-73ba56828ffca9a79e1747775653ba381c3a6d99.zip chromium_src-73ba56828ffca9a79e1747775653ba381c3a6d99.tar.gz chromium_src-73ba56828ffca9a79e1747775653ba381c3a6d99.tar.bz2 |
Expose PKEY in shortcut.cc instead of having another layer in win_util.cc.
Discovered while writing a fix to add PKEY_AppUserModel_PreventPinning for http://crbug.com/142980 that adding new properties was kind of redundant, so I removed one layer of unecessary calls; while I don't need to commit this change anymore (as it doesn't work...), here is the code cleanup part of it.
Fix has_dual_mode() enum typo.
R=robertshield@chromium.org
BUG=None
Review URL: https://chromiumcodereview.appspot.com/11202002
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@162583 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'base/win')
-rw-r--r-- | base/win/shortcut.cc | 5 | ||||
-rw-r--r-- | base/win/win_util.cc | 7 | ||||
-rw-r--r-- | base/win/win_util.h | 13 |
3 files changed, 11 insertions, 14 deletions
diff --git a/base/win/shortcut.cc b/base/win/shortcut.cc index b7cb62f..c5093c4 100644 --- a/base/win/shortcut.cc +++ b/base/win/shortcut.cc @@ -6,6 +6,7 @@ #include <shellapi.h> #include <shlobj.h> +#include <propkey.h> #include "base/threading/thread_restrictions.h" #include "base/win/scoped_comptr.h" @@ -121,7 +122,9 @@ bool CreateOrUpdateShortcutLink(const FilePath& shortcut_path, return false; } if (has_dual_mode && - !SetDualModeForPropertyStore(property_store, properties.dual_mode)) { + !SetBooleanValueForPropertyStore(property_store, + PKEY_AppUserModel_IsDualMode, + properties.dual_mode)) { return false; } } diff --git a/base/win/win_util.cc b/base/win/win_util.cc index afa23d7..7c106a2 100644 --- a/base/win/win_util.cc +++ b/base/win/win_util.cc @@ -156,13 +156,6 @@ bool SetAppIdForPropertyStore(IPropertyStore* property_store, app_id); } -bool SetDualModeForPropertyStore(IPropertyStore* property_store, - bool is_dual_mode) { - return SetBooleanValueForPropertyStore(property_store, - PKEY_AppUserModel_IsDualMode, - is_dual_mode); -} - static const char16 kAutoRunKeyPath[] = L"Software\\Microsoft\\Windows\\CurrentVersion\\Run"; diff --git a/base/win/win_util.h b/base/win/win_util.h index 032dd42..7db98e9 100644 --- a/base/win/win_util.h +++ b/base/win/win_util.h @@ -66,7 +66,13 @@ BASE_EXPORT bool IsAltPressed(); // if the OS is Vista or later. BASE_EXPORT bool UserAccountControlIsEnabled(); -// Sets the string value for given key in given IPropertyStore. +// Sets the boolean value for a given key in given IPropertyStore. +BASE_EXPORT bool SetBooleanValueForPropertyStore( + IPropertyStore* property_store, + const PROPERTYKEY& property_key, + bool property_bool_value); + +// Sets the string value for a given key in given IPropertyStore. BASE_EXPORT bool SetStringValueForPropertyStore( IPropertyStore* property_store, const PROPERTYKEY& property_key, @@ -78,11 +84,6 @@ BASE_EXPORT bool SetStringValueForPropertyStore( BASE_EXPORT bool SetAppIdForPropertyStore(IPropertyStore* property_store, const wchar_t* app_id); -// Sets the DualModeApp property to |is_dual_mode| in |property_store|. This -// method is intended for tagging dual mode applications in Win8+. -BASE_EXPORT bool SetDualModeForPropertyStore(IPropertyStore* property_store, - bool is_dual_mode); - // Adds the specified |command| using the specified |name| to the AutoRun key. // |root_key| could be HKCU or HKLM or the root of any user hive. BASE_EXPORT bool AddCommandToAutoRun(HKEY root_key, const string16& name, |