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

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

Issue 1961023002: Close the account chooser and auto sign-in opt in with ESC on Mac. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: comments 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 65 matching lines...) Expand 10 before | Expand all | Expand 10 after
86 [[titleView_ textContainer] setLineFragmentPadding:0]; 87 [[titleView_ textContainer] setLineFragmentPadding:0];
87 [view addSubview:titleView_]; 88 [view addSubview:titleView_];
88 89
89 // Credentials list. 90 // Credentials list.
90 [self loadCredentialItems]; 91 [self loadCredentialItems];
91 92
92 // "Cancel" button. 93 // "Cancel" button.
93 cancelButton_ = DialogButton(l10n_util::GetNSString(IDS_APP_CANCEL)); 94 cancelButton_ = DialogButton(l10n_util::GetNSString(IDS_APP_CANCEL));
94 [cancelButton_ setTarget:self]; 95 [cancelButton_ setTarget:self];
95 [cancelButton_ setAction:@selector(onCancelClicked:)]; 96 [cancelButton_ setAction:@selector(onCancelClicked:)];
97 [cancelButton_ setKeyEquivalent:kKeyEquivalentEscape];
96 [view addSubview:cancelButton_]; 98 [view addSubview:cancelButton_];
97 99
98 // Lay out the views. 100 // Lay out the views.
99 [cancelButton_ setFrameOrigin:NSMakePoint( 101 [cancelButton_ setFrameOrigin:NSMakePoint(
100 kFramePadding + width - NSWidth([cancelButton_ frame]), 102 kFramePadding + width - NSWidth([cancelButton_ frame]),
101 kFramePadding)]; 103 kFramePadding)];
102 104
103 NSSize buttonsSize = NSMakeSize( 105 NSSize buttonsSize = NSMakeSize(
104 kDesiredBubbleWidth, 106 kDesiredBubbleWidth,
105 std::min([credentialButtons_ count], kMaxAccounts) * kCredentialHeight); 107 std::min([credentialButtons_ count], kMaxAccounts) * kCredentialHeight);
(...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after
223 225
224 - (NSArray*)credentialButtons { 226 - (NSArray*)credentialButtons {
225 return credentialButtons_; 227 return credentialButtons_;
226 } 228 }
227 229
228 - (NSTextView*)titleView { 230 - (NSTextView*)titleView {
229 return titleView_; 231 return titleView_;
230 } 232 }
231 233
232 @end 234 @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