| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2010, 2012 Google Inc. All rights reserved. | 2 * Copyright (C) 2010, 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 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 56 | 56 |
| 57 ValidationMessageClient* ValidationMessage::validationMessageClient() const | 57 ValidationMessageClient* ValidationMessage::validationMessageClient() const |
| 58 { | 58 { |
| 59 Page* page = m_element->document().page(); | 59 Page* page = m_element->document().page(); |
| 60 if (!page) | 60 if (!page) |
| 61 return 0; | 61 return 0; |
| 62 | 62 |
| 63 return &page->validationMessageClient(); | 63 return &page->validationMessageClient(); |
| 64 } | 64 } |
| 65 | 65 |
| 66 void ValidationMessage::updateValidationMessage(const String& message) | 66 void ValidationMessage::updateValidationMessage(const String& message, bool cust
omError) |
| 67 { | 67 { |
| 68 ValidationMessageClient* client = validationMessageClient(); | 68 ValidationMessageClient* client = validationMessageClient(); |
| 69 if (!client) | 69 if (!client) |
| 70 return; | 70 return; |
| 71 if (message.isEmpty()) | 71 if (message.isEmpty()) |
| 72 requestToHideMessage(); | 72 requestToHideMessage(); |
| 73 else | 73 else |
| 74 client->showValidationMessage(*m_element, message); | 74 client->showValidationMessage(*m_element, message, customError); |
| 75 } | 75 } |
| 76 | 76 |
| 77 void ValidationMessage::requestToHideMessage() | 77 void ValidationMessage::requestToHideMessage() |
| 78 { | 78 { |
| 79 if (ValidationMessageClient* client = validationMessageClient()) | 79 if (ValidationMessageClient* client = validationMessageClient()) |
| 80 client->hideValidationMessage(*m_element); | 80 client->hideValidationMessage(*m_element); |
| 81 } | 81 } |
| 82 | 82 |
| 83 bool ValidationMessage::isVisible() const | 83 bool ValidationMessage::isVisible() const |
| 84 { | 84 { |
| 85 if (ValidationMessageClient* client = validationMessageClient()) | 85 if (ValidationMessageClient* client = validationMessageClient()) |
| 86 return client->isValidationMessageVisible(*m_element); | 86 return client->isValidationMessageVisible(*m_element); |
| 87 return false; | 87 return false; |
| 88 } | 88 } |
| 89 | 89 |
| 90 } // namespace WebCore | 90 } // namespace WebCore |
| OLD | NEW |