| 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 16 matching lines...) Expand all Loading... |
| 27 #define ValidationMessageClient_h | 27 #define ValidationMessageClient_h |
| 28 | 28 |
| 29 #include "platform/heap/Handle.h" | 29 #include "platform/heap/Handle.h" |
| 30 #include "wtf/Forward.h" | 30 #include "wtf/Forward.h" |
| 31 | 31 |
| 32 namespace WebCore { | 32 namespace WebCore { |
| 33 | 33 |
| 34 class Document; | 34 class Document; |
| 35 class Element; | 35 class Element; |
| 36 | 36 |
| 37 |
| 37 class ValidationMessageClient : public WillBeGarbageCollectedMixin { | 38 class ValidationMessageClient : public WillBeGarbageCollectedMixin { |
| 38 public: | 39 public: |
| 40 enum MessageType { |
| 41 CannedMessage, |
| 42 CustomMessage |
| 43 }; |
| 44 |
| 39 virtual ~ValidationMessageClient() { } | 45 virtual ~ValidationMessageClient() { } |
| 40 | 46 |
| 41 // Show validation message for the specified anchor element. An | 47 // Show validation message for the specified anchor element. An |
| 42 // implementation of this function may hide the message automatically after | 48 // implementation of this function may hide the message automatically after |
| 43 // some period. | 49 // some period. |
| 44 virtual void showValidationMessage(const Element& anchor, const String& mess
age) = 0; | 50 virtual void showValidationMessage(const Element& anchor, const String& mess
age, MessageType) = 0; |
| 45 | 51 |
| 46 // Hide validation message for the specified anchor if the message for the | 52 // Hide validation message for the specified anchor if the message for the |
| 47 // anchor is already visible. | 53 // anchor is already visible. |
| 48 virtual void hideValidationMessage(const Element& anchor) = 0; | 54 virtual void hideValidationMessage(const Element& anchor) = 0; |
| 49 | 55 |
| 50 // Returns true if the validation message for the specified anchor element | 56 // Returns true if the validation message for the specified anchor element |
| 51 // is visible. | 57 // is visible. |
| 52 virtual bool isValidationMessageVisible(const Element& anchor) = 0; | 58 virtual bool isValidationMessageVisible(const Element& anchor) = 0; |
| 53 | 59 |
| 54 virtual void documentDetached(const Document&) = 0; | 60 virtual void documentDetached(const Document&) = 0; |
| 55 | 61 |
| 56 virtual void willBeDestroyed() = 0; | 62 virtual void willBeDestroyed() = 0; |
| 57 | 63 |
| 58 virtual void trace(Visitor*) { } | 64 virtual void trace(Visitor*) { } |
| 59 }; | 65 }; |
| 60 | 66 |
| 61 } | 67 } |
| 62 | 68 |
| 63 #endif | 69 #endif |
| OLD | NEW |