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

Side by Side Diff: chrome/browser/search/search.cc

Issue 13145003: Rewrite std::string("") to std::string(), Linux edition. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Ugh Created 7 years, 8 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 | Annotate | Revision Log
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « chrome/browser/search/local_omnibox_popup_source.cc ('k') | chrome/browser/search/search_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698