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

Side by Side Diff: chrome/browser/ui/cocoa/passwords/account_chooser_view_controller.mm

Issue 1968463002: Close the account chooser and auto sign-in opt in with ESC on Mac. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@2704
Patch Set: Created 4 years, 7 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
« no previous file with comments | « no previous file | chrome/browser/ui/cocoa/passwords/account_chooser_view_controller_unittest.mm » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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/account_chooser_view_controller.h" 5 #import "chrome/browser/ui/cocoa/passwords/account_chooser_view_controller.h"
6 6
7 #include "base/mac/foundation_util.h" 7 #include "base/mac/foundation_util.h"
8 #include "base/mac/scoped_nsobject.h" 8 #include "base/mac/scoped_nsobject.h"
9 #include "base/strings/sys_string_conversions.h" 9 #include "base/strings/sys_string_conversions.h"
10 #include "base/strings/utf_string_conversions.h" 10 #include "base/strings/utf_string_conversions.h"
11 #import "chrome/browser/ui/cocoa/key_equivalent_constants.h"
11 #import "chrome/browser/ui/cocoa/passwords/account_avatar_fetcher_manager.h" 12 #import "chrome/browser/ui/cocoa/passwords/account_avatar_fetcher_manager.h"
12 #import "chrome/browser/ui/cocoa/passwords/credential_item_button.h" 13 #import "chrome/browser/ui/cocoa/passwords/credential_item_button.h"
13 #import "chrome/browser/ui/cocoa/passwords/passwords_bubble_utils.h" 14 #import "chrome/browser/ui/cocoa/passwords/passwords_bubble_utils.h"
14 #include "chrome/browser/ui/passwords/manage_passwords_view_utils.h" 15 #include "chrome/browser/ui/passwords/manage_passwords_view_utils.h"
15 #include "chrome/browser/ui/passwords/password_dialog_controller.h" 16 #include "chrome/browser/ui/passwords/password_dialog_controller.h"
16 #include "chrome/browser/ui/passwords/password_dialog_prompts.h" 17 #include "chrome/browser/ui/passwords/password_dialog_prompts.h"
17 #include "chrome/grit/generated_resources.h" 18 #include "chrome/grit/generated_resources.h"
18 #include "components/autofill/core/common/password_form.h" 19 #include "components/autofill/core/common/password_form.h"
19 #include "components/password_manager/core/common/credential_manager_types.h" 20 #include "components/password_manager/core/common/credential_manager_types.h"
20 #include "grit/theme_resources.h" 21 #include "grit/theme_resources.h"
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after
87 [[titleView_ textContainer] setLineFragmentPadding:0]; 88 [[titleView_ textContainer] setLineFragmentPadding:0];
88 [view addSubview:titleView_]; 89 [view addSubview:titleView_];
89 90
90 // Credentials list. 91 // Credentials list.
91 [self loadCredentialItems]; 92 [self loadCredentialItems];
92 93
93 // "Cancel" button. 94 // "Cancel" button.
94 cancelButton_ = DialogButton(l10n_util::GetNSString(IDS_APP_CANCEL)); 95 cancelButton_ = DialogButton(l10n_util::GetNSString(IDS_APP_CANCEL));
95 [cancelButton_ setTarget:self]; 96 [cancelButton_ setTarget:self];
96 [cancelButton_ setAction:@selector(onCancelClicked:)]; 97 [cancelButton_ setAction:@selector(onCancelClicked:)];
98 [cancelButton_ setKeyEquivalent:kKeyEquivalentEscape];
97 [view addSubview:cancelButton_]; 99 [view addSubview:cancelButton_];
98 100
99 // Lay out the views. 101 // Lay out the views.
100 [cancelButton_ setFrameOrigin:NSMakePoint( 102 [cancelButton_ setFrameOrigin:NSMakePoint(
101 kFramePadding + width - NSWidth([cancelButton_ frame]), 103 kFramePadding + width - NSWidth([cancelButton_ frame]),
102 kFramePadding)]; 104 kFramePadding)];
103 105
104 NSSize buttonsSize = NSMakeSize( 106 NSSize buttonsSize = NSMakeSize(
105 kDesiredBubbleWidth, 107 kDesiredBubbleWidth,
106 std::min([credentialButtons_ count], kMaxAccounts) * CredentialHeight()); 108 std::min([credentialButtons_ count], kMaxAccounts) * CredentialHeight());
(...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after
224 226
225 - (NSArray*)credentialButtons { 227 - (NSArray*)credentialButtons {
226 return credentialButtons_; 228 return credentialButtons_;
227 } 229 }
228 230
229 - (NSTextView*)titleView { 231 - (NSTextView*)titleView {
230 return titleView_; 232 return titleView_;
231 } 233 }
232 234
233 @end 235 @end
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/ui/cocoa/passwords/account_chooser_view_controller_unittest.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698