OLD | NEW |
1 // Copyright 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 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/search/search.h" | 5 #include "chrome/browser/search/search.h" |
6 | 6 |
7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
8 #include "base/metrics/field_trial.h" | 8 #include "base/metrics/field_trial.h" |
9 #include "base/metrics/histogram.h" | 9 #include "base/metrics/histogram.h" |
10 #include "base/prefs/pref_service.h" | 10 #include "base/prefs/pref_service.h" |
(...skipping 509 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
520 } | 520 } |
521 return default_value; | 521 return default_value; |
522 } | 522 } |
523 | 523 |
524 // Given a FieldTrialFlags object, returns the uint64 value of the provided | 524 // Given a FieldTrialFlags object, returns the uint64 value of the provided |
525 // flag. | 525 // flag. |
526 uint64 GetUInt64ValueForFlagWithDefault(const std::string& flag, | 526 uint64 GetUInt64ValueForFlagWithDefault(const std::string& flag, |
527 uint64 default_value, | 527 uint64 default_value, |
528 const FieldTrialFlags& flags) { | 528 const FieldTrialFlags& flags) { |
529 uint64 value; | 529 uint64 value; |
530 std::string str_value = GetStringValueForFlagWithDefault(flag, "", flags); | 530 std::string str_value = |
| 531 GetStringValueForFlagWithDefault(flag, std::string(), flags); |
531 if (base::StringToUint64(str_value, &value)) | 532 if (base::StringToUint64(str_value, &value)) |
532 return value; | 533 return value; |
533 return default_value; | 534 return default_value; |
534 } | 535 } |
535 | 536 |
536 // Given a FieldTrialFlags object, returns the boolean value of the provided | 537 // Given a FieldTrialFlags object, returns the boolean value of the provided |
537 // flag. | 538 // flag. |
538 bool GetBoolValueForFlagWithDefault(const std::string& flag, | 539 bool GetBoolValueForFlagWithDefault(const std::string& flag, |
539 bool default_value, | 540 bool default_value, |
540 const FieldTrialFlags& flags) { | 541 const FieldTrialFlags& flags) { |
(...skipping 19 matching lines...) Expand all Loading... |
560 replacements.SetHostStr(search_host); | 561 replacements.SetHostStr(search_host); |
561 replacements.SetPortStr(search_port); | 562 replacements.SetPortStr(search_port); |
562 return instant_url.ReplaceComponents(replacements); | 563 return instant_url.ReplaceComponents(replacements); |
563 } | 564 } |
564 | 565 |
565 bool MatchesOriginAndPath(const GURL& my_url, const GURL& other_url) { | 566 bool MatchesOriginAndPath(const GURL& my_url, const GURL& other_url) { |
566 return MatchesOrigin(my_url, other_url) && my_url.path() == other_url.path(); | 567 return MatchesOrigin(my_url, other_url) && my_url.path() == other_url.path(); |
567 } | 568 } |
568 | 569 |
569 } // namespace chrome | 570 } // namespace chrome |
OLD | NEW |