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

Unified Diff: chrome/common/custom_handlers/protocol_handler.cc

Issue 267103002: Ignore title parameter for navigator.registerProtocolHandler. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix tests Created 6 years, 7 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
« no previous file with comments | « chrome/common/custom_handlers/protocol_handler.h ('k') | content/browser/web_contents/web_contents_impl.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/common/custom_handlers/protocol_handler.cc
diff --git a/chrome/common/custom_handlers/protocol_handler.cc b/chrome/common/custom_handlers/protocol_handler.cc
index 714feb117fcf1d5e3b267fecc168dc3b3384e345..9b0278889e95cb6c18cda6749548793954c6d39e 100644
--- a/chrome/common/custom_handlers/protocol_handler.cc
+++ b/chrome/common/custom_handlers/protocol_handler.cc
@@ -10,27 +10,24 @@
ProtocolHandler::ProtocolHandler(const std::string& protocol,
- const GURL& url,
- const base::string16& title)
+ const GURL& url)
: protocol_(protocol),
- url_(url),
- title_(title) {
+ url_(url) {
}
ProtocolHandler ProtocolHandler::CreateProtocolHandler(
const std::string& protocol,
- const GURL& url,
- const base::string16& title) {
+ const GURL& url) {
std::string lower_protocol = StringToLowerASCII(protocol);
- return ProtocolHandler(lower_protocol, url, title);
+ return ProtocolHandler(lower_protocol, url);
}
ProtocolHandler::ProtocolHandler() {
}
bool ProtocolHandler::IsValidDict(const base::DictionaryValue* value) {
- return value->HasKey("protocol") && value->HasKey("url") &&
- value->HasKey("title");
+ // Note that "title" parameter is ignored.
+ return value->HasKey("protocol") && value->HasKey("url");
}
bool ProtocolHandler::IsSameOrigin(
@@ -49,11 +46,9 @@ ProtocolHandler ProtocolHandler::CreateProtocolHandler(
return EmptyProtocolHandler();
}
std::string protocol, url;
- base::string16 title;
value->GetString("protocol", &protocol);
value->GetString("url", &url);
- value->GetString("title", &title);
- return ProtocolHandler::CreateProtocolHandler(protocol, GURL(url), title);
+ return ProtocolHandler::CreateProtocolHandler(protocol, GURL(url));
}
GURL ProtocolHandler::TranslateUrl(const GURL& url) const {
@@ -67,7 +62,6 @@ base::DictionaryValue* ProtocolHandler::Encode() const {
base::DictionaryValue* d = new base::DictionaryValue();
d->Set("protocol", new base::StringValue(protocol_));
d->Set("url", new base::StringValue(url_.spec()));
- d->Set("title", new base::StringValue(title_));
return d;
}
@@ -75,15 +69,12 @@ base::DictionaryValue* ProtocolHandler::Encode() const {
std::string ProtocolHandler::ToString() const {
return "{ protocol=" + protocol_ +
", url=" + url_.spec() +
- ", title=" + base::UTF16ToASCII(title_) +
" }";
}
#endif
bool ProtocolHandler::operator==(const ProtocolHandler& other) const {
- return protocol_ == other.protocol_ &&
- url_ == other.url_ &&
- title_ == other.title_;
+ return protocol_ == other.protocol_ && url_ == other.url_;
}
bool ProtocolHandler::IsEquivalent(const ProtocolHandler& other) const {
@@ -91,5 +82,5 @@ bool ProtocolHandler::IsEquivalent(const ProtocolHandler& other) const {
}
bool ProtocolHandler::operator<(const ProtocolHandler& other) const {
- return title_ < other.title_;
+ return url_ < other.url_;
}
« no previous file with comments | « chrome/common/custom_handlers/protocol_handler.h ('k') | content/browser/web_contents/web_contents_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698