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

Side by Side Diff: components/search_engines/template_url.cc

Issue 1394183005: Fix review nits that were missed from https://crrev.com/d7241e515462c10b29a0470c3c3df647ae34be4b. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 2 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
« no previous file with comments | « no previous file | components/url_formatter/url_formatter.h » ('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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 "components/search_engines/template_url.h" 5 #include "components/search_engines/template_url.h"
6 6
7 #include <string> 7 #include <string>
8 #include <vector> 8 #include <vector>
9 9
10 #include "base/basictypes.h" 10 #include "base/basictypes.h"
(...skipping 11 matching lines...) Expand all
22 #include "base/strings/stringprintf.h" 22 #include "base/strings/stringprintf.h"
23 #include "base/strings/utf_string_conversions.h" 23 #include "base/strings/utf_string_conversions.h"
24 #include "components/google/core/browser/google_util.h" 24 #include "components/google/core/browser/google_util.h"
25 #include "components/metrics/proto/omnibox_input_type.pb.h" 25 #include "components/metrics/proto/omnibox_input_type.pb.h"
26 #include "components/search_engines/search_engines_switches.h" 26 #include "components/search_engines/search_engines_switches.h"
27 #include "components/search_engines/search_terms_data.h" 27 #include "components/search_engines/search_terms_data.h"
28 #include "components/url_formatter/url_formatter.h" 28 #include "components/url_formatter/url_formatter.h"
29 #include "google_apis/google_api_keys.h" 29 #include "google_apis/google_api_keys.h"
30 #include "net/base/escape.h" 30 #include "net/base/escape.h"
31 #include "net/base/mime_util.h" 31 #include "net/base/mime_util.h"
32 #include "net/base/net_util.h"
33 #include "ui/base/device_form_factor.h" 32 #include "ui/base/device_form_factor.h"
34 #include "url/gurl.h" 33 #include "url/gurl.h"
35 34
36 namespace { 35 namespace {
37 36
38 // The TemplateURLRef has any number of terms that need to be replaced. Each of 37 // The TemplateURLRef has any number of terms that need to be replaced. Each of
39 // the terms is enclosed in braces. If the character preceeding the final 38 // the terms is enclosed in braces. If the character preceeding the final
40 // brace is a ?, it indicates the term is optional and can be replaced with 39 // brace is a ?, it indicates the term is optional and can be replaced with
41 // an empty string. 40 // an empty string.
42 const char kStartParameter = '{'; 41 const char kStartParameter = '{';
(...skipping 1471 matching lines...) Expand 10 before | Expand all | Expand 10 after
1514 // patterns. This means that given patterns 1513 // patterns. This means that given patterns
1515 // [ "http://foo/#q={searchTerms}", "http://foo/?q={searchTerms}" ], 1514 // [ "http://foo/#q={searchTerms}", "http://foo/?q={searchTerms}" ],
1516 // calling ExtractSearchTermsFromURL() on "http://foo/?q=bar#q=' would 1515 // calling ExtractSearchTermsFromURL() on "http://foo/?q=bar#q=' would
1517 // return false. This is important for at least Google, where such URLs 1516 // return false. This is important for at least Google, where such URLs
1518 // are invalid. 1517 // are invalid.
1519 return !search_terms->empty(); 1518 return !search_terms->empty();
1520 } 1519 }
1521 } 1520 }
1522 return false; 1521 return false;
1523 } 1522 }
OLDNEW
« no previous file with comments | « no previous file | components/url_formatter/url_formatter.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698