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

Side by Side Diff: chrome/browser/autocomplete/autocomplete_input.cc

Issue 89243003: Move EmptyString, kWhitespace and the BOM to base. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « base/strings/string_util_constants.cc ('k') | chrome/browser/autocomplete/keyword_provider.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) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 #include "chrome/browser/autocomplete/autocomplete_input.h" 5 #include "chrome/browser/autocomplete/autocomplete_input.h"
6 6
7 #include "base/strings/string_util.h" 7 #include "base/strings/string_util.h"
8 #include "base/strings/utf_string_conversions.h" 8 #include "base/strings/utf_string_conversions.h"
9 #include "chrome/browser/external_protocol/external_protocol_handler.h" 9 #include "chrome/browser/external_protocol/external_protocol_handler.h"
10 #include "chrome/browser/profiles/profile_io_data.h" 10 #include "chrome/browser/profiles/profile_io_data.h"
(...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after
114 case FORCED_QUERY: return "forced-query"; 114 case FORCED_QUERY: return "forced-query";
115 115
116 default: 116 default:
117 NOTREACHED(); 117 NOTREACHED();
118 return std::string(); 118 return std::string();
119 } 119 }
120 } 120 }
121 121
122 // static 122 // static
123 AutocompleteInput::Type AutocompleteInput::Parse( 123 AutocompleteInput::Type AutocompleteInput::Parse(
124 const string16& text, 124 const base::string16& text,
125 const string16& desired_tld, 125 const base::string16& desired_tld,
126 url_parse::Parsed* parts, 126 url_parse::Parsed* parts,
127 string16* scheme, 127 base::string16* scheme,
128 GURL* canonicalized_url) { 128 GURL* canonicalized_url) {
129 const size_t first_non_white = text.find_first_not_of(kWhitespaceUTF16, 0); 129 size_t first_non_white = text.find_first_not_of(base::kWhitespaceUTF16, 0);
130 if (first_non_white == string16::npos) 130 if (first_non_white == string16::npos)
131 return INVALID; // All whitespace. 131 return INVALID; // All whitespace.
132 132
133 if (text.at(first_non_white) == L'?') { 133 if (text.at(first_non_white) == L'?') {
134 // If the first non-whitespace character is a '?', we magically treat this 134 // If the first non-whitespace character is a '?', we magically treat this
135 // as a query. 135 // as a query.
136 return FORCED_QUERY; 136 return FORCED_QUERY;
137 } 137 }
138 138
139 // Ask our parsing back-end to help us understand what the user typed. We 139 // Ask our parsing back-end to help us understand what the user typed. We
(...skipping 385 matching lines...) Expand 10 before | Expand all | Expand 10 after
525 current_page_classification_ = AutocompleteInput::INVALID_SPEC; 525 current_page_classification_ = AutocompleteInput::INVALID_SPEC;
526 type_ = INVALID; 526 type_ = INVALID;
527 parts_ = url_parse::Parsed(); 527 parts_ = url_parse::Parsed();
528 scheme_.clear(); 528 scheme_.clear();
529 canonicalized_url_ = GURL(); 529 canonicalized_url_ = GURL();
530 prevent_inline_autocomplete_ = false; 530 prevent_inline_autocomplete_ = false;
531 prefer_keyword_ = false; 531 prefer_keyword_ = false;
532 allow_exact_keyword_match_ = false; 532 allow_exact_keyword_match_ = false;
533 matches_requested_ = ALL_MATCHES; 533 matches_requested_ = ALL_MATCHES;
534 } 534 }
OLDNEW
« no previous file with comments | « base/strings/string_util_constants.cc ('k') | chrome/browser/autocomplete/keyword_provider.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698