OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 #import "chrome/browser/ui/cocoa/passwords/passwords_list_view_controller.h" | 5 #import "chrome/browser/ui/cocoa/passwords/passwords_list_view_controller.h" |
6 | 6 |
7 #include <utility> | 7 #include <utility> |
8 | 8 |
9 #include "base/logging.h" | 9 #include "base/logging.h" |
10 #include "base/mac/foundation_util.h" | 10 #include "base/mac/foundation_util.h" |
(...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
141 NSString* deleteTitle = l10n_util::GetNSString(IDS_MANAGE_PASSWORDS_DELETE); | 141 NSString* deleteTitle = l10n_util::GetNSString(IDS_MANAGE_PASSWORDS_DELETE); |
142 [deleteButton_ setAccessibilityTitle:deleteTitle]; | 142 [deleteButton_ setAccessibilityTitle:deleteTitle]; |
143 [deleteButton_ setTarget:target]; | 143 [deleteButton_ setTarget:target]; |
144 [deleteButton_ setAction:action]; | 144 [deleteButton_ setAction:action]; |
145 [self addSubview:deleteButton_]; | 145 [self addSubview:deleteButton_]; |
146 | 146 |
147 // Add the username. | 147 // Add the username. |
148 usernameField_.reset([UsernameLabel(GetDisplayUsername(form)) retain]); | 148 usernameField_.reset([UsernameLabel(GetDisplayUsername(form)) retain]); |
149 [self addSubview:usernameField_]; | 149 [self addSubview:usernameField_]; |
150 | 150 |
151 if (form.federation_origin.unique()) { | 151 if (form.federation_origin.opaque()) { |
152 passwordField_.reset([PasswordLabel(form.password_value) retain]); | 152 passwordField_.reset([PasswordLabel(form.password_value) retain]); |
153 } else { | 153 } else { |
154 base::string16 text = l10n_util::GetStringFUTF16( | 154 base::string16 text = l10n_util::GetStringFUTF16( |
155 IDS_PASSWORDS_VIA_FEDERATION, | 155 IDS_PASSWORDS_VIA_FEDERATION, |
156 base::UTF8ToUTF16(form.federation_origin.host())); | 156 base::UTF8ToUTF16(form.federation_origin.host())); |
157 passwordField_.reset([FederationLabel(text) retain]); | 157 passwordField_.reset([FederationLabel(text) retain]); |
158 } | 158 } |
159 [self addSubview:passwordField_]; | 159 [self addSubview:passwordField_]; |
160 } | 160 } |
161 return self; | 161 return self; |
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
219 | 219 |
220 - (id)initWithForm:(const autofill::PasswordForm&)form editMode:(BOOL)editMode { | 220 - (id)initWithForm:(const autofill::PasswordForm&)form editMode:(BOOL)editMode { |
221 if ((self = [super initWithFrame:NSZeroRect])) { | 221 if ((self = [super initWithFrame:NSZeroRect])) { |
222 // Add the username. | 222 // Add the username. |
223 if (editMode) { | 223 if (editMode) { |
224 usernameField_.reset([EditableUsernameField() retain]); | 224 usernameField_.reset([EditableUsernameField() retain]); |
225 } else { | 225 } else { |
226 usernameField_.reset([UsernameLabel(GetDisplayUsername(form)) retain]); | 226 usernameField_.reset([UsernameLabel(GetDisplayUsername(form)) retain]); |
227 } | 227 } |
228 [self addSubview:usernameField_]; | 228 [self addSubview:usernameField_]; |
229 if (form.federation_origin.unique()) { | 229 if (form.federation_origin.opaque()) { |
230 passwordField_.reset([PasswordLabel(form.password_value) retain]); | 230 passwordField_.reset([PasswordLabel(form.password_value) retain]); |
231 } else { | 231 } else { |
232 base::string16 text = l10n_util::GetStringFUTF16( | 232 base::string16 text = l10n_util::GetStringFUTF16( |
233 IDS_PASSWORDS_VIA_FEDERATION, | 233 IDS_PASSWORDS_VIA_FEDERATION, |
234 base::UTF8ToUTF16(form.federation_origin.host())); | 234 base::UTF8ToUTF16(form.federation_origin.host())); |
235 passwordField_.reset([FederationLabel(text) retain]); | 235 passwordField_.reset([FederationLabel(text) retain]); |
236 } | 236 } |
237 [self addSubview:passwordField_]; | 237 [self addSubview:passwordField_]; |
238 } | 238 } |
239 return self; | 239 return self; |
(...skipping 228 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
468 | 468 |
469 @end | 469 @end |
470 | 470 |
471 @implementation PasswordsListViewController (Testing) | 471 @implementation PasswordsListViewController (Testing) |
472 | 472 |
473 - (NSArray*)itemViews { | 473 - (NSArray*)itemViews { |
474 return itemViews_.get(); | 474 return itemViews_.get(); |
475 } | 475 } |
476 | 476 |
477 @end | 477 @end |
OLD | NEW |