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

Unified Diff: webkit/glue/chromium_bridge_impl.cc

Issue 12928: Implement visited link coloring. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 12 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
« no previous file with comments | « webkit/build/port/port.vcproj ('k') | webkit/glue/webkit_glue.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webkit/glue/chromium_bridge_impl.cc
===================================================================
--- webkit/glue/chromium_bridge_impl.cc (revision 6868)
+++ webkit/glue/chromium_bridge_impl.cc (working copy)
@@ -33,6 +33,7 @@
#include "base/time.h"
#include "base/trace_event.h"
#include "build/build_config.h"
+#include "googleurl/src/url_util.h"
#include "net/base/mime_util.h"
#if USE(V8)
#include <v8.h>
@@ -521,6 +522,41 @@
return webkit_glue::GURLToKURL(webkit_glue::GetInspectorURL());
}
+// Visited links --------------------------------------------------------------
+
+WebCore::LinkHash ChromiumBridge::visitedLinkHash(const UChar* url,
+ unsigned length) {
+ url_canon::RawCanonOutput<2048> buffer;
macdome_gmail.com 2008/12/13 01:36:27 Pixels? Edict? Sound? Yes, we speak a crazy lan
+ url_parse::Parsed parsed;
+ if (!url_util::Canonicalize(url, length, NULL, &buffer, &parsed))
+ return false; // Invalid URLs are unvisited.
+ return webkit_glue::VisitedLinkHash(buffer.data(), buffer.length());
+}
+
+WebCore::LinkHash ChromiumBridge::visitedLinkHash(
+ const WebCore::KURL& base,
+ const WebCore::AtomicString& attributeURL) {
+ // Resolve the relative URL using googleurl and pass the absolute URL up to
+ // the embedder. We could create a GURL object from the base and resolve the
+ // relative URL that way, but calling the lower-level functions directly
+ // saves us the std::string allocation in most cases.
+ url_canon::RawCanonOutput<2048> buffer;
+ url_parse::Parsed parsed;
+
+ WebCore::CString cstr = base.utf8String();
+ if (!url_util::ResolveRelative(cstr.data(), cstr.length(), base.parsed(),
+ attributeURL.characters(),
+ attributeURL.length(), NULL,
+ &buffer, &parsed))
+ return false; // Invalid resolved URL.
+
+ return webkit_glue::VisitedLinkHash(buffer.data(), buffer.length());
+}
+
+bool ChromiumBridge::isLinkVisited(WebCore::LinkHash visitedLinkHash) {
+ return webkit_glue::IsLinkVisited(visitedLinkHash);
+}
+
// Widget ---------------------------------------------------------------------
void ChromiumBridge::widgetSetCursor(Widget* widget, const Cursor& cursor) {
@@ -535,12 +571,4 @@
chrome_client->focus();
}
-// Link history ---------------------------------------------------------------
-
-bool ChromiumBridge::isLinkVisited(LinkHash) {
- // NOT IMPLEMENTED
- // http://code.google.com/p/chromium/issues/detail?id=5401
- return false;
-}
-
} // namespace WebCore
« no previous file with comments | « webkit/build/port/port.vcproj ('k') | webkit/glue/webkit_glue.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698