OLD | NEW |
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 Loading... |
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 22 matching lines...) Expand all Loading... |
108 | 110 |
109 - (void)setFieldValue:(NSString*)fieldValue { | 111 - (void)setFieldValue:(NSString*)fieldValue { |
110 [self selectItemWithTitle:fieldValue]; | 112 [self selectItemWithTitle:fieldValue]; |
111 if (![self selectedItem]) | 113 if (![self selectedItem]) |
112 [self selectItemWithTitle:defaultValue_]; | 114 [self selectItemWithTitle:defaultValue_]; |
113 if (![self selectedItem]) | 115 if (![self selectedItem]) |
114 [self selectItemAtIndex:0]; | 116 [self selectItemAtIndex:0]; |
115 } | 117 } |
116 | 118 |
117 @end | 119 @end |
OLD | NEW |