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

Side by Side Diff: chrome/browser/ui/cocoa/autofill/card_unmask_prompt_view_bridge.mm

Issue 2028823003: Mac: Make ScopedTypeRef require explicit constructors (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Remove dependency Created 4 years, 6 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) 2015 The Chromium Authors. All rights reserved. 1 // Copyright (c) 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 #include "base/bind.h" 5 #include "base/bind.h"
6 #include "base/message_loop/message_loop.h" 6 #include "base/message_loop/message_loop.h"
7 #include "base/strings/sys_string_conversions.h" 7 #include "base/strings/sys_string_conversions.h"
8 #include "chrome/browser/ui/autofill/autofill_dialog_models.h" 8 #include "chrome/browser/ui/autofill/autofill_dialog_models.h"
9 #include "chrome/browser/ui/chrome_style.h" 9 #include "chrome/browser/ui/chrome_style.h"
10 #import "chrome/browser/ui/cocoa/autofill/autofill_pop_up_button.h" 10 #import "chrome/browser/ui/cocoa/autofill/autofill_pop_up_button.h"
(...skipping 455 matching lines...) Expand 10 before | Expand all | Expand 10 after
466 [expirationView_ setFrame:expirationFrame]; 466 [expirationView_ setFrame:expirationFrame];
467 [CardUnmaskPromptViewCocoa verticallyCenterSubviewsInView:expirationView_]; 467 [CardUnmaskPromptViewCocoa verticallyCenterSubviewsInView:expirationView_];
468 } 468 }
469 469
470 - (void)createStorageViewWithController: 470 - (void)createStorageViewWithController:
471 (autofill::CardUnmaskPromptController*)controller { 471 (autofill::CardUnmaskPromptController*)controller {
472 DCHECK(!storageView_); 472 DCHECK(!storageView_);
473 storageView_.reset([[NSView alloc] initWithFrame:NSZeroRect]); 473 storageView_.reset([[NSView alloc] initWithFrame:NSZeroRect]);
474 [storageView_ setAutoresizingMask:NSViewWidthSizable]; 474 [storageView_ setAutoresizingMask:NSViewWidthSizable];
475 475
476 base::scoped_nsobject<NSBox> box = [CardUnmaskPromptViewCocoa createPlainBox]; 476 base::scoped_nsobject<NSBox> box([CardUnmaskPromptViewCocoa createPlainBox]);
477 [box setAutoresizingMask:NSViewWidthSizable]; 477 [box setAutoresizingMask:NSViewWidthSizable];
478 [box setFillColor:skia::SkColorToCalibratedNSColor(kShadingColor)]; 478 [box setFillColor:skia::SkColorToCalibratedNSColor(kShadingColor)];
479 [box setContentViewMargins:NSMakeSize(chrome_style::kHorizontalPadding, 479 [box setContentViewMargins:NSMakeSize(chrome_style::kHorizontalPadding,
480 chrome_style::kClientBottomPadding)]; 480 chrome_style::kClientBottomPadding)];
481 [storageView_ addSubview:box]; 481 [storageView_ addSubview:box];
482 482
483 // Add "Store card on this device" checkbox. 483 // Add "Store card on this device" checkbox.
484 storageCheckbox_.reset([[NSButton alloc] initWithFrame:NSZeroRect]); 484 storageCheckbox_.reset([[NSButton alloc] initWithFrame:NSZeroRect]);
485 [storageCheckbox_ setButtonType:NSSwitchButton]; 485 [storageCheckbox_ setButtonType:NSSwitchButton];
486 [storageCheckbox_ 486 [storageCheckbox_
(...skipping 12 matching lines...) Expand all
499 .GetNativeImageNamed(IDR_AUTOFILL_TOOLTIP_ICON) 499 .GetNativeImageNamed(IDR_AUTOFILL_TOOLTIP_ICON)
500 .ToNSImage()]; 500 .ToNSImage()];
501 [storageTooltip_ 501 [storageTooltip_
502 setMessage:base::SysUTF16ToNSString(l10n_util::GetStringUTF16( 502 setMessage:base::SysUTF16ToNSString(l10n_util::GetStringUTF16(
503 IDS_AUTOFILL_CARD_UNMASK_PROMPT_STORAGE_TOOLTIP))]; 503 IDS_AUTOFILL_CARD_UNMASK_PROMPT_STORAGE_TOOLTIP))];
504 [box addSubview:[storageTooltip_ view]]; 504 [box addSubview:[storageTooltip_ view]];
505 [[storageTooltip_ view] setFrameOrigin: 505 [[storageTooltip_ view] setFrameOrigin:
506 NSMakePoint(NSMaxX([storageCheckbox_ frame]) + kButtonGap, 0)]; 506 NSMakePoint(NSMaxX([storageCheckbox_ frame]) + kButtonGap, 0)];
507 507
508 // Add horizontal separator. 508 // Add horizontal separator.
509 base::scoped_nsobject<NSBox> separator = 509 base::scoped_nsobject<NSBox> separator(
510 [CardUnmaskPromptViewCocoa createPlainBox]; 510 [CardUnmaskPromptViewCocoa createPlainBox]);
511 [separator setAutoresizingMask:NSViewWidthSizable]; 511 [separator setAutoresizingMask:NSViewWidthSizable];
512 [separator setFillColor:skia::SkColorToCalibratedNSColor(kSubtleBorderColor)]; 512 [separator setFillColor:skia::SkColorToCalibratedNSColor(kSubtleBorderColor)];
513 [storageView_ addSubview:separator]; 513 [storageView_ addSubview:separator];
514 514
515 [box sizeToFit]; 515 [box sizeToFit];
516 [separator setFrame:NSMakeRect(0, NSMaxY([box frame]), NSWidth([box frame]), 516 [separator setFrame:NSMakeRect(0, NSMaxY([box frame]), NSWidth([box frame]),
517 kSeparatorHeight)]; 517 kSeparatorHeight)];
518 [CardUnmaskPromptViewCocoa sizeToFitView:storageView_]; 518 [CardUnmaskPromptViewCocoa sizeToFitView:storageView_];
519 } 519 }
520 520
(...skipping 208 matching lines...) Expand 10 before | Expand all | Expand 10 after
729 [verifyButton_ setAction:@selector(onVerify:)]; 729 [verifyButton_ setAction:@selector(onVerify:)];
730 [verifyButton_ sizeToFit]; 730 [verifyButton_ sizeToFit];
731 [self updateVerifyButtonEnabled]; 731 [self updateVerifyButtonEnabled];
732 [mainView addSubview:verifyButton_]; 732 [mainView addSubview:verifyButton_];
733 733
734 [self setView:mainView]; 734 [self setView:mainView];
735 [self performLayoutAndDisplay:NO]; 735 [self performLayoutAndDisplay:NO];
736 } 736 }
737 737
738 @end 738 @end
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698