OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2011, 2012 Google Inc. All rights reserved. | 2 * Copyright (C) 2011, 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 3467 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3478 | 3478 |
3479 RefPtr<Node> focusedNode = focusedWebCoreNode(); | 3479 RefPtr<Node> focusedNode = focusedWebCoreNode(); |
3480 // If the node for which we queried the Autofill suggestions is not the | 3480 // If the node for which we queried the Autofill suggestions is not the |
3481 // focused node, then we have nothing to do. FIXME: also check the | 3481 // focused node, then we have nothing to do. FIXME: also check the |
3482 // caret is at the end and that the text has not changed. | 3482 // caret is at the end and that the text has not changed. |
3483 if (!focusedNode || focusedNode != PassRefPtr<Node>(node)) { | 3483 if (!focusedNode || focusedNode != PassRefPtr<Node>(node)) { |
3484 hideAutofillPopup(); | 3484 hideAutofillPopup(); |
3485 return; | 3485 return; |
3486 } | 3486 } |
3487 | 3487 |
3488 HTMLInputElement* inputElem = focusedNode->toInputElement(); | 3488 Handle<HTMLInputElement> inputElem = focusedNode->toInputElement(); |
3489 ASSERT(inputElem); | 3489 ASSERT(inputElem); |
3490 | 3490 |
3491 // The first time the Autofill popup is shown we'll create the client and | 3491 // The first time the Autofill popup is shown we'll create the client and |
3492 // the popup. | 3492 // the popup. |
3493 if (!m_autofillPopupClient) | 3493 if (!m_autofillPopupClient) |
3494 m_autofillPopupClient = adoptPtr(new AutofillPopupMenuClient); | 3494 m_autofillPopupClient = adoptPtr(new AutofillPopupMenuClient); |
3495 | 3495 |
3496 m_autofillPopupClient->initialize( | 3496 m_autofillPopupClient->initialize(inputElem.raw(), names, labels, icons, ite
mIDs, separatorIndex); |
3497 inputElem, names, labels, icons, itemIDs, separatorIndex); | |
3498 | 3497 |
3499 if (!m_autofillPopup) { | 3498 if (!m_autofillPopup) { |
3500 PopupContainerSettings popupSettings = autofillPopupSettings; | 3499 PopupContainerSettings popupSettings = autofillPopupSettings; |
3501 popupSettings.deviceSupportsTouch = settingsImpl()->deviceSupportsTouch(
); | 3500 popupSettings.deviceSupportsTouch = settingsImpl()->deviceSupportsTouch(
); |
3502 m_autofillPopup = PopupContainer::create(m_autofillPopupClient.get(), | 3501 m_autofillPopup = PopupContainer::create(m_autofillPopupClient.get(), |
3503 PopupContainer::Suggestion, | 3502 PopupContainer::Suggestion, |
3504 popupSettings); | 3503 popupSettings); |
3505 } | 3504 } |
3506 | 3505 |
3507 if (m_autofillPopupShowing) { | 3506 if (m_autofillPopupShowing) { |
(...skipping 705 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4213 } | 4212 } |
4214 | 4213 |
4215 bool WebViewImpl::shouldDisableDesktopWorkarounds() | 4214 bool WebViewImpl::shouldDisableDesktopWorkarounds() |
4216 { | 4215 { |
4217 ViewportArguments arguments = mainFrameImpl()->frame()->document()->viewport
Arguments(); | 4216 ViewportArguments arguments = mainFrameImpl()->frame()->document()->viewport
Arguments(); |
4218 return arguments.width == ViewportArguments::ValueDeviceWidth || !arguments.
userZoom | 4217 return arguments.width == ViewportArguments::ValueDeviceWidth || !arguments.
userZoom |
4219 || (arguments.minZoom == arguments.maxZoom && arguments.minZoom != Viewp
ortArguments::ValueAuto); | 4218 || (arguments.minZoom == arguments.maxZoom && arguments.minZoom != Viewp
ortArguments::ValueAuto); |
4220 } | 4219 } |
4221 | 4220 |
4222 } // namespace WebKit | 4221 } // namespace WebKit |
OLD | NEW |