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

Side by Side Diff: chrome/browser/ui/cocoa/one_click_signin_view_controller.mm

Issue 107673002: OneClickSigninBubbleView: Update the bubble form to reflect new bubble/ (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Address sky@ comments. Created 6 years, 11 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
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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/one_click_signin_view_controller.h" 5 #import "chrome/browser/ui/cocoa/one_click_signin_view_controller.h"
6 6
7 #include "base/callback_helpers.h" 7 #include "base/callback_helpers.h"
8 #include "base/logging.h" 8 #include "base/logging.h"
9 #include "base/mac/bundle_locations.h" 9 #include "base/mac/bundle_locations.h"
10 #import "chrome/browser/ui/chrome_style.h" 10 #import "chrome/browser/ui/chrome_style.h"
(...skipping 143 matching lines...) Expand 10 before | Expand all | Expand 10 after
154 if (informativePlaceholderTextField_) { 154 if (informativePlaceholderTextField_) {
155 ShiftOriginY(informativePlaceholderTextField_, totalYOffset); 155 ShiftOriginY(informativePlaceholderTextField_, totalYOffset);
156 totalYOffset += [self initializeInformativeTextView]; 156 totalYOffset += [self initializeInformativeTextView];
157 } 157 }
158 158
159 ShiftOriginY(messageTextField_, totalYOffset); 159 ShiftOriginY(messageTextField_, totalYOffset);
160 totalYOffset += 160 totalYOffset +=
161 [GTMUILocalizerAndLayoutTweaker 161 [GTMUILocalizerAndLayoutTweaker
162 sizeToFitFixedWidthTextField:messageTextField_]; 162 sizeToFitFixedWidthTextField:messageTextField_];
163 163
164 ShiftOriginY(titleTextField_, totalYOffset);
165 totalYOffset +=
166 [GTMUILocalizerAndLayoutTweaker
167 sizeToFitFixedWidthTextField:titleTextField_];
168
164 if (closeButton_) 169 if (closeButton_)
165 ShiftOriginY(closeButton_, totalYOffset); 170 ShiftOriginY(closeButton_, totalYOffset);
166 171
167 NSSize delta = NSMakeSize(0.0, totalYOffset); 172 NSSize delta = NSMakeSize(0.0, totalYOffset);
168 173
169 if (isSyncDialog_) { 174 if (isSyncDialog_) {
170 [messageTextField_ setStringValue:l10n_util::GetNSStringWithFixup( 175 [messageTextField_ setStringValue:l10n_util::GetNSStringWithFixup(
171 IDS_ONE_CLICK_SIGNIN_DIALOG_TITLE_NEW)]; 176 IDS_ONE_CLICK_SIGNIN_DIALOG_TITLE_NEW)];
172 } else if ([errorMessage_ length] != 0) { 177 } else if ([errorMessage_ length] != 0) {
173 [messageTextField_ setStringValue:errorMessage_]; 178 [messageTextField_ setStringValue:errorMessage_];
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
218 223
219 NSColor* linkColor = 224 NSColor* linkColor =
220 gfx::SkColorToCalibratedNSColor(chrome_style::GetLinkColor()); 225 gfx::SkColorToCalibratedNSColor(chrome_style::GetLinkColor());
221 [informativeTextView_ setMessageAndLink:messageText 226 [informativeTextView_ setMessageAndLink:messageText
222 withLink:learnMoreText 227 withLink:learnMoreText
223 atOffset:[messageText length] 228 atOffset:[messageText length]
224 font:font 229 font:font
225 messageColor:[NSColor blackColor] 230 messageColor:[NSColor blackColor]
226 linkColor:linkColor]; 231 linkColor:linkColor];
227 232
233
234 // Make the "Advanced" link font as large as the "Learn More" link.
235 [[advancedLink_ cell] setFont:font];
236 [advancedLink_ sizeToFit];
237
228 // Size to fit. 238 // Size to fit.
229 [[informativePlaceholderTextField_ cell] setAttributedStringValue: 239 [[informativePlaceholderTextField_ cell] setAttributedStringValue:
230 [informativeTextView_ attributedString]]; 240 [informativeTextView_ attributedString]];
231 [GTMUILocalizerAndLayoutTweaker 241 [GTMUILocalizerAndLayoutTweaker
232 sizeToFitFixedWidthTextField:informativePlaceholderTextField_]; 242 sizeToFitFixedWidthTextField:informativePlaceholderTextField_];
233 NSRect newFrame = [informativePlaceholderTextField_ frame]; 243 NSRect newFrame = [informativePlaceholderTextField_ frame];
234 [informativeTextView_ setFrame:newFrame]; 244 [informativeTextView_ setFrame:newFrame];
235 245
236 // Swap placeholder. 246 // Swap placeholder.
237 [[informativePlaceholderTextField_ superview] 247 [[informativePlaceholderTextField_ superview]
(...skipping 20 matching lines...) Expand all
258 content::PAGE_TRANSITION_LINK, false); 268 content::PAGE_TRANSITION_LINK, false);
259 webContents_->OpenURL(params); 269 webContents_->OpenURL(params);
260 return YES; 270 return YES;
261 } 271 }
262 272
263 - (void)close { 273 - (void)close {
264 base::ResetAndReturn(&closeCallback_).Run(); 274 base::ResetAndReturn(&closeCallback_).Run();
265 } 275 }
266 276
267 @end 277 @end
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698