diff options
author | pkasting@chromium.org <pkasting@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-03-08 23:34:07 +0000 |
---|---|---|
committer | pkasting@chromium.org <pkasting@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-03-08 23:34:07 +0000 |
commit | e9adf0702e30800cdfaebce8cfacff7b444b4e79 (patch) | |
tree | 49d8ab8fa6e0090c6dd7bbe667008f07e5939af0 /views/widget | |
parent | ae5f56fed71e801889db8f0f7ebd2f21d6612521 (diff) | |
download | chromium_src-e9adf0702e30800cdfaebce8cfacff7b444b4e79.zip chromium_src-e9adf0702e30800cdfaebce8cfacff7b444b4e79.tar.gz chromium_src-e9adf0702e30800cdfaebce8cfacff7b444b4e79.tar.bz2 |
Replace lots of "int x, int y" with gfx::Point. Also use gfx::Size and gfx::Rect in a few more places.
BUG=none
TEST=none
Review URL: http://codereview.chromium.org/669130
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@40966 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'views/widget')
-rw-r--r-- | views/widget/root_view.cc | 13 | ||||
-rw-r--r-- | views/widget/root_view.h | 5 | ||||
-rw-r--r-- | views/widget/tooltip_manager_gtk.cc | 8 | ||||
-rw-r--r-- | views/widget/tooltip_manager_win.cc | 12 | ||||
-rw-r--r-- | views/widget/widget_gtk.cc | 4 |
5 files changed, 16 insertions, 26 deletions
diff --git a/views/widget/root_view.cc b/views/widget/root_view.cc index 862d000..c64dc08 100644 --- a/views/widget/root_view.cc +++ b/views/widget/root_view.cc @@ -1,4 +1,4 @@ -// Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. +// 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. @@ -135,10 +135,6 @@ void RootView::SchedulePaint() { View::SchedulePaint(); } -void RootView::SchedulePaint(int x, int y, int w, int h) { - View::SchedulePaint(); -} - #ifndef NDEBUG // Sets the value of RootView's |is_processing_paint_| member to true as long // as ProcessPaint is being called. Sets it to |false| when it returns. @@ -412,7 +408,7 @@ void RootView::UpdateCursor(const MouseEvent& e) { if (v && v != this) { gfx::Point l(e.location()); View::ConvertPointToView(this, v, &l); - cursor = v->GetCursorForPoint(e.GetType(), l.x(), l.y()); + cursor = v->GetCursorForPoint(e.GetType(), l); } SetActiveCursor(cursor); } @@ -477,7 +473,7 @@ void RootView::OnMouseMoved(const MouseEvent& e) { mouse_move_handler_->OnMouseMoved(moved_event); gfx::NativeCursor cursor = mouse_move_handler_->GetCursorForPoint( - moved_event.GetType(), moved_event.x(), moved_event.y()); + moved_event.GetType(), moved_event.location()); SetActiveCursor(cursor); } else if (mouse_move_handler_ != NULL) { MouseEvent exited_event(Event::ET_MOUSE_EXITED, 0, 0, 0); @@ -798,8 +794,7 @@ bool RootView::ProcessKeyEvent(const KeyEvent& event) { // keyboard. if (v && v->IsEnabled() && ((event.GetKeyCode() == base::VKEY_APPS) || (event.GetKeyCode() == base::VKEY_F10 && event.IsShiftDown()))) { - gfx::Point screen_loc = v->GetKeyboardContextMenuLocation(); - v->ShowContextMenu(screen_loc.x(), screen_loc.y(), false); + v->ShowContextMenu(v->GetKeyboardContextMenuLocation(), false); return true; } for (; v && v != this && !consumed; v = v->GetParent()) { diff --git a/views/widget/root_view.h b/views/widget/root_view.h index d175c63..bfc3b2c 100644 --- a/views/widget/root_view.h +++ b/views/widget/root_view.h @@ -1,4 +1,4 @@ -// Copyright (c) 2009 The Chromium Authors. All rights reserved. +// 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. @@ -53,9 +53,6 @@ class RootView : public View, // Convenience to schedule the whole view virtual void SchedulePaint(); - // Convenience to schedule a paint given some ints - virtual void SchedulePaint(int x, int y, int w, int h); - // Paint this RootView and its child Views. virtual void ProcessPaint(gfx::Canvas* canvas); diff --git a/views/widget/tooltip_manager_gtk.cc b/views/widget/tooltip_manager_gtk.cc index b425356..6aa8254 100644 --- a/views/widget/tooltip_manager_gtk.cc +++ b/views/widget/tooltip_manager_gtk.cc @@ -1,4 +1,4 @@ -// Copyright (c) 2009 The Chromium Authors. All rights reserved. +// 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. @@ -161,7 +161,7 @@ bool TooltipManagerGtk::ShowTooltip(int x, int y, bool for_keyboard, return false; std::wstring text; - if (!view->GetTooltipText(view_loc.x(), view_loc.y(), &text)) + if (!view->GetTooltipText(view_loc, &text)) return false; AdjustLabel(tooltip); @@ -169,7 +169,7 @@ bool TooltipManagerGtk::ShowTooltip(int x, int y, bool for_keyboard, // Sets the area of the tooltip. This way if different views in the same // widget have tooltips the tooltip doesn't get stuck at the same location. gfx::Rect vis_bounds = view->GetVisibleBounds(); - gfx::Point widget_loc(vis_bounds.x(), vis_bounds.y()); + gfx::Point widget_loc(vis_bounds.origin()); View::ConvertPointToWidget(view, &widget_loc); GdkRectangle tip_area = { widget_loc.x(), widget_loc.y(), vis_bounds.width(), vis_bounds.height() }; @@ -209,7 +209,7 @@ void TooltipManagerGtk::ShowKeyboardTooltip(View* view) { HideKeyboardTooltip(); std::wstring tooltip_text; - if (!view->GetTooltipText(0, 0, &tooltip_text)) + if (!view->GetTooltipText(gfx::Point(), &tooltip_text)) return; // The view doesn't have a tooltip, nothing to do. keyboard_view_ = view; diff --git a/views/widget/tooltip_manager_win.cc b/views/widget/tooltip_manager_win.cc index c86bc76..e0b48c3 100644 --- a/views/widget/tooltip_manager_win.cc +++ b/views/widget/tooltip_manager_win.cc @@ -165,8 +165,7 @@ LRESULT TooltipManagerWin::OnNotify(int w_param, gfx::Point view_loc = last_mouse_pos_; View::ConvertPointToView(widget_->GetRootView(), last_tooltip_view_, &view_loc); - if (last_tooltip_view_->GetTooltipText(view_loc.x(), view_loc.y(), - &tooltip_text_) && + if (last_tooltip_view_->GetTooltipText(view_loc, &tooltip_text_) && !tooltip_text_.empty()) { // View has a valid tip, copy it into TOOLTIPINFO. clipped_text_ = tooltip_text_; @@ -199,8 +198,7 @@ LRESULT TooltipManagerWin::OnNotify(int w_param, gfx::Point view_loc = last_mouse_pos_; View::ConvertPointToView(widget_->GetRootView(), last_tooltip_view_, &view_loc); - if (last_tooltip_view_->GetTooltipTextOrigin( - view_loc.x(), view_loc.y(), &text_origin) && + if (last_tooltip_view_->GetTooltipTextOrigin(view_loc, &text_origin) && SetTooltipPosition(text_origin.x(), text_origin.y())) { // Return true, otherwise the rectangle we specified is ignored. return TRUE; @@ -284,8 +282,8 @@ void TooltipManagerWin::UpdateTooltip(const gfx::Point& mouse_pos) { gfx::Point view_point = mouse_pos; View::ConvertPointToView(root_view, last_tooltip_view_, &view_point); std::wstring new_tooltip_text; - bool has_tooltip_text = last_tooltip_view_->GetTooltipText( - view_point.x(), view_point.y(), &new_tooltip_text); + bool has_tooltip_text = + last_tooltip_view_->GetTooltipText(view_point, &new_tooltip_text); if (!has_tooltip_text || (new_tooltip_text != tooltip_text_)) { // The text has changed, hide the popup. SendMessage(tooltip_hwnd_, TTM_POP, 0, 0); @@ -328,7 +326,7 @@ void TooltipManagerWin::ShowKeyboardTooltip(View* focused_view) { } HideKeyboardTooltip(); std::wstring tooltip_text; - if (!focused_view->GetTooltipText(0, 0, &tooltip_text)) + if (!focused_view->GetTooltipText(gfx::Point(), &tooltip_text)) return; gfx::Rect focused_bounds = focused_view->bounds(); gfx::Point screen_point; diff --git a/views/widget/widget_gtk.cc b/views/widget/widget_gtk.cc index 3c43de7..daa43d1 100644 --- a/views/widget/widget_gtk.cc +++ b/views/widget/widget_gtk.cc @@ -196,8 +196,8 @@ void WidgetGtk::DoDrag(const OSExchangeData& data, int operation) { if (provider.drag_image()) gtk_drag_set_icon_pixbuf(context, provider.drag_image(), - provider.cursor_offset_x(), - provider.cursor_offset_y()); + provider.cursor_offset().x(), + provider.cursor_offset().y()); if (current_event) gdk_event_free(current_event); gtk_target_list_unref(targets); |