| OLD | NEW |
| 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/util.h" | 5 #include "components/search_engines/util.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include <map> | 10 #include <map> |
| 11 #include <set> | 11 #include <set> |
| 12 #include <string> | 12 #include <string> |
| 13 #include <vector> | 13 #include <vector> |
| 14 | 14 |
| 15 #include "base/logging.h" | 15 #include "base/logging.h" |
| 16 #include "base/memory/scoped_vector.h" | 16 #include "base/memory/scoped_vector.h" |
| 17 #include "base/prefs/pref_service.h" | |
| 18 #include "base/time/time.h" | 17 #include "base/time/time.h" |
| 18 #include "components/prefs/pref_service.h" |
| 19 #include "components/search_engines/template_url.h" | 19 #include "components/search_engines/template_url.h" |
| 20 #include "components/search_engines/template_url_prepopulate_data.h" | 20 #include "components/search_engines/template_url_prepopulate_data.h" |
| 21 #include "components/search_engines/template_url_service.h" | 21 #include "components/search_engines/template_url_service.h" |
| 22 | 22 |
| 23 base::string16 GetDefaultSearchEngineName(TemplateURLService* service) { | 23 base::string16 GetDefaultSearchEngineName(TemplateURLService* service) { |
| 24 DCHECK(service); | 24 DCHECK(service); |
| 25 const TemplateURL* const default_provider = | 25 const TemplateURL* const default_provider = |
| 26 service->GetDefaultSearchProvider(); | 26 service->GetDefaultSearchProvider(); |
| 27 if (!default_provider) { | 27 if (!default_provider) { |
| 28 // TODO(cpu): bug 1187517. It is possible to have no default provider. | 28 // TODO(cpu): bug 1187517. It is possible to have no default provider. |
| (...skipping 354 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 383 std::vector<std::string> deduped_encodings; | 383 std::vector<std::string> deduped_encodings; |
| 384 std::set<std::string> encoding_set; | 384 std::set<std::string> encoding_set; |
| 385 for (std::vector<std::string>::const_iterator i(encodings->begin()); | 385 for (std::vector<std::string>::const_iterator i(encodings->begin()); |
| 386 i != encodings->end(); ++i) { | 386 i != encodings->end(); ++i) { |
| 387 if (encoding_set.insert(*i).second) | 387 if (encoding_set.insert(*i).second) |
| 388 deduped_encodings.push_back(*i); | 388 deduped_encodings.push_back(*i); |
| 389 } | 389 } |
| 390 encodings->swap(deduped_encodings); | 390 encodings->swap(deduped_encodings); |
| 391 return encodings->size() != deduped_encodings.size(); | 391 return encodings->size() != deduped_encodings.size(); |
| 392 } | 392 } |
| OLD | NEW |