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

Unified Diff: sky/engine/core/html/HTMLAnchorElement.cpp

Issue 695803003: Make clicks on <a> request a navigation (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 6 years, 2 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: sky/engine/core/html/HTMLAnchorElement.cpp
diff --git a/sky/engine/core/html/HTMLAnchorElement.cpp b/sky/engine/core/html/HTMLAnchorElement.cpp
index eb576e4520b631f1b263221e3b9f9538704abdc1..73ac2a64643f64f437ddf5829fe0c85796f5b703 100644
--- a/sky/engine/core/html/HTMLAnchorElement.cpp
+++ b/sky/engine/core/html/HTMLAnchorElement.cpp
@@ -39,11 +39,13 @@
#include "core/page/Chrome.h"
#include "core/page/ChromeClient.h"
#include "core/rendering/RenderImage.h"
+#include "mojo/services/public/interfaces/navigation/navigation.mojom.h"
#include "platform/PlatformMouseEvent.h"
#include "platform/network/ResourceRequest.h"
#include "platform/weborigin/KnownPorts.h"
#include "platform/weborigin/SecurityPolicy.h"
#include "public/platform/Platform.h"
+#include "public/platform/ServiceProvider.h"
#include "public/platform/WebURL.h"
#include "public/platform/WebURLRequest.h"
#include "wtf/text/StringBuilder.h"
@@ -128,8 +130,17 @@ bool HTMLAnchorElement::isLiveLink() const
void HTMLAnchorElement::handleClick(Event* event)
{
+ Frame* frame = document().frame();
+ if (!frame)
+ return;
+ FrameHost* host = frame->host();
+ if (!host)
+ return;
+ mojo::URLRequestPtr request = mojo::URLRequest::New();
+ request->url = href().string().toUTF8();
+ host->services().NavigatorHost()->RequestNavigate(
+ mojo::TARGET_SOURCE_NODE, request.Pass());
event->setDefaultHandled();
- // FIXME(sky): reimplement
}
bool HTMLAnchorElement::willRespondToMouseClickEvents()

Powered by Google App Engine
This is Rietveld 408576698