OLD | NEW |
1 // Copyright (c) 2014 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2014 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 #include "config.h" | 5 #include "config.h" |
6 #include "web/PopupMenuImpl.h" | 6 #include "web/PopupMenuImpl.h" |
7 | 7 |
8 #include "core/HTMLNames.h" | 8 #include "core/HTMLNames.h" |
9 #include "core/css/CSSFontSelector.h" | 9 #include "core/css/CSSFontSelector.h" |
10 #include "core/dom/StyleEngine.h" | 10 #include "core/dom/StyleEngine.h" |
(...skipping 216 matching lines...) Loading... |
227 ASSERT(m_client); | 227 ASSERT(m_client); |
228 bool success; | 228 bool success; |
229 int listIndex = value.toInt(&success); | 229 int listIndex = value.toInt(&success); |
230 ASSERT(success); | 230 ASSERT(success); |
231 m_client->setTextFromItem(listIndex); | 231 m_client->setTextFromItem(listIndex); |
232 m_indexToSetOnClose = listIndex; | 232 m_indexToSetOnClose = listIndex; |
233 } | 233 } |
234 | 234 |
235 void PopupMenuImpl::didClosePopup() | 235 void PopupMenuImpl::didClosePopup() |
236 { | 236 { |
237 if (m_indexToSetOnClose >= 0) | 237 if (m_client && m_indexToSetOnClose >= 0) |
238 m_client->valueChanged(m_indexToSetOnClose); | 238 m_client->valueChanged(m_indexToSetOnClose); |
239 m_indexToSetOnClose = -1; | 239 m_indexToSetOnClose = -1; |
240 m_popup = nullptr; | 240 m_popup = nullptr; |
241 m_client->popupDidHide(); | 241 if (m_client) |
| 242 m_client->popupDidHide(); |
242 } | 243 } |
243 | 244 |
244 Element& PopupMenuImpl::ownerElement() | 245 Element& PopupMenuImpl::ownerElement() |
245 { | 246 { |
246 return m_client->ownerElement(); | 247 return m_client->ownerElement(); |
247 } | 248 } |
248 | 249 |
249 Locale& PopupMenuImpl::locale() | 250 Locale& PopupMenuImpl::locale() |
250 { | 251 { |
251 return Locale::defaultLocale(); | 252 return Locale::defaultLocale(); |
(...skipping 48 matching lines...) Loading... |
300 #if ENABLE(OILPAN) | 301 #if ENABLE(OILPAN) |
301 // Cannot be done during finalization, so instead done when the | 302 // Cannot be done during finalization, so instead done when the |
302 // render object is destroyed and disconnected. | 303 // render object is destroyed and disconnected. |
303 // | 304 // |
304 // FIXME: do this always, regardless of ENABLE(OILPAN). | 305 // FIXME: do this always, regardless of ENABLE(OILPAN). |
305 dispose(); | 306 dispose(); |
306 #endif | 307 #endif |
307 } | 308 } |
308 | 309 |
309 } // namespace blink | 310 } // namespace blink |
OLD | NEW |