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

Unified Diff: third_party/WebKit/Source/core/html/HTMLAnchorElement.cpp

Issue 2095303002: sendNavigationHint with mojo Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: sendNavigationHint mojo Created 4 years, 6 months 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: third_party/WebKit/Source/core/html/HTMLAnchorElement.cpp
diff --git a/third_party/WebKit/Source/core/html/HTMLAnchorElement.cpp b/third_party/WebKit/Source/core/html/HTMLAnchorElement.cpp
index e387666bddadcca9abafcd1e16c180b1d26da8fe..6a2a2ab0ec4a4117dacf4166104d26ad88d235f9 100644
--- a/third_party/WebKit/Source/core/html/HTMLAnchorElement.cpp
+++ b/third_party/WebKit/Source/core/html/HTMLAnchorElement.cpp
@@ -37,6 +37,7 @@
#include "core/page/ChromeClient.h"
#include "platform/network/NetworkHints.h"
#include "platform/weborigin/SecurityPolicy.h"
+#include "public/platform/resource_hints.mojom-blink.h"
namespace blink {
@@ -44,15 +45,6 @@ using namespace HTMLNames;
class HTMLAnchorElement::NavigationHintSender : public GarbageCollected<HTMLAnchorElement::NavigationHintSender> {
public:
- // TODO(horo): Move WebNavigationHintType to public/ directory.
- enum class WebNavigationHintType {
- Unknown,
- LinkMouseDown,
- LinkTapUnconfirmed,
- LinkTapDown,
- Last = LinkTapDown
- };
-
static NavigationHintSender* create(HTMLAnchorElement* anchorElement)
{
return new NavigationHintSender(anchorElement);
@@ -64,7 +56,7 @@ public:
private:
explicit NavigationHintSender(HTMLAnchorElement*);
bool shouldSendNavigationHint() const;
- void maybeSendNavigationHint(WebNavigationHintType);
+ void maybeSendNavigationHint(mojom::blink::NavigationHintType);
Member<HTMLAnchorElement> m_anchorElement;
};
@@ -72,11 +64,11 @@ private:
void HTMLAnchorElement::NavigationHintSender::handleEvent(Event* event)
{
if (event->type() == EventTypeNames::mousedown && event->isMouseEvent() && toMouseEvent(event)->button() == LeftButton)
- maybeSendNavigationHint(WebNavigationHintType::LinkMouseDown);
+ maybeSendNavigationHint(mojom::blink::NavigationHintType::LINK_MOUSE_DOWN);
else if (event->type() == EventTypeNames::gesturetapunconfirmed)
- maybeSendNavigationHint(WebNavigationHintType::LinkTapUnconfirmed);
+ maybeSendNavigationHint(mojom::blink::NavigationHintType::LINK_TAP_UNCONFIRMED);
else if (event->type() == EventTypeNames::gestureshowpress)
- maybeSendNavigationHint(WebNavigationHintType::LinkTapDown);
+ maybeSendNavigationHint(mojom::blink::NavigationHintType::LINK_TAP_DOWN);
}
DEFINE_TRACE(HTMLAnchorElement::NavigationHintSender)
@@ -111,12 +103,12 @@ bool HTMLAnchorElement::NavigationHintSender::shouldSendNavigationHint() const
return true;
}
-void HTMLAnchorElement::NavigationHintSender::maybeSendNavigationHint(WebNavigationHintType type)
+void HTMLAnchorElement::NavigationHintSender::maybeSendNavigationHint(mojom::blink::NavigationHintType type)
{
if (!shouldSendNavigationHint())
return;
- // TODO(horo): Send the navigation hint message to the browser process.
+ sendNavigationHint(m_anchorElement->href(), type);
}
HTMLAnchorElement::HTMLAnchorElement(const QualifiedName& tagName, Document& document)
« no previous file with comments | « content/browser/loader/resource_hints_handler_impl.cc ('k') | third_party/WebKit/Source/platform/network/NetworkHints.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698