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

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

Issue 124533003: Add country combobox to change country and rebuild address inputs. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: mac 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 | Annotate | Revision Log
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 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_pop_up_button.h" 5 #import "chrome/browser/ui/cocoa/autofill/autofill_pop_up_button.h"
6 6
7 #include <ApplicationServices/ApplicationServices.h> 7 #include <ApplicationServices/ApplicationServices.h>
8 8
9 #include "base/mac/scoped_nsobject.h" 9 #include "base/mac/scoped_nsobject.h"
10 #include "ui/gfx/scoped_ns_graphics_context_save_gstate_mac.h" 10 #include "ui/gfx/scoped_ns_graphics_context_save_gstate_mac.h"
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after
64 64
65 - (void)setDefaultValue:(NSString*)defaultValue { 65 - (void)setDefaultValue:(NSString*)defaultValue {
66 [[self cell] setDefaultValue:defaultValue]; 66 [[self cell] setDefaultValue:defaultValue];
67 } 67 }
68 68
69 - (BOOL)isDefault { 69 - (BOOL)isDefault {
70 return [[[self cell] fieldValue] isEqualToString:[[self cell] defaultValue]]; 70 return [[[self cell] fieldValue] isEqualToString:[[self cell] defaultValue]];
71 } 71 }
72 72
73 - (void)didSelectItem:(id)sender { 73 - (void)didSelectItem:(id)sender {
74 if (inputDelegate_) 74 if (inputDelegate_) {
75 [inputDelegate_ didChange:self];
75 [inputDelegate_ didEndEditing:self]; 76 [inputDelegate_ didEndEditing:self];
77 }
76 } 78 }
77 79
78 @end 80 @end
79 81
80 82
81 @implementation AutofillPopUpCell 83 @implementation AutofillPopUpCell
82 84
83 @synthesize invalid = invalid_; 85 @synthesize invalid = invalid_;
84 @synthesize defaultValue = defaultValue_; 86 @synthesize defaultValue = defaultValue_;
85 87
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
131 133
132 - (void)setFieldValue:(NSString*)fieldValue { 134 - (void)setFieldValue:(NSString*)fieldValue {
133 [self selectItemWithTitle:fieldValue]; 135 [self selectItemWithTitle:fieldValue];
134 if (![self selectedItem]) 136 if (![self selectedItem])
135 [self selectItemWithTitle:defaultValue_]; 137 [self selectItemWithTitle:defaultValue_];
136 if (![self selectedItem]) 138 if (![self selectedItem])
137 [self selectItemAtIndex:0]; 139 [self selectItemAtIndex:0];
138 } 140 }
139 141
140 @end 142 @end
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698