| 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 | 5 * modification, are permitted provided that the following conditions |
| 6 * are met: | 6 * are met: |
| 7 * 1. Redistributions of source code must retain the above copyright | 7 * 1. Redistributions of source code must retain the above copyright |
| 8 * notice, this list of conditions and the following disclaimer. | 8 * notice, this list of conditions and the following disclaimer. |
| 9 * 2. Redistributions in binary form must reproduce the above copyright | 9 * 2. Redistributions in binary form must reproduce the above copyright |
| 10 * notice, this list of conditions and the following disclaimer in the | 10 * notice, this list of conditions and the following disclaimer in the |
| (...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 56 m_chooser->didChooseValue(value); | 56 m_chooser->didChooseValue(value); |
| 57 delete this; | 57 delete this; |
| 58 } | 58 } |
| 59 | 59 |
| 60 void didCancelChooser() override | 60 void didCancelChooser() override |
| 61 { | 61 { |
| 62 m_chooser->didCancelChooser(); | 62 m_chooser->didCancelChooser(); |
| 63 delete this; | 63 delete this; |
| 64 } | 64 } |
| 65 | 65 |
| 66 RefPtr<ExternalDateTimeChooser> m_chooser; | 66 RefPtrWillBePersistent<ExternalDateTimeChooser> m_chooser; |
| 67 }; | 67 }; |
| 68 | 68 |
| 69 ExternalDateTimeChooser::~ExternalDateTimeChooser() | 69 ExternalDateTimeChooser::~ExternalDateTimeChooser() |
| 70 { | 70 { |
| 71 } | 71 } |
| 72 | 72 |
| 73 DEFINE_TRACE(ExternalDateTimeChooser) |
| 74 { |
| 75 visitor->trace(m_client); |
| 76 DateTimeChooser::trace(visitor); |
| 77 } |
| 78 |
| 73 ExternalDateTimeChooser::ExternalDateTimeChooser(DateTimeChooserClient* client) | 79 ExternalDateTimeChooser::ExternalDateTimeChooser(DateTimeChooserClient* client) |
| 74 : m_client(client) | 80 : m_client(client) |
| 75 { | 81 { |
| 76 ASSERT(client); | 82 ASSERT(client); |
| 77 } | 83 } |
| 78 | 84 |
| 79 PassRefPtr<ExternalDateTimeChooser> ExternalDateTimeChooser::create(ChromeClient
Impl* chromeClient, WebViewClient* webViewClient, DateTimeChooserClient* client,
const DateTimeChooserParameters& parameters) | 85 PassRefPtrWillBeRawPtr<ExternalDateTimeChooser> ExternalDateTimeChooser::create(
ChromeClientImpl* chromeClient, WebViewClient* webViewClient, DateTimeChooserCli
ent* client, const DateTimeChooserParameters& parameters) |
| 80 { | 86 { |
| 81 ASSERT(chromeClient); | 87 ASSERT(chromeClient); |
| 82 RefPtr<ExternalDateTimeChooser> chooser = adoptRef(new ExternalDateTimeChoos
er(client)); | 88 RefPtrWillBeRawPtr<ExternalDateTimeChooser> chooser = adoptRefWillBeNoop(new
ExternalDateTimeChooser(client)); |
| 83 if (!chooser->openDateTimeChooser(chromeClient, webViewClient, parameters)) | 89 if (!chooser->openDateTimeChooser(chromeClient, webViewClient, parameters)) |
| 84 chooser.clear(); | 90 chooser.clear(); |
| 85 return chooser.release(); | 91 return chooser.release(); |
| 86 } | 92 } |
| 87 | 93 |
| 88 | 94 |
| 89 static WebDateTimeInputType toWebDateTimeInputType(const AtomicString& source) | 95 static WebDateTimeInputType toWebDateTimeInputType(const AtomicString& source) |
| 90 { | 96 { |
| 91 if (source == InputTypeNames::date) | 97 if (source == InputTypeNames::date) |
| 92 return WebDateTimeInputTypeDate; | 98 return WebDateTimeInputTypeDate; |
| (...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 155 | 161 |
| 156 void ExternalDateTimeChooser::didCancelChooser() | 162 void ExternalDateTimeChooser::didCancelChooser() |
| 157 { | 163 { |
| 158 if (m_client) | 164 if (m_client) |
| 159 m_client->didEndChooser(); | 165 m_client->didEndChooser(); |
| 160 } | 166 } |
| 161 | 167 |
| 162 void ExternalDateTimeChooser::endChooser() | 168 void ExternalDateTimeChooser::endChooser() |
| 163 { | 169 { |
| 164 DateTimeChooserClient* client = m_client; | 170 DateTimeChooserClient* client = m_client; |
| 165 m_client = 0; | 171 m_client = nullptr; |
| 166 client->didEndChooser(); | 172 client->didEndChooser(); |
| 167 } | 173 } |
| 168 | 174 |
| 169 AXObject* ExternalDateTimeChooser::rootAXObject() | 175 AXObject* ExternalDateTimeChooser::rootAXObject() |
| 170 { | 176 { |
| 171 return 0; | 177 return nullptr; |
| 172 } | 178 } |
| 173 | 179 |
| 174 } // namespace blink | 180 } // namespace blink |
| 175 | 181 |
| 176 #endif | 182 #endif |
| OLD | NEW |