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

Side by Side Diff: chrome/browser/password_manager/password_manager_util_mac.mm

Issue 468233004: Cleanup: Another round of removing unneeded grit #includes in chrome. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix mac, undo ui_localizer.mm Created 6 years, 4 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 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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/browser/password_manager/password_manager_util.h" 5 #include "chrome/browser/password_manager/password_manager_util.h"
6 6
7 #import <Foundation/Foundation.h> 7 #import <Foundation/Foundation.h>
8 #include <CoreFoundation/CoreFoundation.h> 8 #include <CoreFoundation/CoreFoundation.h>
9 #include <Security/Authorization.h> 9 #include <Security/Authorization.h>
10 10
11 #include "base/basictypes.h" 11 #include "base/basictypes.h"
12 #include "base/mac/authorization_util.h" 12 #include "base/mac/authorization_util.h"
13 #include "base/mac/foundation_util.h" 13 #include "base/mac/foundation_util.h"
14 #include "base/mac/scoped_authorizationref.h" 14 #include "base/mac/scoped_authorizationref.h"
15 #include "grit/chromium_strings.h" 15 #include "grit/chromium_strings.h"
16 #include "grit/generated_resources.h"
17 #include "ui/base/l10n/l10n_util.h" 16 #include "ui/base/l10n/l10n_util.h"
18 17
19 namespace password_manager_util { 18 namespace password_manager_util {
20 19
21 bool AuthenticateUser(gfx::NativeWindow window) { 20 bool AuthenticateUser(gfx::NativeWindow window) {
22 AuthorizationItem right_items[] = { 21 AuthorizationItem right_items[] = {
23 {"com.google.Chrome.show-passwords", 0, NULL, 0} 22 {"com.google.Chrome.show-passwords", 0, NULL, 0}
24 }; 23 };
25 AuthorizationRights rights = {arraysize(right_items), right_items}; 24 AuthorizationRights rights = {arraysize(right_items), right_items};
26 25
27 NSString* prompt = 26 NSString* prompt =
28 l10n_util::GetNSString(IDS_PASSWORDS_PAGE_AUTHENTICATION_PROMPT); 27 l10n_util::GetNSString(IDS_PASSWORDS_PAGE_AUTHENTICATION_PROMPT);
29 28
30 // Pass kAuthorizationFlagDestroyRights to prevent the OS from saving the 29 // Pass kAuthorizationFlagDestroyRights to prevent the OS from saving the
31 // authorization and not prompting the user when future requests are made. 30 // authorization and not prompting the user when future requests are made.
32 base::mac::ScopedAuthorizationRef authorization( 31 base::mac::ScopedAuthorizationRef authorization(
33 base::mac::GetAuthorizationRightsWithPrompt( 32 base::mac::GetAuthorizationRightsWithPrompt(
34 &rights, base::mac::NSToCFCast(prompt), 33 &rights, base::mac::NSToCFCast(prompt),
35 kAuthorizationFlagDestroyRights)); 34 kAuthorizationFlagDestroyRights));
36 return authorization.get() != NULL; 35 return authorization.get() != NULL;
37 } 36 }
38 37
39 // TODO(dubroy): Implement on Mac. 38 // TODO(dubroy): Implement on Mac.
40 OsPasswordStatus GetOsPasswordStatus() { 39 OsPasswordStatus GetOsPasswordStatus() {
41 return PASSWORD_STATUS_UNSUPPORTED; 40 return PASSWORD_STATUS_UNSUPPORTED;
42 } 41 }
43 42
44 } // namespace password_manager_util 43 } // namespace password_manager_util
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698