Commit 321edc10 authored by bondd's avatar bondd Committed by Commit bot

Autofill OSX: Replace AutofillPopUpButton with NSPopUpButton.

There's no need for AutofillPopUpButton here. None of its functionality
is used.

BUG=448572

Review URL: https://codereview.chromium.org/987503002

Cr-Commit-Position: refs/heads/master@{#319676}
parent 1203a7ec
...@@ -6,7 +6,6 @@ ...@@ -6,7 +6,6 @@
#include "chrome/browser/ui/autofill/autofill_dialog_models.h" #include "chrome/browser/ui/autofill/autofill_dialog_models.h"
#include "chrome/browser/ui/autofill/card_unmask_prompt_controller.h" #include "chrome/browser/ui/autofill/card_unmask_prompt_controller.h"
#include "chrome/browser/ui/cocoa/autofill/card_unmask_prompt_view_bridge.h" #include "chrome/browser/ui/cocoa/autofill/card_unmask_prompt_view_bridge.h"
#import "chrome/browser/ui/cocoa/autofill/autofill_pop_up_button.h"
#import "chrome/browser/ui/cocoa/constrained_window/constrained_window_button.h" #import "chrome/browser/ui/cocoa/constrained_window/constrained_window_button.h"
#include "chrome/browser/ui/chrome_style.h" #include "chrome/browser/ui/chrome_style.h"
#import "chrome/browser/ui/cocoa/constrained_window/constrained_window_control_utils.h" #import "chrome/browser/ui/cocoa/constrained_window/constrained_window_control_utils.h"
...@@ -88,15 +87,13 @@ void CardUnmaskPromptViewBridge::PerformClose() { ...@@ -88,15 +87,13 @@ void CardUnmaskPromptViewBridge::PerformClose() {
@implementation CardUnmaskPromptViewCocoa @implementation CardUnmaskPromptViewCocoa
+ (AutofillPopUpButton*)buildDatePopupWithModel:(ui::ComboboxModel&)model { + (NSPopUpButton*)buildDatePopupWithModel:(ui::ComboboxModel&)model {
AutofillPopUpButton* popup = NSPopUpButton* popup =
[[AutofillPopUpButton alloc] initWithFrame:NSZeroRect pullsDown:NO]; [[NSPopUpButton alloc] initWithFrame:NSZeroRect pullsDown:NO];
for (int i = 0; i < model.GetItemCount(); ++i) { for (int i = 0; i < model.GetItemCount(); ++i) {
[popup addItemWithTitle:base::SysUTF16ToNSString(model.GetItemAt(i))]; [popup addItemWithTitle:base::SysUTF16ToNSString(model.GetItemAt(i))];
} }
[popup setDefaultValue:base::SysUTF16ToNSString(
model.GetItemAt(model.GetDefaultIndex()))];
[popup sizeToFit]; [popup sizeToFit];
return popup; return popup;
} }
...@@ -177,13 +174,13 @@ void CardUnmaskPromptViewBridge::PerformClose() { ...@@ -177,13 +174,13 @@ void CardUnmaskPromptViewBridge::PerformClose() {
// Month. // Month.
autofill::MonthComboboxModel monthModel; autofill::MonthComboboxModel monthModel;
base::scoped_nsobject<AutofillPopUpButton> monthPopup( base::scoped_nsobject<NSPopUpButton> monthPopup(
[CardUnmaskPromptViewCocoa buildDatePopupWithModel:monthModel]); [CardUnmaskPromptViewCocoa buildDatePopupWithModel:monthModel]);
[expirationView addSubview:monthPopup]; [expirationView addSubview:monthPopup];
// Year. // Year.
autofill::YearComboboxModel yearModel; autofill::YearComboboxModel yearModel;
base::scoped_nsobject<AutofillPopUpButton> yearPopup( base::scoped_nsobject<NSPopUpButton> yearPopup(
[CardUnmaskPromptViewCocoa buildDatePopupWithModel:yearModel]); [CardUnmaskPromptViewCocoa buildDatePopupWithModel:yearModel]);
[expirationView addSubview:yearPopup]; [expirationView addSubview:yearPopup];
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment