OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2012 Google Inc. All rights reserved. | 2 * Copyright (C) 2012 Google Inc. All rights reserved. |
3 * | 3 * |
4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
5 * modification, are permitted provided that the following conditions are | 5 * modification, are permitted provided that the following conditions are |
6 * met: | 6 * met: |
7 * | 7 * |
8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
51 , m_client(client) | 51 , m_client(client) |
52 , m_popup(0) | 52 , m_popup(0) |
53 , m_parameters(parameters) | 53 , m_parameters(parameters) |
54 , m_locale(Locale::create(parameters.locale)) | 54 , m_locale(Locale::create(parameters.locale)) |
55 { | 55 { |
56 ASSERT(m_chromeClient); | 56 ASSERT(m_chromeClient); |
57 ASSERT(m_client); | 57 ASSERT(m_client); |
58 m_popup = m_chromeClient->openPagePopup(this); | 58 m_popup = m_chromeClient->openPagePopup(this); |
59 } | 59 } |
60 | 60 |
61 PassRefPtr<DateTimeChooserImpl> DateTimeChooserImpl::create(ChromeClientImpl* ch
romeClient, DateTimeChooserClient* client, const DateTimeChooserParameters& para
meters) | 61 PassRefPtrWillBeRawPtr<DateTimeChooserImpl> DateTimeChooserImpl::create(ChromeCl
ientImpl* chromeClient, DateTimeChooserClient* client, const DateTimeChooserPara
meters& parameters) |
62 { | 62 { |
63 return adoptRef(new DateTimeChooserImpl(chromeClient, client, parameters)); | 63 return adoptRefWillBeNoop(new DateTimeChooserImpl(chromeClient, client, para
meters)); |
64 } | 64 } |
65 | 65 |
66 DateTimeChooserImpl::~DateTimeChooserImpl() | 66 DateTimeChooserImpl::~DateTimeChooserImpl() |
67 { | 67 { |
68 } | 68 } |
69 | 69 |
| 70 DEFINE_TRACE(DateTimeChooserImpl) |
| 71 { |
| 72 visitor->trace(m_chromeClient); |
| 73 DateTimeChooser::trace(visitor); |
| 74 } |
| 75 |
70 void DateTimeChooserImpl::endChooser() | 76 void DateTimeChooserImpl::endChooser() |
71 { | 77 { |
72 if (!m_popup) | 78 if (!m_popup) |
73 return; | 79 return; |
74 m_chromeClient->closePagePopup(m_popup); | 80 m_chromeClient->closePagePopup(m_popup); |
75 } | 81 } |
76 | 82 |
77 AXObject* DateTimeChooserImpl::rootAXObject() | 83 AXObject* DateTimeChooserImpl::rootAXObject() |
78 { | 84 { |
79 return m_popup ? m_popup->rootAXObject() : 0; | 85 return m_popup ? m_popup->rootAXObject() : 0; |
(...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
177 return m_client->ownerElement(); | 183 return m_client->ownerElement(); |
178 } | 184 } |
179 | 185 |
180 Locale& DateTimeChooserImpl::locale() | 186 Locale& DateTimeChooserImpl::locale() |
181 { | 187 { |
182 return *m_locale; | 188 return *m_locale; |
183 } | 189 } |
184 | 190 |
185 void DateTimeChooserImpl::setValueAndClosePopup(int numValue, const String& stri
ngValue) | 191 void DateTimeChooserImpl::setValueAndClosePopup(int numValue, const String& stri
ngValue) |
186 { | 192 { |
187 RefPtr<DateTimeChooserImpl> protector(this); | 193 RefPtrWillBeRawPtr<DateTimeChooserImpl> protector(this); |
188 if (numValue >= 0) | 194 if (numValue >= 0) |
189 setValue(stringValue); | 195 setValue(stringValue); |
190 endChooser(); | 196 endChooser(); |
191 } | 197 } |
192 | 198 |
193 void DateTimeChooserImpl::setValue(const String& value) | 199 void DateTimeChooserImpl::setValue(const String& value) |
194 { | 200 { |
195 m_client->didChooseValue(value); | 201 m_client->didChooseValue(value); |
196 } | 202 } |
197 | 203 |
198 void DateTimeChooserImpl::closePopup() | 204 void DateTimeChooserImpl::closePopup() |
199 { | 205 { |
200 endChooser(); | 206 endChooser(); |
201 } | 207 } |
202 | 208 |
203 void DateTimeChooserImpl::didClosePopup() | 209 void DateTimeChooserImpl::didClosePopup() |
204 { | 210 { |
205 ASSERT(m_client); | 211 ASSERT(m_client); |
206 m_popup = 0; | 212 m_popup = 0; |
207 m_client->didEndChooser(); | 213 m_client->didEndChooser(); |
208 } | 214 } |
209 | 215 |
210 } // namespace blink | 216 } // namespace blink |
211 | 217 |
212 #endif // ENABLE(INPUT_MULTIPLE_FIELDS_UI) | 218 #endif // ENABLE(INPUT_MULTIPLE_FIELDS_UI) |
OLD | NEW |