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

Side by Side Diff: chrome/browser/net/url_fixer_upper.h

Issue 7064052: Revert 88142 to fix sync_integration_tests offline. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 9 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « chrome/browser/history/history.cc ('k') | chrome/browser/net/url_fixer_upper.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef CHROME_BROWSER_NET_URL_FIXER_UPPER_H_ 5 #ifndef CHROME_BROWSER_NET_URL_FIXER_UPPER_H_
6 #define CHROME_BROWSER_NET_URL_FIXER_UPPER_H_ 6 #define CHROME_BROWSER_NET_URL_FIXER_UPPER_H_
7 #pragma once 7 #pragma once
8 8
9 #include <string> 9 #include <string>
10 10
11 #include "base/string16.h" 11 #include "base/string16.h"
(...skipping 22 matching lines...) Expand all
34 34
35 // Converts |text| to a fixed-up URL and returns it. Attempts to make 35 // Converts |text| to a fixed-up URL and returns it. Attempts to make
36 // some "smart" adjustments to obviously-invalid input where possible. 36 // some "smart" adjustments to obviously-invalid input where possible.
37 // |text| may be an absolute path to a file, which will get converted to a 37 // |text| may be an absolute path to a file, which will get converted to a
38 // "file:" URL. 38 // "file:" URL.
39 // 39 //
40 // The result will be a "more" valid URL than the input. It may still not 40 // The result will be a "more" valid URL than the input. It may still not
41 // be valid, so check the return value's validity or use 41 // be valid, so check the return value's validity or use
42 // possibly_invalid_spec(). 42 // possibly_invalid_spec().
43 // 43 //
44 // Schemes "about" and "chrome" are normalized to "chrome://", with slashes.
45 // "about:blank" is unaltered, as Webkit allows frames to access about:blank.
46 // Additionally, if a chrome URL does not have a valid host, as in "about:",
47 // the returned URL will have the host "version", as in "chrome://version".
48 //
49 // If |desired_tld| is non-empty, it represents the TLD the user wishes to 44 // If |desired_tld| is non-empty, it represents the TLD the user wishes to
50 // append in the case of an incomplete domain. We check that this is not a 45 // append in the case of an incomplete domain. We check that this is not a
51 // file path and there does not appear to be a valid TLD already, then append 46 // file path and there does not appear to be a valid TLD already, then append
52 // |desired_tld| to the domain and prepend "www." (unless it, or a scheme, 47 // |desired_tld| to the domain and prepend "www." (unless it, or a scheme,
53 // are already present.) This TLD should not have a leading '.' (use "com" 48 // are already present.) This TLD should not have a leading '.' (use "com"
54 // instead of ".com"). 49 // instead of ".com").
55 GURL FixupURL(const std::string& text, const std::string& desired_tld); 50 GURL FixupURL(const std::string& text, const std::string& desired_tld);
56 51
57 // Converts |text| to a fixed-up URL, allowing it to be a relative path on 52 // Converts |text| to a fixed-up URL, allowing it to be a relative path on
58 // the local filesystem. Begin searching in |base_dir|; if empty, use the 53 // the local filesystem. Begin searching in |base_dir|; if empty, use the
(...skipping 14 matching lines...) Expand all
73 // Does nothing if |part| is invalid. 68 // Does nothing if |part| is invalid.
74 void OffsetComponent(int offset, url_parse::Component* part); 69 void OffsetComponent(int offset, url_parse::Component* part);
75 70
76 // For paths like ~, we use $HOME for the current user's home 71 // For paths like ~, we use $HOME for the current user's home
77 // directory. For tests, we allow our idea of $HOME to be overriden 72 // directory. For tests, we allow our idea of $HOME to be overriden
78 // by this variable. 73 // by this variable.
79 extern const char* home_directory_override; 74 extern const char* home_directory_override;
80 }; 75 };
81 76
82 #endif // CHROME_BROWSER_NET_URL_FIXER_UPPER_H_ 77 #endif // CHROME_BROWSER_NET_URL_FIXER_UPPER_H_
OLDNEW
« no previous file with comments | « chrome/browser/history/history.cc ('k') | chrome/browser/net/url_fixer_upper.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698