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 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
53 , m_client(client) | 53 , m_client(client) |
54 , m_popup(0) | 54 , m_popup(0) |
55 , m_parameters(parameters) | 55 , m_parameters(parameters) |
56 , m_locale(WebCore::Locale::create(parameters.locale)) | 56 , m_locale(WebCore::Locale::create(parameters.locale)) |
57 { | 57 { |
58 ASSERT(m_chromeClient); | 58 ASSERT(m_chromeClient); |
59 ASSERT(m_client); | 59 ASSERT(m_client); |
60 m_popup = m_chromeClient->openPagePopup(this, m_parameters.anchorRectInRootV
iew); | 60 m_popup = m_chromeClient->openPagePopup(this, m_parameters.anchorRectInRootV
iew); |
61 } | 61 } |
62 | 62 |
63 PassRefPtr<DateTimeChooserImpl> DateTimeChooserImpl::create(ChromeClientImpl* ch
romeClient, WebCore::DateTimeChooserClient* client, const WebCore::DateTimeChoos
erParameters& parameters) | 63 PassRefPtrWillBeRawPtr<DateTimeChooserImpl> DateTimeChooserImpl::create(ChromeCl
ientImpl* chromeClient, WebCore::DateTimeChooserClient* client, const WebCore::D
ateTimeChooserParameters& parameters) |
64 { | 64 { |
65 return adoptRef(new DateTimeChooserImpl(chromeClient, client, parameters)); | 65 return adoptRefWillBeNoop(new DateTimeChooserImpl(chromeClient, client, para
meters)); |
66 } | 66 } |
67 | 67 |
68 DateTimeChooserImpl::~DateTimeChooserImpl() | 68 DateTimeChooserImpl::~DateTimeChooserImpl() |
69 { | 69 { |
70 } | 70 } |
71 | 71 |
72 void DateTimeChooserImpl::endChooser() | 72 void DateTimeChooserImpl::endChooser() |
73 { | 73 { |
74 if (!m_popup) | 74 if (!m_popup) |
75 return; | 75 return; |
(...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
167 addString("</script></body>\n", data); | 167 addString("</script></body>\n", data); |
168 } | 168 } |
169 | 169 |
170 WebCore::Locale& DateTimeChooserImpl::locale() | 170 WebCore::Locale& DateTimeChooserImpl::locale() |
171 { | 171 { |
172 return *m_locale; | 172 return *m_locale; |
173 } | 173 } |
174 | 174 |
175 void DateTimeChooserImpl::setValueAndClosePopup(int numValue, const String& stri
ngValue) | 175 void DateTimeChooserImpl::setValueAndClosePopup(int numValue, const String& stri
ngValue) |
176 { | 176 { |
177 RefPtr<DateTimeChooserImpl> protector(this); | 177 RefPtrWillBeRawPtr<DateTimeChooserImpl> protector(this); |
178 if (numValue >= 0) | 178 if (numValue >= 0) |
179 setValue(stringValue); | 179 setValue(stringValue); |
180 endChooser(); | 180 endChooser(); |
181 } | 181 } |
182 | 182 |
183 void DateTimeChooserImpl::setValue(const String& value) | 183 void DateTimeChooserImpl::setValue(const String& value) |
184 { | 184 { |
185 m_client->didChooseValue(value); | 185 m_client->didChooseValue(value); |
186 } | 186 } |
187 | 187 |
188 void DateTimeChooserImpl::closePopup() | 188 void DateTimeChooserImpl::closePopup() |
189 { | 189 { |
190 endChooser(); | 190 endChooser(); |
191 } | 191 } |
192 | 192 |
193 void DateTimeChooserImpl::didClosePopup() | 193 void DateTimeChooserImpl::didClosePopup() |
194 { | 194 { |
195 ASSERT(m_client); | 195 ASSERT(m_client); |
196 m_popup = 0; | 196 m_popup = 0; |
197 m_client->didEndChooser(); | 197 m_client->didEndChooser(); |
198 } | 198 } |
199 | 199 |
| 200 void DateTimeChooserImpl::trace(Visitor* visitor) |
| 201 { |
| 202 DateTimeChooser::trace(visitor); |
| 203 } |
| 204 |
200 } // namespace blink | 205 } // namespace blink |
201 | 206 |
202 #endif // ENABLE(INPUT_MULTIPLE_FIELDS_UI) | 207 #endif // ENABLE(INPUT_MULTIPLE_FIELDS_UI) |
OLD | NEW |