| 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 13 matching lines...) Expand all Loading... |
| 24 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, | 24 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, |
| 25 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY | 25 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY |
| 26 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | 26 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
| 27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | 27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
| 28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
| 29 */ | 29 */ |
| 30 | 30 |
| 31 #include "config.h" | 31 #include "config.h" |
| 32 #include "core/page/PagePopupController.h" | 32 #include "core/page/PagePopupController.h" |
| 33 | 33 |
| 34 #include "core/page/PagePopup.h" |
| 34 #include "core/page/PagePopupClient.h" | 35 #include "core/page/PagePopupClient.h" |
| 35 #include "platform/text/PlatformLocale.h" | 36 #include "platform/text/PlatformLocale.h" |
| 36 #include "public/platform/Platform.h" | 37 #include "public/platform/Platform.h" |
| 37 | 38 |
| 38 namespace blink { | 39 namespace blink { |
| 39 | 40 |
| 40 PagePopupController::PagePopupController(PagePopupClient* client) | 41 PagePopupController::PagePopupController(PagePopup& popup, PagePopupClient* clie
nt) |
| 41 : m_popupClient(client) | 42 : m_popup(popup) |
| 43 , m_popupClient(client) |
| 42 { | 44 { |
| 43 ASSERT(client); | 45 ASSERT(client); |
| 44 } | 46 } |
| 45 | 47 |
| 46 PassRefPtrWillBeRawPtr<PagePopupController> PagePopupController::create(PagePopu
pClient* client) | 48 PassRefPtrWillBeRawPtr<PagePopupController> PagePopupController::create(PagePopu
p& popup, PagePopupClient* client) |
| 47 { | 49 { |
| 48 return adoptRefWillBeNoop(new PagePopupController(client)); | 50 return adoptRefWillBeNoop(new PagePopupController(popup, client)); |
| 49 } | 51 } |
| 50 | 52 |
| 51 void PagePopupController::setValueAndClosePopup(int numValue, const String& stri
ngValue) | 53 void PagePopupController::setValueAndClosePopup(int numValue, const String& stri
ngValue) |
| 52 { | 54 { |
| 53 if (m_popupClient) | 55 if (m_popupClient) |
| 54 m_popupClient->setValueAndClosePopup(numValue, stringValue); | 56 m_popupClient->setValueAndClosePopup(numValue, stringValue); |
| 55 } | 57 } |
| 56 | 58 |
| 57 void PagePopupController::setValue(const String& value) | 59 void PagePopupController::setValue(const String& value) |
| 58 { | 60 { |
| (...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 112 void PagePopupController::clearPagePopupClient() | 114 void PagePopupController::clearPagePopupClient() |
| 113 { | 115 { |
| 114 m_popupClient = nullptr; | 116 m_popupClient = nullptr; |
| 115 } | 117 } |
| 116 | 118 |
| 117 void PagePopupController::histogramEnumeration(const String& name, int sample, i
nt boundaryValue) | 119 void PagePopupController::histogramEnumeration(const String& name, int sample, i
nt boundaryValue) |
| 118 { | 120 { |
| 119 blink::Platform::current()->histogramEnumeration(name.utf8().data(), sample,
boundaryValue); | 121 blink::Platform::current()->histogramEnumeration(name.utf8().data(), sample,
boundaryValue); |
| 120 } | 122 } |
| 121 | 123 |
| 124 void PagePopupController::setWindowRect(int x, int y, int width, int height) |
| 125 { |
| 126 m_popup.setWindowRect(IntRect(x, y, width, height)); |
| 122 } | 127 } |
| 128 |
| 129 } |
| OLD | NEW |