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

Unified Diff: chrome/browser/resources/pdf/navigator.js

Issue 2617663002: WIP: run clang-format-js on lots of things (Closed)
Patch Set: merge Created 3 years, 11 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: chrome/browser/resources/pdf/navigator.js
diff --git a/chrome/browser/resources/pdf/navigator.js b/chrome/browser/resources/pdf/navigator.js
index 15c4518e1280ddaf907b0ba757c968e369dbaab9..5396c0d1c84b5585268508c1b9b787cd3a9c9a45 100644
--- a/chrome/browser/resources/pdf/navigator.js
+++ b/chrome/browser/resources/pdf/navigator.js
@@ -178,10 +178,8 @@ Navigator.prototype = {
*/
isValidUrl_: function(url) {
// Make sure |url| starts with a valid scheme.
- if (!url.startsWith('http://') &&
- !url.startsWith('https://') &&
- !url.startsWith('ftp://') &&
- !url.startsWith('file://') &&
+ if (!url.startsWith('http://') && !url.startsWith('https://') &&
+ !url.startsWith('ftp://') && !url.startsWith('file://') &&
!url.startsWith('mailto:')) {
return false;
}
@@ -192,11 +190,8 @@ Navigator.prototype = {
// Make sure |url| is not only a scheme.
- if (url == 'http://' ||
- url == 'https://' ||
- url == 'ftp://' ||
- url == 'file://' ||
- url == 'mailto:') {
+ if (url == 'http://' || url == 'https://' || url == 'ftp://' ||
+ url == 'file://' || url == 'mailto:') {
return false;
}
@@ -225,8 +220,8 @@ Navigator.prototype = {
var schemeEndIndex = this.originalUrl_.indexOf('://');
var firstSlash = this.originalUrl_.indexOf('/', schemeEndIndex + 3);
// e.g. http://www.foo.com/bar -> http://www.foo.com
- var domain = firstSlash != -1 ?
- this.originalUrl_.substr(0, firstSlash) : this.originalUrl_;
+ var domain = firstSlash != -1 ? this.originalUrl_.substr(0, firstSlash) :
+ this.originalUrl_;
return domain + url;
}
@@ -244,7 +239,8 @@ Navigator.prototype = {
if (!isRelative) {
var domainSeparatorIndex = url.indexOf('/');
var domainName = domainSeparatorIndex == -1 ?
- url : url.substr(0, domainSeparatorIndex);
+ url :
+ url.substr(0, domainSeparatorIndex);
var domainDotCount = (domainName.match(/\./g) || []).length;
if (domainDotCount < 2)
isRelative = true;
@@ -252,8 +248,8 @@ Navigator.prototype = {
if (isRelative) {
var slashIndex = this.originalUrl_.lastIndexOf('/');
- var path = slashIndex != -1 ?
- this.originalUrl_.substr(0, slashIndex) : this.originalUrl_;
+ var path = slashIndex != -1 ? this.originalUrl_.substr(0, slashIndex) :
+ this.originalUrl_;
return path + '/' + url;
}
« no previous file with comments | « chrome/browser/resources/pdf/gesture_detector.js ('k') | chrome/browser/resources/pdf/open_pdf_params_parser.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698