OLD | NEW |
---|---|
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 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 #import "chrome/browser/ui/cocoa/autofill/autofill_account_chooser.h" | 5 #import "chrome/browser/ui/cocoa/autofill/autofill_account_chooser.h" |
6 | 6 |
7 #include "base/strings/sys_string_conversions.h" | 7 #include "base/strings/sys_string_conversions.h" |
8 #include "chrome/browser/ui/autofill/autofill_dialog_view_delegate.h" | 8 #include "chrome/browser/ui/autofill/autofill_dialog_view_delegate.h" |
9 #include "chrome/browser/ui/chrome_style.h" | 9 #include "chrome/browser/ui/chrome_style.h" |
10 #include "chrome/browser/ui/cocoa/autofill/autofill_dialog_constants.h" | 10 #include "chrome/browser/ui/cocoa/autofill/autofill_dialog_constants.h" |
(...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
100 [icon_ setImage:iconImage]; | 100 [icon_ setImage:iconImage]; |
101 | 101 |
102 // Set title. | 102 // Set title. |
103 NSString* popupTitle = | 103 NSString* popupTitle = |
104 base::SysUTF16ToNSString(delegate_->AccountChooserText()); | 104 base::SysUTF16ToNSString(delegate_->AccountChooserText()); |
105 [popup_ setTitle:popupTitle]; | 105 [popup_ setTitle:popupTitle]; |
106 | 106 |
107 NSString* linkTitle = | 107 NSString* linkTitle = |
108 base::SysUTF16ToNSString(delegate_->SignInLinkText()); | 108 base::SysUTF16ToNSString(delegate_->SignInLinkText()); |
109 [link_ setTitle:linkTitle]; | 109 [link_ setTitle:linkTitle]; |
110 [link_ | |
111 setEnabled:(delegate_->SignedInState() != autofill::REQUIRES_RESPONSE)]; | |
groby-ooo-7-16
2013/08/30 01:48:12
nit: line break after setEnabled:
i.e.
[link_ set
Ilya Sherman
2013/08/30 03:24:40
Done.
| |
110 | 112 |
111 // populate menu | 113 // populate menu |
112 NSMenu* accountMenu = [popup_ attachedMenu]; | 114 NSMenu* accountMenu = [popup_ attachedMenu]; |
113 [accountMenu removeAllItems]; | 115 [accountMenu removeAllItems]; |
114 // See menu_button.h for documentation on why this is needed. | 116 // See menu_button.h for documentation on why this is needed. |
115 [accountMenu addItemWithTitle:@"" action:nil keyEquivalent:@""]; | 117 [accountMenu addItemWithTitle:@"" action:nil keyEquivalent:@""]; |
116 ui::MenuModel* model = delegate_->MenuModelForAccountChooser(); | 118 ui::MenuModel* model = delegate_->MenuModelForAccountChooser(); |
117 if (model) { | 119 if (model) { |
118 for (int i = 0; i < model->GetItemCount(); ++i) { | 120 for (int i = 0; i < model->GetItemCount(); ++i) { |
119 AddMenuItem(accountMenu, | 121 AddMenuItem(accountMenu, |
(...skipping 22 matching lines...) Expand all Loading... | |
142 frame.origin.x = NSMaxX(bounds) - NSWidth(frame); | 144 frame.origin.x = NSMaxX(bounds) - NSWidth(frame); |
143 [activeControl setFrame:frame]; | 145 [activeControl setFrame:frame]; |
144 | 146 |
145 [icon_ setFrameSize:[[icon_ image] size]]; | 147 [icon_ setFrameSize:[[icon_ image] size]]; |
146 frame.origin.x -= NSWidth([icon_ frame]) + kAroundTextPadding; | 148 frame.origin.x -= NSWidth([icon_ frame]) + kAroundTextPadding; |
147 [icon_ setFrameOrigin:frame.origin]; | 149 [icon_ setFrameOrigin:frame.origin]; |
148 } | 150 } |
149 | 151 |
150 @end | 152 @end |
151 | 153 |
OLD | NEW |