| OLD | NEW |
| 1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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/search_provider.h" | 5 #include "chrome/browser/autocomplete/search_provider.h" |
| 6 | 6 |
| 7 #include "base/message_loop.h" | 7 #include "base/message_loop.h" |
| 8 #include "base/string_util.h" | 8 #include "base/string_util.h" |
| 9 #include "chrome/browser/browser_process.h" | 9 #include "chrome/browser/browser_process.h" |
| 10 #include "chrome/browser/google_util.h" | 10 #include "chrome/browser/google_util.h" |
| 11 #include "chrome/browser/net/url_fixer_upper.h" | 11 #include "chrome/browser/net/url_fixer_upper.h" |
| 12 #include "chrome/browser/profile.h" | 12 #include "chrome/browser/profile.h" |
| 13 #include "chrome/browser/search_engines/template_url_model.h" | 13 #include "chrome/browser/search_engines/template_url_model.h" |
| 14 #include "chrome/common/json_value_serializer.h" | 14 #include "chrome/common/json_value_serializer.h" |
| 15 #include "chrome/common/l10n_util.h" | 15 #include "chrome/common/l10n_util.h" |
| 16 #include "chrome/common/pref_names.h" | 16 #include "chrome/common/pref_names.h" |
| 17 #include "chrome/common/pref_service.h" | 17 #include "chrome/common/pref_service.h" |
| 18 #include "googleurl/src/url_util.h" | 18 #include "googleurl/src/url_util.h" |
| 19 #include "net/base/escape.h" | 19 #include "net/base/escape.h" |
| 20 #include "net/http/http_response_headers.h" |
| 21 #include "net/url_request/url_request_status.h" |
| 20 | 22 |
| 21 #include "generated_resources.h" | 23 #include "generated_resources.h" |
| 22 | 24 |
| 23 using base::Time; | 25 using base::Time; |
| 24 using base::TimeDelta; | 26 using base::TimeDelta; |
| 25 | 27 |
| 26 const int SearchProvider::kQueryDelayMs = 200; | 28 const int SearchProvider::kQueryDelayMs = 200; |
| 27 | 29 |
| 28 void SearchProvider::Start(const AutocompleteInput& input, | 30 void SearchProvider::Start(const AutocompleteInput& input, |
| 29 bool minimal_changes) { | 31 bool minimal_changes) { |
| (...skipping 581 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 611 const size_t after_slashes = std::min(url->length(), | 613 const size_t after_slashes = std::min(url->length(), |
| 612 static_cast<size_t>(scheme.end() + 3)); | 614 static_cast<size_t>(scheme.end() + 3)); |
| 613 while ((prefix_len < after_slashes) && ((*url)[prefix_len] == L'/')) | 615 while ((prefix_len < after_slashes) && ((*url)[prefix_len] == L'/')) |
| 614 ++prefix_len; | 616 ++prefix_len; |
| 615 if (prefix_len == url->length()) | 617 if (prefix_len == url->length()) |
| 616 url->clear(); | 618 url->clear(); |
| 617 else | 619 else |
| 618 url->erase(url->begin(), url->begin() + prefix_len); | 620 url->erase(url->begin(), url->begin() + prefix_len); |
| 619 return prefix_len; | 621 return prefix_len; |
| 620 } | 622 } |
| OLD | NEW |