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

Side by Side Diff: chrome/browser/ui/cocoa/profiles/profile_signin_confirmation_view_controller.mm

Issue 2626723002: Remove some string IDS' _NEW_STYLE suffix and some unused IDS. (Closed)
Patch Set: Created 3 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 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/profiles/profile_signin_confirmation_view_contr oller.h" 5 #import "chrome/browser/ui/cocoa/profiles/profile_signin_confirmation_view_contr oller.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include <algorithm> 9 #include <algorithm>
10 #include <cmath> 10 #include <cmath>
(...skipping 170 matching lines...) Expand 10 before | Expand all | Expand 10 after
181 // | [create] [cancel] [ok] | 181 // | [create] [cancel] [ok] |
182 // ------------------------------- 182 // -------------------------------
183 183
184 // The width of the dialog should be sufficient to fit the buttons on 184 // The width of the dialog should be sufficient to fit the buttons on
185 // one line and the title and the close button on one line, but not 185 // one line and the title and the close button on one line, but not
186 // smaller than kWindowMinWidth. Therefore we first layout the title 186 // smaller than kWindowMinWidth. Therefore we first layout the title
187 // and the buttons and then compute the necessary width. 187 // and the buttons and then compute the necessary width.
188 188
189 // OK button. 189 // OK button.
190 [self addButton:okButton_ 190 [self addButton:okButton_
191 withTitle:IDS_ENTERPRISE_SIGNIN_CONTINUE_NEW_STYLE 191 withTitle:IDS_ENTERPRISE_SIGNIN_CONTINUE
192 target:self 192 target:self
193 action:@selector(ok:) 193 action:@selector(ok:)
194 shouldAutoSize:YES]; 194 shouldAutoSize:YES];
195 195
196 // Cancel button. 196 // Cancel button.
197 [self addButton:cancelButton_ 197 [self addButton:cancelButton_
198 withTitle:IDS_ENTERPRISE_SIGNIN_CANCEL 198 withTitle:IDS_ENTERPRISE_SIGNIN_CANCEL
199 target:self 199 target:self
200 action:@selector(cancel:) 200 action:@selector(cancel:)
201 shouldAutoSize:YES]; 201 shouldAutoSize:YES];
202 202
203 // Add the close button. 203 // Add the close button.
204 [self addButton:closeButton_ 204 [self addButton:closeButton_
205 withTitle:0 205 withTitle:0
206 target:self 206 target:self
207 action:@selector(close:) 207 action:@selector(close:)
208 shouldAutoSize:NO]; 208 shouldAutoSize:NO];
209 NSRect closeButtonFrame = [closeButton_ frame]; 209 NSRect closeButtonFrame = [closeButton_ frame];
210 closeButtonFrame.size.width = chrome_style::GetCloseButtonSize(); 210 closeButtonFrame.size.width = chrome_style::GetCloseButtonSize();
211 closeButtonFrame.size.height = chrome_style::GetCloseButtonSize(); 211 closeButtonFrame.size.height = chrome_style::GetCloseButtonSize();
212 [closeButton_ setFrame:closeButtonFrame]; 212 [closeButton_ setFrame:closeButtonFrame];
213 213
214 // Create Profile link. 214 // Create Profile link.
215 if (offerProfileCreation_) { 215 if (offerProfileCreation_) {
216 [self addButton:createProfileButton_ 216 [self addButton:createProfileButton_
217 withTitle:IDS_ENTERPRISE_SIGNIN_CREATE_NEW_PROFILE_NEW_STYLE 217 withTitle:IDS_ENTERPRISE_SIGNIN_CREATE_NEW_PROFILE
218 target:self 218 target:self
219 action:@selector(createProfile:) 219 action:@selector(createProfile:)
220 shouldAutoSize:YES]; 220 shouldAutoSize:YES];
221 } 221 }
222 222
223 // Add the title label. 223 // Add the title label.
224 titleField_.reset( 224 titleField_.reset(
225 [AddTextField([self view], 225 [AddTextField([self view],
226 l10n_util::GetStringUTF16( 226 l10n_util::GetStringUTF16(
227 IDS_ENTERPRISE_SIGNIN_TITLE_NEW_STYLE), 227 IDS_ENTERPRISE_SIGNIN_TITLE),
228 chrome_style::kTitleFontStyle) retain]); 228 chrome_style::kTitleFontStyle) retain]);
229 [titleField_ setFrame:ComputeFrame( 229 [titleField_ setFrame:ComputeFrame(
230 [titleField_ attributedStringValue], 0.0, 0.0)]; 230 [titleField_ attributedStringValue], 0.0, 0.0)];
231 231
232 // Compute the dialog width using the title and buttons. 232 // Compute the dialog width using the title and buttons.
233 const CGFloat buttonsWidth = 233 const CGFloat buttonsWidth =
234 (offerProfileCreation_ ? NSWidth([createProfileButton_ frame]) : 0) + 234 (offerProfileCreation_ ? NSWidth([createProfileButton_ frame]) : 0) +
235 kButtonGap + NSWidth([cancelButton_ frame]) + 235 kButtonGap + NSWidth([cancelButton_ frame]) +
236 kButtonGap + NSWidth([okButton_ frame]); 236 kButtonGap + NSWidth([okButton_ frame]);
237 const CGFloat titleWidth = 237 const CGFloat titleWidth =
(...skipping 23 matching lines...) Expand all
261 [promptBox_ setTitlePosition:NSNoTitle]; 261 [promptBox_ setTitlePosition:NSNoTitle];
262 [[self view] addSubview:promptBox_]; 262 [[self view] addSubview:promptBox_];
263 263
264 // Prompt text. 264 // Prompt text.
265 size_t offset; 265 size_t offset;
266 const base::string16 domain = 266 const base::string16 domain =
267 base::ASCIIToUTF16(gaia::ExtractDomainName(username_)); 267 base::ASCIIToUTF16(gaia::ExtractDomainName(username_));
268 const base::string16 username = base::ASCIIToUTF16(username_); 268 const base::string16 username = base::ASCIIToUTF16(username_);
269 const base::string16 prompt_text = 269 const base::string16 prompt_text =
270 l10n_util::GetStringFUTF16( 270 l10n_util::GetStringFUTF16(
271 IDS_ENTERPRISE_SIGNIN_ALERT_NEW_STYLE, 271 IDS_ENTERPRISE_SIGNIN_ALERT,
272 domain, &offset); 272 domain, &offset);
273 promptField_.reset( 273 promptField_.reset(
274 [AddTextField(promptBox_, prompt_text, chrome_style::kTextFontStyle) 274 [AddTextField(promptBox_, prompt_text, chrome_style::kTextFontStyle)
275 retain]); 275 retain]);
276 MakeTextBold(promptField_, offset, domain.size()); 276 MakeTextBold(promptField_, offset, domain.size());
277 [promptField_ setFrame:ComputeFrame( 277 [promptField_ setFrame:ComputeFrame(
278 [promptField_ attributedStringValue], width, 0.0)]; 278 [promptField_ attributedStringValue], width, 0.0)];
279 279
280 // Set the height of the prompt box from the prompt text, padding, and border. 280 // Set the height of the prompt box from the prompt text, padding, and border.
281 CGFloat boxHeight = 281 CGFloat boxHeight =
282 kDialogAlertBarBorderWidth + 282 kDialogAlertBarBorderWidth +
283 chrome_style::kRowPadding + 283 chrome_style::kRowPadding +
284 NSHeight([promptField_ frame]) + 284 NSHeight([promptField_ frame]) +
285 chrome_style::kRowPadding + 285 chrome_style::kRowPadding +
286 kDialogAlertBarBorderWidth; 286 kDialogAlertBarBorderWidth;
287 [promptBox_ setFrame:NSMakeRect(0, 0, dialogWidth, boxHeight)]; 287 [promptBox_ setFrame:NSMakeRect(0, 0, dialogWidth, boxHeight)];
288 288
289 // Explanation text. 289 // Explanation text.
290 std::vector<size_t> offsets; 290 std::vector<size_t> offsets;
291 const base::string16 learn_more_text = 291 const base::string16 learn_more_text =
292 l10n_util::GetStringUTF16( 292 l10n_util::GetStringUTF16(
293 IDS_ENTERPRISE_SIGNIN_PROFILE_LINK_LEARN_MORE); 293 IDS_ENTERPRISE_SIGNIN_PROFILE_LINK_LEARN_MORE);
294 const base::string16 explanation_text = 294 const base::string16 explanation_text =
295 l10n_util::GetStringFUTF16( 295 l10n_util::GetStringFUTF16(
296 offerProfileCreation_ ? 296 offerProfileCreation_ ?
297 IDS_ENTERPRISE_SIGNIN_EXPLANATION_WITH_PROFILE_CREATION_NEW_STYLE : 297 IDS_ENTERPRISE_SIGNIN_EXPLANATION_WITH_PROFILE_CREATION :
298 IDS_ENTERPRISE_SIGNIN_EXPLANATION_WITHOUT_PROFILE_CREATION_NEW_STYLE, 298 IDS_ENTERPRISE_SIGNIN_EXPLANATION_WITHOUT_PROFILE_CREATION,
299 username, learn_more_text, &offsets); 299 username, learn_more_text, &offsets);
300 // HyperlinkTextView requires manually inserting the link text 300 // HyperlinkTextView requires manually inserting the link text
301 // into the middle of the message text. To do this we slice out 301 // into the middle of the message text. To do this we slice out
302 // the "learn more" string from the message so that it can be 302 // the "learn more" string from the message so that it can be
303 // inserted again. 303 // inserted again.
304 const base::string16 explanation_message_text = 304 const base::string16 explanation_message_text =
305 explanation_text.substr(0, offsets[1]) + 305 explanation_text.substr(0, offsets[1]) +
306 explanation_text.substr(offsets[1] + learn_more_text.size()); 306 explanation_text.substr(offsets[1] + learn_more_text.size());
307 explanationField_.reset( 307 explanationField_.reset(
308 [AddTextView([self view], self, explanation_message_text, learn_more_text, 308 [AddTextView([self view], self, explanation_message_text, learn_more_text,
(...skipping 140 matching lines...) Expand 10 before | Expand all | Expand 10 after
449 449
450 - (NSButton*)createProfileButton { 450 - (NSButton*)createProfileButton {
451 return createProfileButton_.get(); 451 return createProfileButton_.get();
452 } 452 }
453 453
454 - (NSTextView*)explanationField { 454 - (NSTextView*)explanationField {
455 return explanationField_.get(); 455 return explanationField_.get();
456 } 456 }
457 457
458 @end 458 @end
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698