Chromium Code Reviews| Index: chrome/browser/password_manager/password_manager_util_mac.mm |
| diff --git a/chrome/browser/password_manager/password_manager_util_mac.mm b/chrome/browser/password_manager/password_manager_util_mac.mm |
| index d4b6adc093486f3348f848300fb42c02e01c8b27..705b94d134da9ec1eeb1eb835482ef99b77e3d1c 100644 |
| --- a/chrome/browser/password_manager/password_manager_util_mac.mm |
| +++ b/chrome/browser/password_manager/password_manager_util_mac.mm |
| @@ -10,6 +10,7 @@ |
| #include "base/basictypes.h" |
| #include "base/mac/authorization_util.h" |
| +#include "base/mac/bundle_locations.h" |
| #include "base/mac/foundation_util.h" |
| #include "base/mac/scoped_authorizationref.h" |
| #include "chrome/grit/chromium_strings.h" |
| @@ -18,8 +19,11 @@ |
| namespace password_manager_util { |
| bool AuthenticateUser(gfx::NativeWindow window) { |
| + NSString* identifier = [base::mac::MainBundle() bundleIdentifier]; |
| + AuthorizationString name = |
| + [[identifier stringByAppendingString:@".show-passwords"] UTF8String]; |
|
dconnelly
2015/01/08 17:56:36
Don't use [NSString UTF8String]. Use base::SysNSSt
Jiang Jiang
2015/01/08 21:41:58
But I will have to call c_str() out of this still,
dconnelly
2015/01/09 09:06:03
No, this is fine then. git grep shows more uses of
|
| AuthorizationItem right_items[] = { |
| - {"com.google.Chrome.show-passwords", 0, NULL, 0} |
| + {name, 0, NULL, 0} |
| }; |
| AuthorizationRights rights = {arraysize(right_items), right_items}; |