Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2436)

Unified Diff: Source/web/WebPagePopupImpl.cpp

Issue 736883002: Implement <select> Popup Menu using PagePopup (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: Source/web/WebPagePopupImpl.cpp
diff --git a/Source/web/WebPagePopupImpl.cpp b/Source/web/WebPagePopupImpl.cpp
index 1250ff583a31de73aba6b1fe746d78662811ba95..795a1aa658f36ae1f7fccc90be2ed481d9f1e9b2 100644
--- a/Source/web/WebPagePopupImpl.cpp
+++ b/Source/web/WebPagePopupImpl.cpp
@@ -48,6 +48,7 @@
#include "modules/accessibility/AXObjectCacheImpl.h"
#include "platform/EventDispatchForbiddenScope.h"
#include "platform/LayoutTestSupport.h"
+#include "platform/ScriptForbiddenScope.h"
#include "platform/TraceEvent.h"
#include "platform/heap/Handle.h"
#include "public/platform/WebCompositeAndReadbackAsyncCallback.h"
@@ -178,6 +179,12 @@ private:
m_popup->m_webView->client()->postAccessibilityEvent(WebAXObject(obj), static_cast<WebAXEvent>(notification));
}
+ virtual void setToolTip(const String& tooltipText, TextDirection dir) override
+ {
+ if (m_popup->m_webView->client())
+ m_popup->m_webView->client()->setToolTipText(tooltipText, toWebTextDirection(dir));
+ }
+
WebPagePopupImpl* m_popup;
};
@@ -260,9 +267,24 @@ bool WebPagePopupImpl::initializePage()
RefPtr<SharedBuffer> data = SharedBuffer::create();
m_popupClient->writeDocument(data.get());
frame->loader().load(FrameLoadRequest(0, blankURL(), SubstituteData(data, "text/html", "UTF-8", KURL(), ForceSynchronousLoad)));
+
+ m_popupClient->didWriteDocument(frame->document());
+
return true;
}
+void WebPagePopupImpl::postMessage(const String& message)
+{
+ if (!m_page)
+ return;
+ ScriptForbiddenScope::AllowUserAgentScript allowScript;
+ LocalDOMWindow* window = toLocalFrame(m_page->mainFrame())->localDOMWindow();
+ if (!window)
+ return;
+ RefPtrWillBeRawPtr<MessageEvent> event = MessageEvent::create(message);
+ window->dispatchEvent(event);
tkent 2014/12/15 09:26:05 window->dispatchEvent(MessageEvent::create(message
keishi 2014/12/16 03:53:24 Done.
+}
+
void WebPagePopupImpl::destroyPage()
{
if (!m_page)

Powered by Google App Engine
This is Rietveld 408576698