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

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

Issue 6256010: Revert 72380 - Remove wstring from autocomplete.... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 9 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « chrome/browser/instant/instant_browsertest.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')
Property Changes:
Added: svn:mergeinfo
OLDNEW
1 // Copyright (c) 2010 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"
12 #include "googleurl/src/gurl.h" 11 #include "googleurl/src/gurl.h"
13 12
14 namespace url_parse { 13 namespace url_parse {
15 struct Component; 14 struct Component;
16 struct Parsed; 15 struct Parsed;
17 } 16 }
18 17
19 class FilePath; 18 class FilePath;
20 19
21 // This object is designed to convert various types of input into URLs that we 20 // This object is designed to convert various types of input into URLs that we
22 // know are valid. For example, user typing in the URL bar or command line 21 // know are valid. For example, user typing in the URL bar or command line
23 // options. This is NOT the place for converting between different types of 22 // options. This is NOT the place for converting between different types of
24 // URLs or parsing them, see net_util.h for that. 23 // URLs or parsing them, see net_util.h for that.
25 namespace URLFixerUpper { 24 namespace URLFixerUpper {
26 25
27 // Segments the given text string into parts of a URL. This is most useful 26 // Segments the given text string into parts of a URL. This is most useful
28 // for schemes such as http, https, and ftp where |SegmentURL| will find many 27 // for schemes such as http, https, and ftp where |SegmentURL| will find many
29 // segments. Currently does not segment "file" schemes. 28 // segments. Currently does not segment "file" schemes.
30 // Returns the canonicalized scheme, or the empty string when |text| is only 29 // Returns the canonicalized scheme, or the empty string when |text| is only
31 // whitespace. 30 // whitespace.
32 std::string SegmentURL(const std::string& text, url_parse::Parsed* parts); 31 std::string SegmentURL(const std::string& text, url_parse::Parsed* parts);
33 // Deprecated temporary compatibility functions. 32 // Deprecated temporary compatibility function.
34 std::wstring SegmentURL(const std::wstring& text, url_parse::Parsed* parts); 33 std::wstring SegmentURL(const std::wstring& text, url_parse::Parsed* parts);
35 #if defined(WCHAR_T_IS_UTF32)
36 string16 SegmentURL(const string16& text, url_parse::Parsed* parts);
37 #endif
38 34
39 // 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
40 // some "smart" adjustments to obviously-invalid input where possible. 36 // some "smart" adjustments to obviously-invalid input where possible.
41 // |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
42 // "file:" URL. 38 // "file:" URL.
43 // 39 //
44 // 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
45 // be valid, so check the return value's validity or use 41 // be valid, so check the return value's validity or use
46 // possibly_invalid_spec(). 42 // possibly_invalid_spec().
47 // 43 //
(...skipping 27 matching lines...) Expand all
75 // Does nothing if |part| is invalid. 71 // Does nothing if |part| is invalid.
76 void OffsetComponent(int offset, url_parse::Component* part); 72 void OffsetComponent(int offset, url_parse::Component* part);
77 73
78 // For paths like ~, we use $HOME for the current user's home 74 // For paths like ~, we use $HOME for the current user's home
79 // directory. For tests, we allow our idea of $HOME to be overriden 75 // directory. For tests, we allow our idea of $HOME to be overriden
80 // by this variable. 76 // by this variable.
81 extern const char* home_directory_override; 77 extern const char* home_directory_override;
82 }; 78 };
83 79
84 #endif // CHROME_BROWSER_NET_URL_FIXER_UPPER_H_ 80 #endif // CHROME_BROWSER_NET_URL_FIXER_UPPER_H_
OLDNEW
« no previous file with comments | « chrome/browser/instant/instant_browsertest.cc ('k') | chrome/browser/net/url_fixer_upper.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698