summaryrefslogtreecommitdiffstats
path: root/chrome/browser/autocomplete
diff options
context:
space:
mode:
authorpkasting@chromium.org <pkasting@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-05-26 23:11:09 +0000
committerpkasting@chromium.org <pkasting@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-05-26 23:11:09 +0000
commit37b9573895ec9de786231492344690adc4b31ed9 (patch)
treea95119dfadb5be2098d762b6c28d3c903177f2bb /chrome/browser/autocomplete
parent652da74bb34f4e59f0695bda0b88f948e4805070 (diff)
downloadchromium_src-37b9573895ec9de786231492344690adc4b31ed9.zip
chromium_src-37b9573895ec9de786231492344690adc4b31ed9.tar.gz
chromium_src-37b9573895ec9de786231492344690adc4b31ed9.tar.bz2
Misc. cleanup: Change use of string::size_type to size_t (team style), string::size() to string::length() (omnibox code style), and some rewrapping.
BUG=none TEST=none Review URL: http://codereview.chromium.org/7075020 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@86922 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/autocomplete')
-rw-r--r--chrome/browser/autocomplete/autocomplete.cc7
-rw-r--r--chrome/browser/autocomplete/autocomplete_edit.cc6
-rw-r--r--chrome/browser/autocomplete/autocomplete_edit_unittest.cc3
-rw-r--r--chrome/browser/autocomplete/autocomplete_match.cc2
-rw-r--r--chrome/browser/autocomplete/autocomplete_popup_view_gtk.cc10
-rw-r--r--chrome/browser/autocomplete/autocomplete_popup_view_gtk_unittest.cc155
-rw-r--r--chrome/browser/autocomplete/autocomplete_popup_view_mac.mm4
-rw-r--r--chrome/browser/autocomplete/history_contents_provider.cc2
-rw-r--r--chrome/browser/autocomplete/history_provider.cc2
-rw-r--r--chrome/browser/autocomplete/history_quick_provider.cc10
-rw-r--r--chrome/browser/autocomplete/history_quick_provider_unittest.cc4
-rw-r--r--chrome/browser/autocomplete/history_url_provider.cc11
-rw-r--r--chrome/browser/autocomplete/history_url_provider.h2
-rw-r--r--chrome/browser/autocomplete/search_provider_unittest.cc6
14 files changed, 89 insertions, 135 deletions
diff --git a/chrome/browser/autocomplete/autocomplete.cc b/chrome/browser/autocomplete/autocomplete.cc
index 1f0305c..9fe2688 100644
--- a/chrome/browser/autocomplete/autocomplete.cc
+++ b/chrome/browser/autocomplete/autocomplete.cc
@@ -220,7 +220,7 @@ AutocompleteInput::Type AutocompleteInput::Parse(
};
for (size_t i = 0; i < arraysize(components); ++i) {
URLFixerUpper::OffsetComponent(
- -static_cast<int>(http_scheme_prefix.size()), components[i]);
+ -static_cast<int>(http_scheme_prefix.length()), components[i]);
}
*parts = http_parts;
@@ -862,9 +862,10 @@ void AutocompleteController::Start(
if (matches_requested != AutocompleteInput::ALL_MATCHES)
DCHECK((*i)->done());
}
- if (matches_requested == AutocompleteInput::ALL_MATCHES && text.size() < 6) {
+ if (matches_requested == AutocompleteInput::ALL_MATCHES &&
+ (text.length() < 6)) {
base::TimeTicks end_time = base::TimeTicks::Now();
- std::string name = "Omnibox.QueryTime." + base::IntToString(text.size());
+ std::string name = "Omnibox.QueryTime." + base::IntToString(text.length());
base::Histogram* counter = base::Histogram::FactoryGet(
name, 1, 1000, 50, base::Histogram::kUmaTargetedHistogramFlag);
counter->Add(static_cast<int>((end_time - start_time).InMilliseconds()));
diff --git a/chrome/browser/autocomplete/autocomplete_edit.cc b/chrome/browser/autocomplete/autocomplete_edit.cc
index ce388ac..5d01e79 100644
--- a/chrome/browser/autocomplete/autocomplete_edit.cc
+++ b/chrome/browser/autocomplete/autocomplete_edit.cc
@@ -276,9 +276,9 @@ bool AutocompleteEditModel::UseVerbatimInstant() {
just_deleted_text_)
return true;
- string16::size_type start, end;
+ size_t start, end;
view_->GetSelectionBounds(&start, &end);
- return (start != end) || (start != view_->GetText().size());
+ return (start != end) || (start != view_->GetText().length());
}
string16 AutocompleteEditModel::GetDesiredTLD() const {
@@ -513,7 +513,7 @@ void AutocompleteEditModel::OpenMatch(const AutocompleteMatch& match,
current_match : result().match_at(index);
// Strip the keyword + leading space off the input.
- size_t prefix_length = match.template_url->keyword().size() + 1;
+ size_t prefix_length = match.template_url->keyword().length() + 1;
ExtensionOmniboxEventRouter::OnInputEntered(
profile_, match.template_url->GetExtensionId(),
UTF16ToUTF8(match.fill_into_edit.substr(prefix_length)));
diff --git a/chrome/browser/autocomplete/autocomplete_edit_unittest.cc b/chrome/browser/autocomplete/autocomplete_edit_unittest.cc
index 423a230..d921302 100644
--- a/chrome/browser/autocomplete/autocomplete_edit_unittest.cc
+++ b/chrome/browser/autocomplete/autocomplete_edit_unittest.cc
@@ -37,8 +37,7 @@ class TestingOmniboxView : public OmniboxView {
virtual void SetForcedQuery() {}
virtual bool IsSelectAll() { return false; }
virtual bool DeleteAtEndPressed() { return false; }
- virtual void GetSelectionBounds(string16::size_type* start,
- string16::size_type* end) {}
+ virtual void GetSelectionBounds(size_t* start, size_t* end) {}
virtual void SelectAll(bool reversed) {}
virtual void RevertAll() {}
virtual void UpdatePopup() {}
diff --git a/chrome/browser/autocomplete/autocomplete_match.cc b/chrome/browser/autocomplete/autocomplete_match.cc
index 59fa925..3d09a35 100644
--- a/chrome/browser/autocomplete/autocomplete_match.cc
+++ b/chrome/browser/autocomplete/autocomplete_match.cc
@@ -164,7 +164,7 @@ void AutocompleteMatch::ValidateClassifications(
const string16& text,
const ACMatchClassifications& classifications) const {
if (text.empty()) {
- DCHECK(classifications.size() == 0);
+ DCHECK(classifications.empty());
return;
}
diff --git a/chrome/browser/autocomplete/autocomplete_popup_view_gtk.cc b/chrome/browser/autocomplete/autocomplete_popup_view_gtk.cc
index ffeff16..7602046 100644
--- a/chrome/browser/autocomplete/autocomplete_popup_view_gtk.cc
+++ b/chrome/browser/autocomplete/autocomplete_popup_view_gtk.cc
@@ -112,7 +112,7 @@ void DrawFullPixbuf(GdkDrawable* drawable, GdkGC* gc, GdkPixbuf* pixbuf,
// TODO(deanm): Find some better home for this, and make it more efficient.
size_t GetUTF8Offset(const string16& text, size_t text_offset) {
- return UTF16ToUTF8(text.substr(0, text_offset)).size();
+ return UTF16ToUTF8(text.substr(0, text_offset)).length();
}
// Generates the normal URL color, a green color used in unhighlighted URL
@@ -193,7 +193,7 @@ void AutocompletePopupViewGtk::SetupLayoutForMatch(
// spiral that can corrupt the screen. Assume that we'll never have more than
// 2000 characters, which should be a safe assumption until we all get robot
// eyes. http://crbug.com/66576
- if (localized_text.size() > 2000)
+ if (localized_text.length() > 2000)
localized_text = localized_text.substr(0, 2000);
bool is_rtl = base::i18n::IsRTL();
if (is_rtl && !base::i18n::StringContainsStrongRTLChars(localized_text)) {
@@ -204,7 +204,7 @@ void AutocompletePopupViewGtk::SetupLayoutForMatch(
// We can have a prefix, or insert additional characters while processing the
// classifications. We need to take this in to account when we translate the
// UTF-16 offsets in the classification into text_utf8 byte offsets.
- size_t additional_offset = prefix_text.size(); // Length in utf-8 bytes.
+ size_t additional_offset = prefix_text.length(); // Length in utf-8 bytes.
std::string text_utf8 = prefix_text + UTF16ToUTF8(localized_text);
PangoAttrList* attrs = pango_attr_list_new();
@@ -241,7 +241,7 @@ void AutocompletePopupViewGtk::SetupLayoutForMatch(
if (is_rtl && !marked_with_lre) {
std::string lre(kLRE);
text_utf8.insert(offset, lre);
- additional_offset += lre.size();
+ additional_offset += lre.length();
}
}
@@ -261,7 +261,7 @@ void AutocompletePopupViewGtk::SetupLayoutForMatch(
pango_attr_list_insert(attrs, weight_attr); // Ownership taken.
}
- pango_layout_set_text(layout, text_utf8.data(), text_utf8.size());
+ pango_layout_set_text(layout, text_utf8.data(), text_utf8.length());
pango_layout_set_attributes(layout, attrs); // Ref taken.
pango_attr_list_unref(attrs);
}
diff --git a/chrome/browser/autocomplete/autocomplete_popup_view_gtk_unittest.cc b/chrome/browser/autocomplete/autocomplete_popup_view_gtk_unittest.cc
index 3be69e5..cebfc8e 100644
--- a/chrome/browser/autocomplete/autocomplete_popup_view_gtk_unittest.cc
+++ b/chrome/browser/autocomplete/autocomplete_popup_view_gtk_unittest.cc
@@ -200,25 +200,18 @@ TEST_F(AutocompletePopupViewGtkTest, DecorateMatchedStringNoMatch) {
&kURLTextColor,
std::string());
- EXPECT_EQ(kContents.size(),
- RunLengthForAttrType(0U,
- kContents.size(),
- PANGO_ATTR_FOREGROUND));
+ EXPECT_EQ(kContents.length(), RunLengthForAttrType(0U, kContents.length(),
+ PANGO_ATTR_FOREGROUND));
- EXPECT_TRUE(RunHasColor(0U,
- kContents.size(),
- kContentTextColor));
+ EXPECT_TRUE(RunHasColor(0U, kContents.length(), kContentTextColor));
// This part's a little wacky - either we don't have a weight, or
// the weight run is the entire string and is NORMAL
- guint weightLength = RunLengthForAttrType(0U,
- kContents.size(),
+ guint weightLength = RunLengthForAttrType(0U, kContents.length(),
PANGO_ATTR_WEIGHT);
if (weightLength) {
- EXPECT_EQ(kContents.size(), weightLength);
- EXPECT_TRUE(RunHasWeight(0U,
- kContents.size(),
- PANGO_WEIGHT_NORMAL));
+ EXPECT_EQ(kContents.length(), weightLength);
+ EXPECT_TRUE(RunHasWeight(0U, kContents.length(), PANGO_WEIGHT_NORMAL));
}
}
@@ -238,24 +231,17 @@ TEST_F(AutocompletePopupViewGtkTest, DecorateMatchedStringURLNoMatch) {
&kURLTextColor,
std::string());
- EXPECT_EQ(kContents.size(),
- RunLengthForAttrType(0U,
- kContents.size(),
- PANGO_ATTR_FOREGROUND));
- EXPECT_TRUE(RunHasColor(0U,
- kContents.size(),
- kURLTextColor));
+ EXPECT_EQ(kContents.length(), RunLengthForAttrType(0U, kContents.length(),
+ PANGO_ATTR_FOREGROUND));
+ EXPECT_TRUE(RunHasColor(0U, kContents.length(), kURLTextColor));
// This part's a little wacky - either we don't have a weight, or
// the weight run is the entire string and is NORMAL
- guint weightLength = RunLengthForAttrType(0U,
- kContents.size(),
+ guint weightLength = RunLengthForAttrType(0U, kContents.length(),
PANGO_ATTR_WEIGHT);
if (weightLength) {
- EXPECT_EQ(kContents.size(), weightLength);
- EXPECT_TRUE(RunHasWeight(0U,
- kContents.size(),
- PANGO_WEIGHT_NORMAL));
+ EXPECT_EQ(kContents.length(), weightLength);
+ EXPECT_TRUE(RunHasWeight(0U, kContents.length(), PANGO_WEIGHT_NORMAL));
}
}
@@ -263,18 +249,18 @@ TEST_F(AutocompletePopupViewGtkTest, DecorateMatchedStringURLNoMatch) {
TEST_F(AutocompletePopupViewGtkTest, DecorateMatchedStringDimNoMatch) {
const string16 kContents = ASCIIToUTF16("This is a test");
// Dim "is".
- const guint runLength1 = 5, runLength2 = 2, runLength3 = 7;
+ const guint kRunLength1 = 5, kRunLength2 = 2, kRunLength3 = 7;
// Make sure nobody messed up the inputs.
- EXPECT_EQ(runLength1 + runLength2 + runLength3, kContents.size());
+ EXPECT_EQ(kRunLength1 + kRunLength2 + kRunLength3, kContents.length());
// Push each run onto classifications.
AutocompleteMatch::ACMatchClassifications classifications;
classifications.push_back(
ACMatchClassification(0U, ACMatchClassification::NONE));
classifications.push_back(
- ACMatchClassification(runLength1, ACMatchClassification::DIM));
+ ACMatchClassification(kRunLength1, ACMatchClassification::DIM));
classifications.push_back(
- ACMatchClassification(runLength1 + runLength2,
+ ACMatchClassification(kRunLength1 + kRunLength2,
ACMatchClassification::NONE));
SetupLayoutForMatch(kContents,
@@ -285,38 +271,26 @@ TEST_F(AutocompletePopupViewGtkTest, DecorateMatchedStringDimNoMatch) {
std::string());
// Check the runs have expected color and length.
- EXPECT_EQ(runLength1,
- RunLengthForAttrType(0U,
- kContents.size(),
- PANGO_ATTR_FOREGROUND));
- EXPECT_TRUE(RunHasColor(0U,
- kContents.size(),
- kContentTextColor));
- EXPECT_EQ(runLength2,
- RunLengthForAttrType(runLength1,
- kContents.size(),
- PANGO_ATTR_FOREGROUND));
- EXPECT_TRUE(RunHasColor(runLength1,
- kContents.size(),
+ EXPECT_EQ(kRunLength1, RunLengthForAttrType(0U, kContents.length(),
+ PANGO_ATTR_FOREGROUND));
+ EXPECT_TRUE(RunHasColor(0U, kContents.length(), kContentTextColor));
+ EXPECT_EQ(kRunLength2, RunLengthForAttrType(kRunLength1, kContents.length(),
+ PANGO_ATTR_FOREGROUND));
+ EXPECT_TRUE(RunHasColor(kRunLength1, kContents.length(),
kDimContentTextColor));
- EXPECT_EQ(runLength3,
- RunLengthForAttrType(runLength1 + runLength2,
- kContents.size(),
- PANGO_ATTR_FOREGROUND));
- EXPECT_TRUE(RunHasColor(runLength1 + runLength2,
- kContents.size(),
+ EXPECT_EQ(kRunLength3, RunLengthForAttrType(kRunLength1 + kRunLength2,
+ kContents.length(),
+ PANGO_ATTR_FOREGROUND));
+ EXPECT_TRUE(RunHasColor(kRunLength1 + kRunLength2, kContents.length(),
kContentTextColor));
// This part's a little wacky - either we don't have a weight, or
// the weight run is the entire string and is NORMAL
- guint weightLength = RunLengthForAttrType(0U,
- kContents.size(),
- PANGO_ATTR_WEIGHT);
+ guint weightLength = RunLengthForAttrType(0U, kContents.length(),
+ PANGO_ATTR_WEIGHT);
if (weightLength) {
- EXPECT_EQ(kContents.size(), weightLength);
- EXPECT_TRUE(RunHasWeight(0U,
- kContents.size(),
- PANGO_WEIGHT_NORMAL));
+ EXPECT_EQ(kContents.length(), weightLength);
+ EXPECT_TRUE(RunHasWeight(0U, kContents.length(), PANGO_WEIGHT_NORMAL));
}
}
@@ -325,18 +299,18 @@ TEST_F(AutocompletePopupViewGtkTest, DecorateMatchedStringDimNoMatch) {
TEST_F(AutocompletePopupViewGtkTest, DecorateMatchedStringMatch) {
const string16 kContents = ASCIIToUTF16("This is a test");
// Match "is".
- const guint runLength1 = 5, runLength2 = 2, runLength3 = 7;
+ const guint kRunLength1 = 5, kRunLength2 = 2, kRunLength3 = 7;
// Make sure nobody messed up the inputs.
- EXPECT_EQ(runLength1 + runLength2 + runLength3, kContents.size());
+ EXPECT_EQ(kRunLength1 + kRunLength2 + kRunLength3, kContents.length());
// Push each run onto classifications.
AutocompleteMatch::ACMatchClassifications classifications;
classifications.push_back(
ACMatchClassification(0U, ACMatchClassification::NONE));
classifications.push_back(
- ACMatchClassification(runLength1, ACMatchClassification::MATCH));
+ ACMatchClassification(kRunLength1, ACMatchClassification::MATCH));
classifications.push_back(
- ACMatchClassification(runLength1 + runLength2,
+ ACMatchClassification(kRunLength1 + kRunLength2,
ACMatchClassification::NONE));
SetupLayoutForMatch(kContents,
@@ -347,45 +321,31 @@ TEST_F(AutocompletePopupViewGtkTest, DecorateMatchedStringMatch) {
std::string());
// Check the runs have expected weight and length.
- EXPECT_EQ(runLength1,
- RunLengthForAttrType(0U,
- kContents.size(),
- PANGO_ATTR_WEIGHT));
- EXPECT_TRUE(RunHasWeight(0U,
- kContents.size(),
- PANGO_WEIGHT_NORMAL));
- EXPECT_EQ(runLength2,
- RunLengthForAttrType(runLength1,
- kContents.size(),
- PANGO_ATTR_WEIGHT));
- EXPECT_TRUE(RunHasWeight(runLength1,
- kContents.size(),
- PANGO_WEIGHT_BOLD));
- EXPECT_EQ(runLength3,
- RunLengthForAttrType(runLength1 + runLength2,
- kContents.size(),
- PANGO_ATTR_WEIGHT));
- EXPECT_TRUE(RunHasWeight(runLength1 + runLength2,
- kContents.size(),
- PANGO_WEIGHT_NORMAL));
+ EXPECT_EQ(kRunLength1, RunLengthForAttrType(0U, kContents.length(),
+ PANGO_ATTR_WEIGHT));
+ EXPECT_TRUE(RunHasWeight(0U, kContents.length(), PANGO_WEIGHT_NORMAL));
+ EXPECT_EQ(kRunLength2, RunLengthForAttrType(kRunLength1, kContents.length(),
+ PANGO_ATTR_WEIGHT));
+ EXPECT_TRUE(RunHasWeight(kRunLength1, kContents.length(), PANGO_WEIGHT_BOLD));
+ EXPECT_EQ(kRunLength3, RunLengthForAttrType(kRunLength1 + kRunLength2,
+ kContents.length(),
+ PANGO_ATTR_WEIGHT));
+ EXPECT_TRUE(RunHasWeight(kRunLength1 + kRunLength2, kContents.length(),
+ PANGO_WEIGHT_NORMAL));
// The entire string should be the same, normal color.
- EXPECT_EQ(kContents.size(),
- RunLengthForAttrType(0U,
- kContents.size(),
- PANGO_ATTR_FOREGROUND));
- EXPECT_TRUE(RunHasColor(0U,
- kContents.size(),
- kContentTextColor));
+ EXPECT_EQ(kContents.length(), RunLengthForAttrType(0U, kContents.length(),
+ PANGO_ATTR_FOREGROUND));
+ EXPECT_TRUE(RunHasColor(0U, kContents.length(), kContentTextColor));
}
// Just like DecorateMatchedStringURLMatch, this time with URL style.
TEST_F(AutocompletePopupViewGtkTest, DecorateMatchedStringURLMatch) {
const string16 kContents = ASCIIToUTF16("http://hello.world/");
// Match "hello".
- const guint runLength1 = 7, runLength2 = 5, runLength3 = 7;
+ const guint kRunLength1 = 7, kRunLength2 = 5, kRunLength3 = 7;
// Make sure nobody messed up the inputs.
- EXPECT_EQ(runLength1 + runLength2 + runLength3, kContents.size());
+ EXPECT_EQ(kRunLength1 + kRunLength2 + kRunLength3, kContents.length());
// Push each run onto classifications.
AutocompleteMatch::ACMatchClassifications classifications;
@@ -394,10 +354,9 @@ TEST_F(AutocompletePopupViewGtkTest, DecorateMatchedStringURLMatch) {
const int kURLMatch =
ACMatchClassification::URL | ACMatchClassification::MATCH;
classifications.push_back(
- ACMatchClassification(runLength1,
- kURLMatch));
+ ACMatchClassification(kRunLength1, kURLMatch));
classifications.push_back(
- ACMatchClassification(runLength1 + runLength2,
+ ACMatchClassification(kRunLength1 + kRunLength2,
ACMatchClassification::URL));
SetupLayoutForMatch(kContents,
@@ -409,11 +368,7 @@ TEST_F(AutocompletePopupViewGtkTest, DecorateMatchedStringURLMatch) {
// One color for the entire string, and it's not the one we passed
// in.
- EXPECT_EQ(kContents.size(),
- RunLengthForAttrType(0U,
- kContents.size(),
- PANGO_ATTR_FOREGROUND));
- EXPECT_TRUE(RunHasColor(0U,
- kContents.size(),
- kURLTextColor));
+ EXPECT_EQ(kContents.length(), RunLengthForAttrType(0U, kContents.length(),
+ PANGO_ATTR_FOREGROUND));
+ EXPECT_TRUE(RunHasColor(0U, kContents.length(), kURLTextColor));
}
diff --git a/chrome/browser/autocomplete/autocomplete_popup_view_mac.mm b/chrome/browser/autocomplete/autocomplete_popup_view_mac.mm
index 83eed6e..cedf18e 100644
--- a/chrome/browser/autocomplete/autocomplete_popup_view_mac.mm
+++ b/chrome/browser/autocomplete/autocomplete_popup_view_mac.mm
@@ -124,7 +124,7 @@ NSMutableAttributedString* AutocompletePopupViewMac::DecorateMatchedString(
for (ACMatchClassifications::const_iterator i = classifications.begin();
i != classifications.end(); ++i) {
const BOOL isLast = (i+1) == classifications.end();
- const size_t nextOffset = (isLast ? matchString.length() : (i+1)->offset);
+ const size_t nextOffset = (isLast ? matchString.length() : (i + 1)->offset);
const NSInteger location = static_cast<NSInteger>(i->offset);
const NSInteger length = static_cast<NSInteger>(nextOffset - i->offset);
const NSRange range = NSMakeRange(location, length);
@@ -177,7 +177,7 @@ NSMutableAttributedString* AutocompletePopupViewMac::ElideString(
// The ellipses should be the last character, and everything before
// that should match the original string.
- const size_t i(elided.size() - 1);
+ const size_t i(elided.length() - 1);
DCHECK_NE(0, elided.compare(0, i, originalString));
// Replace the end of |aString| with the ellipses from |elided|.
diff --git a/chrome/browser/autocomplete/history_contents_provider.cc b/chrome/browser/autocomplete/history_contents_provider.cc
index bc68a8d..a6ea0fc 100644
--- a/chrome/browser/autocomplete/history_contents_provider.cc
+++ b/chrome/browser/autocomplete/history_contents_provider.cc
@@ -247,7 +247,7 @@ void HistoryContentsProvider::ClassifyDescription(
offset = i->second;
}
}
- if (offset != result.title().size()) {
+ if (offset != result.title().length()) {
match->description_class.push_back(
ACMatchClassification(offset, ACMatchClassification::NONE));
}
diff --git a/chrome/browser/autocomplete/history_provider.cc b/chrome/browser/autocomplete/history_provider.cc
index 50fa80f..161fb3e 100644
--- a/chrome/browser/autocomplete/history_provider.cc
+++ b/chrome/browser/autocomplete/history_provider.cc
@@ -151,5 +151,5 @@ bool HistoryProvider::PreventInlineAutocomplete(
const AutocompleteInput& input) {
return input.prevent_inline_autocomplete() ||
(!input.text().empty() &&
- IsWhitespace(input.text()[input.text().size() - 1]));
+ IsWhitespace(input.text()[input.text().length() - 1]));
}
diff --git a/chrome/browser/autocomplete/history_quick_provider.cc b/chrome/browser/autocomplete/history_quick_provider.cc
index bc80be7..8547b587 100644
--- a/chrome/browser/autocomplete/history_quick_provider.cc
+++ b/chrome/browser/autocomplete/history_quick_provider.cc
@@ -77,10 +77,10 @@ void HistoryQuickProvider::Start(const AutocompleteInput& input,
if (GetIndex()) {
base::TimeTicks start_time = base::TimeTicks::Now();
DoAutocomplete();
- if (input.text().size() < 6) {
+ if (input.text().length() < 6) {
base::TimeTicks end_time = base::TimeTicks::Now();
std::string name = "HistoryQuickProvider.QueryIndexTime." +
- base::IntToString(input.text().size());
+ base::IntToString(input.text().length());
base::Histogram* counter = base::Histogram::FactoryGet(
name, 1, 1000, 50, base::Histogram::kUmaTargetedHistogramFlag);
counter->Add(static_cast<int>((end_time - start_time).InMilliseconds()));
@@ -147,7 +147,7 @@ AutocompleteMatch HistoryQuickProvider::QuickMatchToACMatch(
InMemoryURLIndex::ReplaceOffsetsInTermMatches(history_match.url_matches,
offsets);
match.contents_class =
- SpansFromTermMatch(new_matches, match.contents.size(), true);
+ SpansFromTermMatch(new_matches, match.contents.length(), true);
match.fill_into_edit = match.contents;
if (prevent_inline_autocomplete || !history_match.can_inline) {
@@ -160,8 +160,8 @@ AutocompleteMatch HistoryQuickProvider::QuickMatchToACMatch(
// Format the description autocomplete presentation.
match.description = info.title();
- match.description_class = SpansFromTermMatch(history_match.title_matches,
- match.description.size(), false);
+ match.description_class = SpansFromTermMatch(
+ history_match.title_matches, match.description.length(), false);
return match;
}
diff --git a/chrome/browser/autocomplete/history_quick_provider_unittest.cc b/chrome/browser/autocomplete/history_quick_provider_unittest.cc
index 99903c4..f7552af 100644
--- a/chrome/browser/autocomplete/history_quick_provider_unittest.cc
+++ b/chrome/browser/autocomplete/history_quick_provider_unittest.cc
@@ -288,7 +288,7 @@ TEST_F(HistoryQuickProviderTest, EncodingLimitMatch) {
// Verify that the matches' ACMatchClassifications offsets are in range.
ACMatchClassifications content(ac_matches_[0].contents_class);
// The max offset accounts for 6 occurrences of '%20' plus the 'http://'.
- const size_t max_offset = url.size() - ((6 * 2) + 7);
+ const size_t max_offset = url.length() - ((6 * 2) + 7);
for (ACMatchClassifications::const_iterator citer = content.begin();
citer != content.end(); ++citer)
EXPECT_LT(citer->offset, max_offset);
@@ -296,7 +296,7 @@ TEST_F(HistoryQuickProviderTest, EncodingLimitMatch) {
std::string page_title("Dogs & Cats & Mice");
for (ACMatchClassifications::const_iterator diter = description.begin();
diter != description.end(); ++diter)
- EXPECT_LT(diter->offset, page_title.size());
+ EXPECT_LT(diter->offset, page_title.length());
}
TEST_F(HistoryQuickProviderTest, Spans) {
diff --git a/chrome/browser/autocomplete/history_url_provider.cc b/chrome/browser/autocomplete/history_url_provider.cc
index 342efce..681d151 100644
--- a/chrome/browser/autocomplete/history_url_provider.cc
+++ b/chrome/browser/autocomplete/history_url_provider.cc
@@ -541,12 +541,11 @@ void HistoryURLProvider::PromoteOrCreateShorterSuggestion(
}
// static
-void HistoryURLProvider::EnsureMatchPresent(
- const history::URLRow& info,
- string16::size_type input_location,
- bool match_in_scheme,
- HistoryMatches* matches,
- bool promote) {
+void HistoryURLProvider::EnsureMatchPresent(const history::URLRow& info,
+ size_t input_location,
+ bool match_in_scheme,
+ HistoryMatches* matches,
+ bool promote) {
// |matches| may already have an entry for this.
for (HistoryMatches::iterator i(matches->begin()); i != matches->end();
++i) {
diff --git a/chrome/browser/autocomplete/history_url_provider.h b/chrome/browser/autocomplete/history_url_provider.h
index 885990f..e781686 100644
--- a/chrome/browser/autocomplete/history_url_provider.h
+++ b/chrome/browser/autocomplete/history_url_provider.h
@@ -224,7 +224,7 @@ class HistoryURLProvider : public HistoryProvider {
// |promote| is false, existing matches are left in place, and newly added
// matches are placed at the back.
static void EnsureMatchPresent(const history::URLRow& info,
- string16::size_type input_location,
+ size_t input_location,
bool match_in_scheme,
history::HistoryMatches* matches,
bool promote);
diff --git a/chrome/browser/autocomplete/search_provider_unittest.cc b/chrome/browser/autocomplete/search_provider_unittest.cc
index 68842b6..33e038a 100644
--- a/chrome/browser/autocomplete/search_provider_unittest.cc
+++ b/chrome/browser/autocomplete/search_provider_unittest.cc
@@ -221,7 +221,7 @@ void SearchProviderTest::FinishDefaultSuggestQuery() {
// Make sure we query history for the default provider and a URLFetcher is
// created for the default provider suggest results.
TEST_F(SearchProviderTest, QueryDefaultProvider) {
- string16 term = term1_.substr(0, term1_.size() - 1);
+ string16 term = term1_.substr(0, term1_.length() - 1);
QueryForInput(term, false, false);
// Make sure the default providers suggest service was queried.
@@ -262,7 +262,7 @@ TEST_F(SearchProviderTest, QueryDefaultProvider) {
}
TEST_F(SearchProviderTest, HonorPreventInlineAutocomplete) {
- string16 term = term1_.substr(0, term1_.size() - 1);
+ string16 term = term1_.substr(0, term1_.length() - 1);
QueryForInput(term, true, false);
ASSERT_FALSE(provider_->matches().empty());
@@ -273,7 +273,7 @@ TEST_F(SearchProviderTest, HonorPreventInlineAutocomplete) {
// Issues a query that matches the registered keyword and makes sure history
// is queried as well as URLFetchers getting created.
TEST_F(SearchProviderTest, QueryKeywordProvider) {
- string16 term = keyword_term_.substr(0, keyword_term_.size() - 1);
+ string16 term = keyword_term_.substr(0, keyword_term_.length() - 1);
QueryForInput(keyword_t_url_->keyword() + UTF8ToUTF16(" ") + term, false,
false);