| 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 20 matching lines...) Expand all Loading... |
| 31 #ifndef PagePopupClient_h | 31 #ifndef PagePopupClient_h |
| 32 #define PagePopupClient_h | 32 #define PagePopupClient_h |
| 33 | 33 |
| 34 #include "platform/SharedBuffer.h" | 34 #include "platform/SharedBuffer.h" |
| 35 #include "platform/geometry/IntRect.h" | 35 #include "platform/geometry/IntRect.h" |
| 36 #include "wtf/text/CString.h" | 36 #include "wtf/text/CString.h" |
| 37 #include "wtf/text/WTFString.h" | 37 #include "wtf/text/WTFString.h" |
| 38 | 38 |
| 39 namespace blink { | 39 namespace blink { |
| 40 | 40 |
| 41 class Document; |
| 41 class Element; | 42 class Element; |
| 42 class Locale; | 43 class Locale; |
| 43 | 44 |
| 44 class PagePopupClient { | 45 class PagePopupClient { |
| 45 public: | 46 public: |
| 46 virtual IntSize contentSize() = 0; | 47 virtual IntSize contentSize() = 0; |
| 47 | 48 |
| 48 // Provide an HTML source to the specified buffer. The HTML | 49 // Provide an HTML source to the specified buffer. The HTML |
| 49 // source is rendered in a PagePopup. | 50 // source is rendered in a PagePopup. |
| 50 // The content HTML supports: | 51 // The content HTML supports: |
| 51 // - No <select> popups | 52 // - No <select> popups |
| 52 // - window.setValueAndClosePopup(number, string). | 53 // - window.setValueAndClosePopup(number, string). |
| 53 virtual void writeDocument(SharedBuffer*) = 0; | 54 virtual void writeDocument(SharedBuffer*) = 0; |
| 54 | 55 |
| 56 // This is called after the document is ready to do additionary setup. |
| 57 virtual void didWriteDocument(Document&) = 0; |
| 58 |
| 55 virtual Element& ownerElement() = 0; | 59 virtual Element& ownerElement() = 0; |
| 56 // Returns a Locale object associated to the client. | 60 // Returns a Locale object associated to the client. |
| 57 virtual Locale& locale() = 0; | 61 virtual Locale& locale() = 0; |
| 58 | 62 |
| 59 // This is called by the content HTML of a PagePopup. | 63 // This is called by the content HTML of a PagePopup. |
| 60 // An implementation of this function should call ChromeClient::closePagePop
up(). | 64 // An implementation of this function should call ChromeClient::closePagePop
up(). |
| 61 virtual void setValueAndClosePopup(int numValue, const String& stringValue)
= 0; | 65 virtual void setValueAndClosePopup(int numValue, const String& stringValue)
= 0; |
| 62 | 66 |
| 63 // This is called by the content HTML of a PagePopup. | 67 // This is called by the content HTML of a PagePopup. |
| 64 virtual void setValue(const String&) = 0; | 68 virtual void setValue(const String&) = 0; |
| (...skipping 18 matching lines...) Expand all Loading... |
| 83 }; | 87 }; |
| 84 | 88 |
| 85 inline void PagePopupClient::addString(const String& str, SharedBuffer* data) | 89 inline void PagePopupClient::addString(const String& str, SharedBuffer* data) |
| 86 { | 90 { |
| 87 CString str8 = str.utf8(); | 91 CString str8 = str.utf8(); |
| 88 data->append(str8.data(), str8.length()); | 92 data->append(str8.data(), str8.length()); |
| 89 } | 93 } |
| 90 | 94 |
| 91 } | 95 } |
| 92 #endif | 96 #endif |
| OLD | NEW |