summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorsky@chromium.org <sky@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-01-29 22:09:21 +0000
committersky@chromium.org <sky@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-01-29 22:09:21 +0000
commit469af750e1435c1903f81f79649f72eb919853ad (patch)
treef3ab55da62ad516f691eee2377c2e2ebc9b6926d
parentb8391530b14bd47f5f3928dcf72785931051b2a7 (diff)
downloadchromium_src-469af750e1435c1903f81f79649f72eb919853ad.zip
chromium_src-469af750e1435c1903f81f79649f72eb919853ad.tar.gz
chromium_src-469af750e1435c1903f81f79649f72eb919853ad.tar.bz2
Fixes compile warning on linux/views when building 64 bit.
BUG=none TEST=none Review URL: http://codereview.chromium.org/551208 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@37551 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r--chrome/browser/views/autocomplete/autocomplete_popup_contents_view.cc15
-rw-r--r--chrome/browser/views/autocomplete/autocomplete_popup_contents_view.h11
2 files changed, 14 insertions, 12 deletions
diff --git a/chrome/browser/views/autocomplete/autocomplete_popup_contents_view.cc b/chrome/browser/views/autocomplete/autocomplete_popup_contents_view.cc
index 6d9429e..5e2a91d 100644
--- a/chrome/browser/views/autocomplete/autocomplete_popup_contents_view.cc
+++ b/chrome/browser/views/autocomplete/autocomplete_popup_contents_view.cc
@@ -1,6 +1,6 @@
-// Copyright (c) 2010 The Chromium Authors. All rights reserved. Use of this
-// source code is governed by a BSD-style license that can be found in the
-// LICENSE file.
+// Copyright (c) 2010 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
#include "chrome/browser/views/autocomplete/autocomplete_popup_contents_view.h"
@@ -766,7 +766,7 @@ void AutocompletePopupContentsView::OnMouseExited(
bool AutocompletePopupContentsView::OnMousePressed(
const views::MouseEvent& event) {
if (event.IsLeftMouseButton() || event.IsMiddleMouseButton()) {
- int index = GetIndexForPoint(event.location());
+ size_t index = GetIndexForPoint(event.location());
model_->SetHoveredLine(index);
if (HasMatchAt(index) && event.IsLeftMouseButton())
model_->SetSelectedLine(index, false);
@@ -780,7 +780,7 @@ void AutocompletePopupContentsView::OnMouseReleased(
if (canceled)
return;
- int index = GetIndexForPoint(event.location());
+ size_t index = GetIndexForPoint(event.location());
if (event.IsOnlyMiddleMouseButton())
OpenIndex(index, NEW_BACKGROUND_TAB);
else if (event.IsOnlyLeftMouseButton())
@@ -790,7 +790,7 @@ void AutocompletePopupContentsView::OnMouseReleased(
bool AutocompletePopupContentsView::OnMouseDragged(
const views::MouseEvent& event) {
if (event.IsLeftMouseButton() || event.IsMiddleMouseButton()) {
- int index = GetIndexForPoint(event.location());
+ size_t index = GetIndexForPoint(event.location());
model_->SetHoveredLine(index);
if (HasMatchAt(index) && event.IsLeftMouseButton())
model_->SetSelectedLine(index, false);
@@ -885,7 +885,8 @@ void AutocompletePopupContentsView::OpenIndex(
is_keyword_hint ? std::wstring() : keyword);
}
-int AutocompletePopupContentsView::GetIndexForPoint(const gfx::Point& point) {
+size_t AutocompletePopupContentsView::GetIndexForPoint(
+ const gfx::Point& point) {
if (!HitTest(point))
return AutocompletePopupModel::kNoMatch;
diff --git a/chrome/browser/views/autocomplete/autocomplete_popup_contents_view.h b/chrome/browser/views/autocomplete/autocomplete_popup_contents_view.h
index 856b3b6..7e83d2f 100644
--- a/chrome/browser/views/autocomplete/autocomplete_popup_contents_view.h
+++ b/chrome/browser/views/autocomplete/autocomplete_popup_contents_view.h
@@ -1,6 +1,6 @@
-// Copyright (c) 2010 The Chromium Authors. All rights reserved. Use of this
-// source code is governed by a BSD-style license that can be found in the
-// LICENSE file.
+// Copyright (c) 2010 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
#ifndef CHROME_BROWSER_VIEWS_AUTOCOMPLETE_AUTOCOMPLETE_POPUP_CONTENTS_VIEW_H_
#define CHROME_BROWSER_VIEWS_AUTOCOMPLETE_AUTOCOMPLETE_POPUP_CONTENTS_VIEW_H_
@@ -108,8 +108,9 @@ class AutocompletePopupContentsView : public views::View,
void OpenIndex(size_t index, WindowOpenDisposition disposition);
// Find the index of the match under the given |point|, specified in window
- // coordinates.
- int GetIndexForPoint(const gfx::Point& point);
+ // coordinates. Returns AutocompletePopupModel::kNoMatch if there isn't a
+ // match at the specified point.
+ size_t GetIndexForPoint(const gfx::Point& point);
// The popup that contains this view.
scoped_ptr<AutocompletePopupClass> popup_;