| 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 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 50 , m_client(client) | 50 , m_client(client) |
| 51 , m_popup(0) | 51 , m_popup(0) |
| 52 , m_parameters(parameters) | 52 , m_parameters(parameters) |
| 53 , m_locale(Locale::create(parameters.locale)) | 53 , m_locale(Locale::create(parameters.locale)) |
| 54 { | 54 { |
| 55 ASSERT(m_chromeClient); | 55 ASSERT(m_chromeClient); |
| 56 ASSERT(m_client); | 56 ASSERT(m_client); |
| 57 m_popup = m_chromeClient->openPagePopup(this); | 57 m_popup = m_chromeClient->openPagePopup(this); |
| 58 } | 58 } |
| 59 | 59 |
| 60 PassRefPtrWillBeRawPtr<DateTimeChooserImpl> DateTimeChooserImpl::create(ChromeCl
ientImpl* chromeClient, DateTimeChooserClient* client, const DateTimeChooserPara
meters& parameters) | 60 RawPtr<DateTimeChooserImpl> DateTimeChooserImpl::create(ChromeClientImpl* chrome
Client, DateTimeChooserClient* client, const DateTimeChooserParameters& paramete
rs) |
| 61 { | 61 { |
| 62 return adoptRefWillBeNoop(new DateTimeChooserImpl(chromeClient, client, para
meters)); | 62 return (new DateTimeChooserImpl(chromeClient, client, parameters)); |
| 63 } | 63 } |
| 64 | 64 |
| 65 DateTimeChooserImpl::~DateTimeChooserImpl() | 65 DateTimeChooserImpl::~DateTimeChooserImpl() |
| 66 { | 66 { |
| 67 } | 67 } |
| 68 | 68 |
| 69 DEFINE_TRACE(DateTimeChooserImpl) | 69 DEFINE_TRACE(DateTimeChooserImpl) |
| 70 { | 70 { |
| 71 visitor->trace(m_chromeClient); | 71 visitor->trace(m_chromeClient); |
| 72 visitor->trace(m_client); | 72 visitor->trace(m_client); |
| (...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 180 return m_client->ownerElement(); | 180 return m_client->ownerElement(); |
| 181 } | 181 } |
| 182 | 182 |
| 183 Locale& DateTimeChooserImpl::locale() | 183 Locale& DateTimeChooserImpl::locale() |
| 184 { | 184 { |
| 185 return *m_locale; | 185 return *m_locale; |
| 186 } | 186 } |
| 187 | 187 |
| 188 void DateTimeChooserImpl::setValueAndClosePopup(int numValue, const String& stri
ngValue) | 188 void DateTimeChooserImpl::setValueAndClosePopup(int numValue, const String& stri
ngValue) |
| 189 { | 189 { |
| 190 RefPtrWillBeRawPtr<DateTimeChooserImpl> protector(this); | 190 RawPtr<DateTimeChooserImpl> protector(this); |
| 191 if (numValue >= 0) | 191 if (numValue >= 0) |
| 192 setValue(stringValue); | 192 setValue(stringValue); |
| 193 endChooser(); | 193 endChooser(); |
| 194 } | 194 } |
| 195 | 195 |
| 196 void DateTimeChooserImpl::setValue(const String& value) | 196 void DateTimeChooserImpl::setValue(const String& value) |
| 197 { | 197 { |
| 198 m_client->didChooseValue(value); | 198 m_client->didChooseValue(value); |
| 199 } | 199 } |
| 200 | 200 |
| 201 void DateTimeChooserImpl::closePopup() | 201 void DateTimeChooserImpl::closePopup() |
| 202 { | 202 { |
| 203 endChooser(); | 203 endChooser(); |
| 204 } | 204 } |
| 205 | 205 |
| 206 void DateTimeChooserImpl::didClosePopup() | 206 void DateTimeChooserImpl::didClosePopup() |
| 207 { | 207 { |
| 208 ASSERT(m_client); | 208 ASSERT(m_client); |
| 209 m_popup = nullptr; | 209 m_popup = nullptr; |
| 210 m_client->didEndChooser(); | 210 m_client->didEndChooser(); |
| 211 } | 211 } |
| 212 | 212 |
| 213 } // namespace blink | 213 } // namespace blink |
| 214 | 214 |
| 215 #endif // ENABLE(INPUT_MULTIPLE_FIELDS_UI) | 215 #endif // ENABLE(INPUT_MULTIPLE_FIELDS_UI) |
| OLD | NEW |