diff options
Diffstat (limited to 'chrome/browser')
19 files changed, 135 insertions, 136 deletions
diff --git a/chrome/browser/autocomplete/autocomplete_popup.cc b/chrome/browser/autocomplete/autocomplete_popup.cc index c9ca6a1..c30bbb5 100644 --- a/chrome/browser/autocomplete/autocomplete_popup.cc +++ b/chrome/browser/autocomplete/autocomplete_popup.cc @@ -172,9 +172,9 @@ void AutocompletePopupView::UpdatePopupAppearance() { CRect rc = edit_view_->parent_view()->bounds().ToRECT(); // Subtract the top left corner to make the coordinates relative to the // location bar view itself, and convert to screen coordinates. - CPoint top_left(-rc.TopLeft()); + gfx::Point top_left(-rc.TopLeft()); ChromeViews::View::ConvertPointToScreen(edit_view_->parent_view(), &top_left); - rc.OffsetRect(top_left); + rc.OffsetRect(top_left.ToPOINT()); // Expand by one pixel on each side since that's the amount the location bar // view is inset from the divider line that edges the adjacent buttons. // Deflate the top and bottom by the height of the extra graphics around the diff --git a/chrome/browser/automation/automation_provider.cc b/chrome/browser/automation/automation_provider.cc index 1456adc..c7bb3d5 100644 --- a/chrome/browser/automation/automation_provider.cc +++ b/chrome/browser/automation/automation_provider.cc @@ -1148,13 +1148,13 @@ void AutomationProvider::WindowGetViewBounds(const IPC::Message& message, ChromeViews::View* view = root_view->GetViewByID(view_id); if (view) { succeeded = true; - CPoint point(0, 0); + gfx::Point point; if (screen_coordinates) ChromeViews::View::ConvertPointToScreen(view, &point); else ChromeViews::View::ConvertPointToView(view, root_view, &point); view->GetLocalBounds(&bounds, false); - bounds.MoveToXY(point.x, point.y); + bounds.MoveToXY(point.x(), point.y()); } } } @@ -1182,9 +1182,9 @@ class MouseEventTask : public Task { // the drag code moved away from using mouse event locations was because // our conversion to screen location doesn't work well with multiple // monitors, so this only works reliably in a single monitor setup. - CPoint screen_location = CPoint(point_.x, point_.y); + gfx::Point screen_location(point_.x, point_.y); view_->ConvertPointToScreen(view_, &screen_location); - ::SetCursorPos(screen_location.x, screen_location.y); + ::SetCursorPos(screen_location.x(), screen_location.y()); switch (type_) { case ChromeViews::Event::ET_MOUSE_PRESSED: view_->OnMousePressed(event); diff --git a/chrome/browser/automation/ui_controls.cc b/chrome/browser/automation/ui_controls.cc index 9fe42201..ab5f572 100644 --- a/chrome/browser/automation/ui_controls.cc +++ b/chrome/browser/automation/ui_controls.cc @@ -336,9 +336,9 @@ void MoveMouseToCenterAndPress( ChromeViews::View* view, MouseButton button, int state, Task* task) { DCHECK(view); DCHECK(view->GetViewContainer()); - CPoint view_center(view->width() / 2, view->height() / 2); + gfx::Point view_center(view->width() / 2, view->height() / 2); ChromeViews::View::ConvertPointToScreen(view, &view_center); - SendMouseMove(view_center.x, view_center.y); + SendMouseMove(view_center.x(), view_center.y()); SendMouseEventsNotifyWhenDone(button, state, task); } diff --git a/chrome/browser/find_in_page_controller.cc b/chrome/browser/find_in_page_controller.cc index 67c819c..916dc7d 100644 --- a/chrome/browser/find_in_page_controller.cc +++ b/chrome/browser/find_in_page_controller.cc @@ -491,9 +491,9 @@ void FindInPageController::GetDialogBounds(gfx::Rect* bounds) { // toolbar is the child of another view that isn't the top level view. // This is required to ensure correct positioning relative to the top,left // of the window. - CPoint topleft(0, 0); + gfx::Point topleft; ChromeViews::View::ConvertPointToViewContainer(toolbar, &topleft); - toolbar_bounds.Offset(topleft.x, topleft.y); + toolbar_bounds.Offset(topleft.x(), topleft.y()); } // If the bookmarks bar is available, we need to update our diff --git a/chrome/browser/history_view.cc b/chrome/browser/history_view.cc index 064e215..bdf29ba 100644 --- a/chrome/browser/history_view.cc +++ b/chrome/browser/history_view.cc @@ -557,11 +557,11 @@ void HistoryItemRenderer::SetDisplayStyle(bool show_full) { void HistoryItemRenderer::StarStateChanged(bool state) { // Show the user a tip that can be used to edit the bookmark/star. - CPoint star_location(0, 0); + gfx::Point star_location; ChromeViews::View::ConvertPointToScreen(star_toggle_, &star_location); // Shift the location to make the bubble appear at a visually pleasing // location. - gfx::Rect star_bounds(star_location.x, star_location.y + 4, + gfx::Rect star_bounds(star_location.x(), star_location.y() + 4, star_toggle_->width(), star_toggle_->height()); HWND parent = GetViewContainer()->GetHWND(); diff --git a/chrome/browser/views/bookmark_bar_view.cc b/chrome/browser/views/bookmark_bar_view.cc index 20bee0b..8b628f6 100644 --- a/chrome/browser/views/bookmark_bar_view.cc +++ b/chrome/browser/views/bookmark_bar_view.cc @@ -242,10 +242,10 @@ class BookmarkButton : public ChromeViews::TextButton { } bool GetTooltipText(int x, int y, std::wstring* tooltip) { - CPoint location(x, y); + gfx::Point location(x, y); ConvertPointToScreen(this, &location); *tooltip = CreateToolTipForURLAndTitle( - gfx::Point(location.x, location.y), url_, GetText(), + gfx::Point(location.x(), location.y()), url_, GetText(), profile_->GetPrefs()->GetString(prefs::kAcceptLanguages)); return !tooltip->empty(); } @@ -1403,12 +1403,12 @@ void BookmarkBarView::RunMenu(ChromeViews::View* view, else anchor_point = MenuItemView::TOPLEFT; } - CPoint screen_loc(x, 0); + gfx::Point screen_loc(x, 0); View::ConvertPointToScreen(this, &screen_loc); menu_runner_.reset(new MenuRunner(this, node, start_index)); HWND parent_hwnd = GetViewContainer()->GetHWND(); menu_runner_->RunMenuAt(parent_hwnd, - gfx::Rect(screen_loc.x, screen_loc.y, + gfx::Rect(screen_loc.x(), screen_loc.y(), view->width(), bar_height), anchor_point, false); @@ -1586,11 +1586,11 @@ void BookmarkBarView::ShowDropFolderForNode(BookmarkNode* node) { drop_info_->is_menu_showing = true; drop_menu_runner_.reset(new MenuRunner(this, node, start_index)); - CPoint screen_loc(0, 0); + gfx::Point screen_loc; View::ConvertPointToScreen(view_to_position_menu_from, &screen_loc); drop_menu_runner_->RunMenuAt( GetViewContainer()->GetHWND(), - gfx::Rect(screen_loc.x, screen_loc.y, + gfx::Rect(screen_loc.x(), screen_loc.y(), view_to_position_menu_from->width(), view_to_position_menu_from->height()), anchor, true); diff --git a/chrome/browser/views/bookmark_bar_view_test.cc b/chrome/browser/views/bookmark_bar_view_test.cc index 547f992..2fc0d30 100644 --- a/chrome/browser/views/bookmark_bar_view_test.cc +++ b/chrome/browser/views/bookmark_bar_view_test.cc @@ -243,7 +243,7 @@ class BookmarkBarViewTest2 : public BookmarkBarViewEventTestBase { // NOTE: this code assume there is a left margin, which is currently // true. If that changes, this code will need to find another empty space // to press the mouse on. - CPoint mouse_loc(0, 0); + gfx::Point mouse_loc; ChromeViews::View::ConvertPointToScreen(bb_view_, &mouse_loc); ui_controls::SendMouseMove(0, 0); ui_controls::SendMouseEventsNotifyWhenDone( @@ -428,24 +428,24 @@ class BookmarkBarViewTest5 : public BookmarkBarViewEventTestBase { void Step3() { ChromeViews::MenuItemView* target_menu = bb_view_->GetMenu()->GetSubmenu()->GetMenuItemAt(1); - CPoint loc(1, target_menu->height() - 1); + gfx::Point loc(1, target_menu->height() - 1); ChromeViews::View::ConvertPointToScreen(target_menu, &loc); // Start a drag. - ui_controls::SendMouseMoveNotifyWhenDone(loc.x + 10, loc.y, + ui_controls::SendMouseMoveNotifyWhenDone(loc.x() + 10, loc.y(), CreateEventTask(this, &BookmarkBarViewTest5::Step4)); // See comment above this method as to why we do this. - ScheduleMouseMoveInBackground(loc.x, loc.y); + ScheduleMouseMoveInBackground(loc.x(), loc.y()); } void Step4() { // Drop the item so that it's now the second item. ChromeViews::MenuItemView* target_menu = bb_view_->GetMenu()->GetSubmenu()->GetMenuItemAt(1); - CPoint loc(1, target_menu->height() - 1); + gfx::Point loc(1, target_menu->height() - 1); ChromeViews::View::ConvertPointToScreen(target_menu, &loc); - ui_controls::SendMouseMove(loc.x, loc.y); + ui_controls::SendMouseMove(loc.x(), loc.y()); ui_controls::SendMouseEventsNotifyWhenDone(ui_controls::LEFT, ui_controls::UP, @@ -537,15 +537,15 @@ class BookmarkBarViewTest7 : public BookmarkBarViewEventTestBase { // Drag over other button. ChromeViews::TextButton* other_button = bb_view_->other_bookmarked_button(); - CPoint loc(other_button->width() / 2, other_button->height() / 2); + gfx::Point loc(other_button->width() / 2, other_button->height() / 2); ChromeViews::View::ConvertPointToScreen(other_button, &loc); // Start a drag. - ui_controls::SendMouseMoveNotifyWhenDone(loc.x + 10, loc.y, + ui_controls::SendMouseMoveNotifyWhenDone(loc.x() + 10, loc.y(), NewRunnableMethod(this, &BookmarkBarViewTest7::Step4)); // See comment above this method as to why we do this. - ScheduleMouseMoveInBackground(loc.x, loc.y); + ScheduleMouseMoveInBackground(loc.x(), loc.y()); } void Step4() { @@ -555,9 +555,9 @@ class BookmarkBarViewTest7 : public BookmarkBarViewEventTestBase { ChromeViews::MenuItemView* target_menu = drop_menu->GetSubmenu()->GetMenuItemAt(0); - CPoint loc(1, 1); + gfx::Point loc(1, 1); ChromeViews::View::ConvertPointToScreen(target_menu, &loc); - ui_controls::SendMouseMove(loc.x, loc.y); + ui_controls::SendMouseMove(loc.x(), loc.y()); ui_controls::SendMouseEventsNotifyWhenDone( ui_controls::LEFT, ui_controls::UP, CreateEventTask(this, &BookmarkBarViewTest7::Step5)); @@ -610,15 +610,15 @@ class BookmarkBarViewTest8 : public BookmarkBarViewEventTestBase { // Drag over other button. ChromeViews::TextButton* other_button = bb_view_->other_bookmarked_button(); - CPoint loc(other_button->width() / 2, other_button->height() / 2); + gfx::Point loc(other_button->width() / 2, other_button->height() / 2); ChromeViews::View::ConvertPointToScreen(other_button, &loc); // Start a drag. - ui_controls::SendMouseMoveNotifyWhenDone(loc.x + 10, loc.y, + ui_controls::SendMouseMoveNotifyWhenDone(loc.x() + 10, loc.y(), NewRunnableMethod(this, &BookmarkBarViewTest8::Step4)); // See comment above this method as to why we do this. - ScheduleMouseMoveInBackground(loc.x, loc.y); + ScheduleMouseMoveInBackground(loc.x(), loc.y()); } void Step4() { @@ -628,9 +628,9 @@ class BookmarkBarViewTest8 : public BookmarkBarViewEventTestBase { // Now drag back over first menu. ChromeViews::TextButton* button = bb_view_->GetBookmarkButton(0); - CPoint loc(button->width() / 2, button->height() / 2); + gfx::Point loc(button->width() / 2, button->height() / 2); ChromeViews::View::ConvertPointToScreen(button, &loc); - ui_controls::SendMouseMoveNotifyWhenDone(loc.x, loc.y, + ui_controls::SendMouseMoveNotifyWhenDone(loc.x(), loc.y(), NewRunnableMethod(this, &BookmarkBarViewTest8::Step5)); } @@ -682,9 +682,9 @@ class BookmarkBarViewTest9 : public BookmarkBarViewEventTestBase { ASSERT_TRUE(menu->GetSubmenu()->IsShowing()); first_menu_ = menu->GetSubmenu()->GetMenuItemAt(0); - CPoint menu_loc; + gfx::Point menu_loc; ChromeViews::View::ConvertPointToScreen(first_menu_, &menu_loc); - start_y_ = menu_loc.y; + start_y_ = menu_loc.y(); // Move the mouse over the scroll button. ChromeViews::View* scroll_container = menu->GetSubmenu()->GetParent(); @@ -693,11 +693,11 @@ class BookmarkBarViewTest9 : public BookmarkBarViewEventTestBase { ASSERT_TRUE(scroll_container != NULL); ChromeViews::View* scroll_down_button = scroll_container->GetChildViewAt(1); ASSERT_TRUE(scroll_down_button); - CPoint loc(scroll_down_button->width() / 2, - scroll_down_button->height() / 2); + gfx::Point loc(scroll_down_button->width() / 2, + scroll_down_button->height() / 2); ChromeViews::View::ConvertPointToScreen(scroll_down_button, &loc); ui_controls::SendMouseMoveNotifyWhenDone( - loc.x, loc.y, CreateEventTask(this, &BookmarkBarViewTest9::Step3)); + loc.x(), loc.y(), CreateEventTask(this, &BookmarkBarViewTest9::Step3)); } void Step3() { @@ -706,9 +706,9 @@ class BookmarkBarViewTest9 : public BookmarkBarViewEventTestBase { } void Step4() { - CPoint menu_loc; + gfx::Point menu_loc; ChromeViews::View::ConvertPointToScreen(first_menu_, &menu_loc); - ASSERT_NE(start_y_, menu_loc.y); + ASSERT_NE(start_y_, menu_loc.y()); // Hide menu. bb_view_->GetMenu()->GetMenuController()->Cancel(true); diff --git a/chrome/browser/views/download_item_view.cc b/chrome/browser/views/download_item_view.cc index 0da72f0..256b727 100644 --- a/chrome/browser/views/download_item_view.cc +++ b/chrome/browser/views/download_item_view.cc @@ -599,7 +599,7 @@ bool DownloadItemView::OnMousePressed(const ChromeViews::MouseEvent& event) { complete_animation_->End(); if (event.IsOnlyLeftMouseButton()) { - WTL::CPoint point(event.x(), event.y()); + gfx::Point point(event.location()); if (event.x() < drop_down_x_) { SetState(PUSHED, NORMAL); return true; @@ -624,18 +624,18 @@ bool DownloadItemView::OnMousePressed(const ChromeViews::MouseEvent& event) { // // TODO(idana): when bug# 1163334 is fixed the following check should be // replaced with UILayoutIsRightToLeft(). - point.y = height(); + point.set_y(height()); if (l10n_util::GetTextDirection() == l10n_util::RIGHT_TO_LEFT) { - point.x = width(); + point.set_x(width()); } else { - point.x = drop_down_x_; + point.set_x(drop_down_x_); } ChromeViews::View::ConvertPointToScreen(this, &point); download_util::DownloadShelfContextMenu menu(download_, GetViewContainer()->GetHWND(), model_.get(), - point); + point.ToPOINT()); drop_down_pressed_ = false; // Showing the menu blocks. Here we revert the state. SetState(NORMAL, NORMAL); diff --git a/chrome/browser/views/download_tab_view.cc b/chrome/browser/views/download_tab_view.cc index 679aa54..e4edec9 100644 --- a/chrome/browser/views/download_tab_view.cc +++ b/chrome/browser/views/download_tab_view.cc @@ -697,24 +697,23 @@ void DownloadItemTabView::DidChangeBounds(const CRect& previous, } bool DownloadItemTabView::OnMousePressed(const ChromeViews::MouseEvent& event) { - CPoint point(event.x(), event.y()); + gfx::Point point(event.location()); // If the click is in the highlight region, then highlight this download. // Otherwise, remove the highlighting from any download. - CRect select_rect(kDownloadIconOffset - download_util::kBigProgressIconOffset, - 0, - kDownloadIconOffset - - download_util::kBigProgressIconOffset + - download_util::kBigProgressIconSize + kInfoPadding + - kFilenameSize, - download_util::kBigProgressIconSize); + gfx::Rect select_rect( + kDownloadIconOffset - download_util::kBigProgressIconOffset, + 0, + kDownloadIconOffset - download_util::kBigProgressIconOffset + + download_util::kBigProgressIconSize + kInfoPadding + kFilenameSize, + download_util::kBigProgressIconSize); // The position of the highlighted region does not take into account the // View's UI layout so we have to manually mirror the position if the View is // using a right-to-left UI layout. gfx::Rect mirrored_rect(select_rect); - select_rect.MoveToX(MirroredLeftPointForRect(mirrored_rect)); - if (select_rect.PtInRect(point)) { + select_rect.set_x(MirroredLeftPointForRect(mirrored_rect)); + if (select_rect.Contains(point)) { parent_->ItemBecameSelected(model_); // Don't show the right-click menu if we are prompting the user for a @@ -724,7 +723,7 @@ bool DownloadItemTabView::OnMousePressed(const ChromeViews::MouseEvent& event) { ChromeViews::View::ConvertPointToScreen(this, &point); download_util::DownloadDestinationContextMenu menu( - model_, GetViewContainer()->GetHWND(), point); + model_, GetViewContainer()->GetHWND(), point.ToPOINT()); } } else { parent_->ItemBecameSelected(NULL); diff --git a/chrome/browser/views/frame/browser_view2.cc b/chrome/browser/views/frame/browser_view2.cc index 6ed9661..fbfa661 100644 --- a/chrome/browser/views/frame/browser_view2.cc +++ b/chrome/browser/views/frame/browser_view2.cc @@ -712,13 +712,13 @@ int BrowserView2::NonClientHitTest(const gfx::Point& point) { // animating. if (IsTabStripVisible() && tabstrip_->CanProcessInputEvents()) { ChromeViews::Window* window = frame_->GetWindow(); - CPoint point_in_view_coords(point.ToPOINT()); + gfx::Point point_in_view_coords(point); View::ConvertPointToView(GetParent(), this, &point_in_view_coords); // See if the mouse pointer is within the bounds of the TabStrip. - CPoint point_in_tabstrip_coords(point.ToPOINT()); + gfx::Point point_in_tabstrip_coords(point); View::ConvertPointToView(GetParent(), tabstrip_, &point_in_tabstrip_coords); - if (tabstrip_->HitTest(point_in_tabstrip_coords)) { + if (tabstrip_->HitTest(point_in_tabstrip_coords.ToPOINT())) { if (tabstrip_->PointIsWithinWindowCaption(point_in_tabstrip_coords)) return HTCAPTION; return HTCLIENT; @@ -728,7 +728,7 @@ int BrowserView2::NonClientHitTest(const gfx::Point& point) { // starved of dragable area, let's give it to window dragging (this also // makes sense visually). if (!window->IsMaximized() && - (point_in_view_coords.y < tabstrip_->y() + kTabShadowSize)) { + (point_in_view_coords.y() < tabstrip_->y() + kTabShadowSize)) { // We return HTNOWHERE as this is a signal to our containing // NonClientView that it should figure out what the correct hit-test // code is given the mouse position... diff --git a/chrome/browser/views/location_bar_view.cc b/chrome/browser/views/location_bar_view.cc index 5941d23..a60494f 100644 --- a/chrome/browser/views/location_bar_view.cc +++ b/chrome/browser/views/location_bar_view.cc @@ -576,10 +576,10 @@ void LocationBarView::OnMouseEvent(const ChromeViews::MouseEvent& event, if (event.IsRightMouseButton()) flags |= MK_RBUTTON; - CPoint screen_point(event.x(), event.y()); + gfx::Point screen_point(event.location()); ConvertPointToScreen(this, &screen_point); - location_entry_->HandleExternalMsg(msg, flags, screen_point); + location_entry_->HandleExternalMsg(msg, flags, screen_point.ToPOINT()); } bool LocationBarView::GetAccessibleRole(VARIANT* role) { @@ -874,23 +874,23 @@ void LocationBarView::ShowFirstRunBubbleInternal() { return; } - CPoint location(0, 0); + gfx::Point location; // If the UI layout is RTL, the coordinate system is not transformed and // therefore we need to adjust the X coordinate so that bubble appears on the // right hand side of the location bar. if (UILayoutIsRightToLeft()) - location.x += width(); + location.Offset(width(), 0); ChromeViews::View::ConvertPointToScreen(this, &location); // We try to guess that 20 pixels offset is a good place for the first // letter in the OmniBox. - gfx::Rect bounds(location.x, location.y, 20, height()); + gfx::Rect bounds(location.x(), location.y(), 20, height()); // Moving the bounds "backwards" so that it appears within the location bar // if the UI layout is RTL. if (UILayoutIsRightToLeft()) - bounds.set_x(location.x - 20); + bounds.set_x(location.x() - 20); FirstRunBubble::Show( location_entry_view_->GetRootView()->GetViewContainer()->GetHWND(), @@ -954,9 +954,9 @@ void LocationBarView::SecurityImageView::ShowInfoBubble() { SkColor text_color; model_->GetIconHoverText(&text, &text_color); - CPoint location(0, 0); + gfx::Point location; ChromeViews::View::ConvertPointToScreen(this, &location); - gfx::Rect bounds(location.x, location.y, width(), height()); + gfx::Rect bounds(location.x(), location.y(), width(), height()); ChromeViews::Label* label = new ChromeViews::Label(text); label->SetMultiLine(true); diff --git a/chrome/browser/views/old_frames/simple_xp_frame.cc b/chrome/browser/views/old_frames/simple_xp_frame.cc index 44a5a54..550ceef 100644 --- a/chrome/browser/views/old_frames/simple_xp_frame.cc +++ b/chrome/browser/views/old_frames/simple_xp_frame.cc @@ -195,13 +195,13 @@ void SimpleXPFrameTitleBar::RunMenu(ChromeViews::View* source, // when the UI layout is RTL and hence we use the mirroring transformation // flag. We also adjust the menu position because RTL menus use a different // anchor point. - CPoint p(menu_button_->GetX(APPLY_MIRRORING_TRANSFORMATION), - menu_button_->y() + menu_button_->height()); + gfx::Point p(menu_button_->GetX(APPLY_MIRRORING_TRANSFORMATION), + menu_button_->y() + menu_button_->height()); if (UILayoutIsRightToLeft()) - p.x += menu_button_->width(); + p.set_x(p.x() + menu_button_->width()); View::ConvertPointToScreen(this, &p); - parent_->RunMenu(p, hwnd); + parent_->RunMenu(p.ToPOINT(), hwnd); } void SimpleXPFrameTitleBar::Layout() { @@ -342,12 +342,12 @@ void SimpleXPFrame::Layout() { LRESULT SimpleXPFrame::OnNCHitTest(const CPoint& pt) { if (IsTitleBarVisible()) { - CPoint p(pt); + gfx::Point p(pt); ChromeViews::View::ConvertPointToView(NULL, title_bar_, &p); - if (!title_bar_->WillHandleMouseEvent(p.x, p.y) && - p.x >= 0 && p.y >= kTopResizeBarHeight && - p.x < title_bar_->width() && - p.y < title_bar_->height()) { + if (!title_bar_->WillHandleMouseEvent(p.x(), p.y()) && + p.x() >= 0 && p.y() >= kTopResizeBarHeight && + p.x() < title_bar_->width() && + p.y() < title_bar_->height()) { return HTCAPTION; } } diff --git a/chrome/browser/views/old_frames/vista_frame.cc b/chrome/browser/views/old_frames/vista_frame.cc index e7cf71d..0d74c7e 100644 --- a/chrome/browser/views/old_frames/vista_frame.cc +++ b/chrome/browser/views/old_frames/vista_frame.cc @@ -588,18 +588,18 @@ gfx::Rect VistaFrame::GetBoundsForContentBounds(const gfx::Rect content_rect) { Layout(); } - CPoint p(0, 0); + gfx::Point p; ChromeViews::View::ConvertPointToViewContainer(tab_contents_container_, &p); CRect bounds; GetBounds(&bounds, true); gfx::Rect r; - r.set_x(content_rect.x() - p.x); - r.set_y(content_rect.y() - p.y); - r.set_width(p.x + content_rect.width() + - (bounds.Width() - (p.x + tab_contents_container_->width()))); - r.set_height(p.y + content_rect.height() + - (bounds.Height() - (p.y + + r.set_x(content_rect.x() - p.x()); + r.set_y(content_rect.y() - p.y()); + r.set_width(p.x() + content_rect.width() + + (bounds.Width() - (p.x() + tab_contents_container_->width()))); + r.set_height(p.y() + content_rect.height() + + (bounds.Height() - (p.y() + tab_contents_container_->height()))); return r; } @@ -972,14 +972,14 @@ LRESULT VistaFrame::OnNCHitTest(const CPoint& pt) { CRect cr; GetBounds(&cr, false); - CPoint tab_pt(pt); + gfx::Point tab_pt(pt); ChromeViews::View::ConvertPointToView(NULL, tabstrip_, &tab_pt); // If we are over the tabstrip - if (tab_pt.x > 0 && tab_pt.y >= kTabShadowSize && - tab_pt.x < tabstrip_->width() && - tab_pt.y < tabstrip_->height()) { - ChromeViews::View* v = tabstrip_->GetViewForPoint(tab_pt); + if (tab_pt.x() > 0 && tab_pt.y() >= kTabShadowSize && + tab_pt.x() < tabstrip_->width() && + tab_pt.y() < tabstrip_->height()) { + ChromeViews::View* v = tabstrip_->GetViewForPoint(tab_pt.ToPOINT()); if (v == tabstrip_) return HTCAPTION; @@ -1363,10 +1363,10 @@ bool VistaFrame::VistaFrameView::ShouldForwardToTabStrip( if (min_x != std::numeric_limits<int>::max() && max_x != std::numeric_limits<int>::min() && max_y != std::numeric_limits<int>::min()) { - CPoint screen_drag_point(event.x(), event.y()); + gfx::Point screen_drag_point(event.x(), event.y()); ConvertPointToScreen(this, &screen_drag_point); - if (screen_drag_point.x >= min_x && screen_drag_point.x <= max_x && - screen_drag_point.y <= max_y) { + if (screen_drag_point.x() >= min_x && screen_drag_point.x() <= max_x && + screen_drag_point.y() <= max_y) { return false; } } diff --git a/chrome/browser/views/old_frames/xp_frame.cc b/chrome/browser/views/old_frames/xp_frame.cc index 36f6111..4b9cc09 100644 --- a/chrome/browser/views/old_frames/xp_frame.cc +++ b/chrome/browser/views/old_frames/xp_frame.cc @@ -1388,19 +1388,19 @@ LRESULT XPFrame::OnNCHitTest(const CPoint& pt) { return HTCAPTION; } - CPoint tsp(p); + gfx::Point tsp(p); ChromeViews::View::ConvertPointToView(&root_view_, tabstrip_, &tsp); // If the mouse is over the tabstrip. Check if we should move the window or // capture the mouse. - if (tabstrip_->CanProcessInputEvents() && tabstrip_->HitTest(tsp)) { + if (tabstrip_->CanProcessInputEvents() && tabstrip_->HitTest(tsp.ToPOINT())) { // The top few pixels of a tab strip are a dropshadow - as we're pretty // starved of draggable area, let's give it to window dragging (this // also makes sense visually. - if (!IsZoomed() && tsp.y < kTabShadowSize) + if (!IsZoomed() && tsp.y() < kTabShadowSize) return HTCAPTION; - ChromeViews::View* v = tabstrip_->GetViewForPoint(tsp); + ChromeViews::View* v = tabstrip_->GetViewForPoint(tsp.ToPOINT()); // If there is not tab at this location, claim the hit was in the title // bar to get a move action. if (v == tabstrip_) @@ -1815,18 +1815,18 @@ gfx::Rect XPFrame::GetBoundsForContentBounds(const gfx::Rect content_rect) { Layout(); } - CPoint p(0, 0); + gfx::Point p; ChromeViews::View::ConvertPointToViewContainer(tab_contents_container_, &p); CRect bounds; GetBounds(&bounds, true); gfx::Rect r; - r.set_x(content_rect.x() - p.x); - r.set_y(content_rect.y() - p.y); - r.set_width(p.x + content_rect.width() + - (bounds.Width() - (p.x + tab_contents_container_->width()))); - r.set_height(p.y + content_rect.height() + - (bounds.Height() - (p.y + + r.set_x(content_rect.x() - p.x()); + r.set_y(content_rect.y() - p.y()); + r.set_width(p.x() + content_rect.width() + + (bounds.Width() - (p.x() + tab_contents_container_->width()))); + r.set_height(p.y() + content_rect.height() + + (bounds.Height() - (p.y() + tab_contents_container_->height()))); return r; } diff --git a/chrome/browser/views/status_bubble.cc b/chrome/browser/views/status_bubble.cc index d3efa85..9021634 100644 --- a/chrome/browser/views/status_bubble.cc +++ b/chrome/browser/views/status_bubble.cc @@ -567,12 +567,12 @@ void StatusBubble::AvoidMouse() { GetCursorPos(&cursor_location); // Get the position of the frame. - CPoint top_left(0, 0); + gfx::Point top_left; ChromeViews::View::ConvertPointToScreen(frame_->GetRootView(), &top_left); // Get the cursor position relative to the popup. - cursor_location.x -= (top_left.x + position_.x); - cursor_location.y -= (top_left.y + position_.y); + cursor_location.x -= (top_left.x() + position_.x); + cursor_location.y -= (top_left.y() + position_.y); // If the mouse is in a position where we think it would move the // status bubble, figure out where and how the bubble should be moved. @@ -605,15 +605,15 @@ void StatusBubble::AvoidMouse() { } offset_ = offset; - popup_->MoveWindow(top_left.x + position_.x, - top_left.y + position_.y + offset_, + popup_->MoveWindow(top_left.x() + position_.x, + top_left.y() + position_.y + offset_, size_.cx, size_.cy); } else if (offset_ != 0) { offset_ = 0; view_->SetStyle(StatusView::STYLE_STANDARD); - popup_->MoveWindow(top_left.x + position_.x, - top_left.y + position_.y, + popup_->MoveWindow(top_left.x() + position_.x, + top_left.y() + position_.y, size_.cx, size_.cy); } @@ -621,11 +621,11 @@ void StatusBubble::AvoidMouse() { void StatusBubble::Reposition() { if (popup_) { - CPoint top_left(0, 0); + gfx::Point top_left; ChromeViews::View::ConvertPointToScreen(frame_->GetRootView(), &top_left); - popup_->MoveWindow(top_left.x + position_.x, - top_left.y + position_.y, + popup_->MoveWindow(top_left.x() + position_.x, + top_left.y() + position_.y, size_.cx, size_.cy); } diff --git a/chrome/browser/views/tabs/dragged_tab_controller.cc b/chrome/browser/views/tabs/dragged_tab_controller.cc index ef649e8..bb93238 100644 --- a/chrome/browser/views/tabs/dragged_tab_controller.cc +++ b/chrome/browser/views/tabs/dragged_tab_controller.cc @@ -71,10 +71,10 @@ class WindowFinder { gfx::Point ConvertScreenPointToTabStripPoint(TabStrip* tabstrip, const gfx::Point& screen_point) { - CPoint tabstrip_topleft(0, 0); + gfx::Point tabstrip_topleft; ChromeViews::View::ConvertPointToScreen(tabstrip, &tabstrip_topleft); - return gfx::Point(screen_point.x() - tabstrip_topleft.x, - screen_point.y() - tabstrip_topleft.y); + return gfx::Point(screen_point.x() - tabstrip_topleft.x(), + screen_point.y() - tabstrip_topleft.y()); } } @@ -271,11 +271,10 @@ void DraggedTabController::DidProcessMessage(const MSG& msg) { // DraggedTabController, private: void DraggedTabController::InitWindowCreatePoint() { - CPoint mouse_offset_cpoint(mouse_offset_.x(), mouse_offset_.y()); + window_create_point_.SetPoint(mouse_offset_.x(), mouse_offset_.y()); Tab* first_tab = attached_tabstrip_->GetTabAt(0); ChromeViews::View::ConvertPointToViewContainer(first_tab, - &mouse_offset_cpoint); - window_create_point_.SetPoint(mouse_offset_cpoint.x, mouse_offset_cpoint.y); + &window_create_point_); } gfx::Point DraggedTabController::GetWindowCreatePoint() const { @@ -727,11 +726,11 @@ gfx::Point DraggedTabController::GetCursorScreenPoint() const { gfx::Rect DraggedTabController::GetViewScreenBounds( ChromeViews::View* view) const { - CPoint view_topleft(0, 0); + gfx::Point view_topleft; ChromeViews::View::ConvertPointToScreen(view, &view_topleft); CRect view_screen_bounds; view->GetLocalBounds(&view_screen_bounds, true); - view_screen_bounds.OffsetRect(view_topleft); + view_screen_bounds.OffsetRect(view_topleft.ToPOINT()); return gfx::Rect(view_screen_bounds); } diff --git a/chrome/browser/views/tabs/tab_strip.cc b/chrome/browser/views/tabs/tab_strip.cc index 083036b..7e70083 100644 --- a/chrome/browser/views/tabs/tab_strip.cc +++ b/chrome/browser/views/tabs/tab_strip.cc @@ -527,8 +527,8 @@ bool TabStrip::CanProcessInputEvents() const { return IsAnimating() == NULL; } -bool TabStrip::PointIsWithinWindowCaption(const CPoint& point) { - ChromeViews::View* v = GetViewForPoint(point); +bool TabStrip::PointIsWithinWindowCaption(const gfx::Point& point) { + ChromeViews::View* v = GetViewForPoint(point.ToPOINT()); // If there is no control at this location, claim the hit was in the title // bar to get a move action. @@ -543,10 +543,10 @@ bool TabStrip::PointIsWithinWindowCaption(const CPoint& point) { // Check to see if the point is within the non-button parts of the new tab // button. The button has a non-rectangular shape, so if it's not in the // visual portions of the button we treat it as a click to the caption. - CPoint point_in_newtab_coords(point); + gfx::Point point_in_newtab_coords(point); View::ConvertPointToView(this, newtab_button_, &point_in_newtab_coords); - if (newtab_button_->bounds().Contains(gfx::Point(point)) && - !newtab_button_->HitTest(point_in_newtab_coords)) { + if (newtab_button_->bounds().Contains(point) && + !newtab_button_->HitTest(point_in_newtab_coords.ToPOINT())) { return true; } @@ -1241,9 +1241,9 @@ void TabStrip::ResizeLayoutTabs() { bool TabStrip::IsCursorInTabStripZone() { CRect bounds; GetLocalBounds(&bounds, true); - CPoint tabstrip_topleft = bounds.TopLeft(); + gfx::Point tabstrip_topleft(bounds.TopLeft()); View::ConvertPointToScreen(this, &tabstrip_topleft); - bounds.MoveToXY(tabstrip_topleft); + bounds.MoveToXY(tabstrip_topleft.ToPOINT()); bounds.bottom += kTabStripAnimationVSlop; CPoint cursor_point; @@ -1309,9 +1309,10 @@ gfx::Rect TabStrip::GetDropBounds(int drop_index, center_x = MirroredXCoordinateInsideView(center_x); // Determine the screen bounds. - CPoint drop_loc(center_x - drop_indicator_width / 2, -drop_indicator_height); + gfx::Point drop_loc(center_x - drop_indicator_width / 2, + -drop_indicator_height); ConvertPointToScreen(this, &drop_loc); - gfx::Rect drop_bounds(drop_loc.x, drop_loc.y, drop_indicator_width, + gfx::Rect drop_bounds(drop_loc.x(), drop_loc.y(), drop_indicator_width, drop_indicator_height); // If the rect doesn't fit on the monitor, push the arrow to the bottom. @@ -1566,8 +1567,8 @@ int TabStrip::GetAvailableWidthForTabs(Tab* last_tab) const { } bool TabStrip::IsPointInTab(Tab* tab, const CPoint& point_in_tabstrip_coords) { - CPoint point_in_tab_coords(point_in_tabstrip_coords); + gfx::Point point_in_tab_coords(point_in_tabstrip_coords); View::ConvertPointToView(this, tab, &point_in_tab_coords); - return tab->HitTest(point_in_tab_coords); + return tab->HitTest(point_in_tab_coords.ToPOINT()); } diff --git a/chrome/browser/views/tabs/tab_strip.h b/chrome/browser/views/tabs/tab_strip.h index 656dd12..ea50fd4 100644 --- a/chrome/browser/views/tabs/tab_strip.h +++ b/chrome/browser/views/tabs/tab_strip.h @@ -66,7 +66,7 @@ class TabStrip : public ChromeViews::View, // portion of the TabStrip that should be treated as the containing Window's // titlebar for dragging purposes. // TODO(beng): (Cleanup) should be const, but GetViewForPoint isn't, so fie! - bool PointIsWithinWindowCaption(const CPoint& point); + bool PointIsWithinWindowCaption(const gfx::Point& point); // Return true if this tab strip is compatible with the provided tab strip. // Compatible tab strips can transfer tabs during drag and drop. diff --git a/chrome/browser/views/toolbar_star_toggle.cc b/chrome/browser/views/toolbar_star_toggle.cc index d6b1740..050fc02 100644 --- a/chrome/browser/views/toolbar_star_toggle.cc +++ b/chrome/browser/views/toolbar_star_toggle.cc @@ -37,12 +37,12 @@ void ToolbarStarToggle::ShowStarBubble(const GURL& url, bool newly_bookmarked) { return; } - CPoint star_location(0, 0); + gfx::Point star_location; ChromeViews::View::ConvertPointToScreen(this, &star_location); // Shift the x location by 1 as visually the center of the star appears 1 // pixel to the right. By doing this bubble arrow points to the center // of the star. - gfx::Rect star_bounds(star_location.x + 1, star_location.y, width(), + gfx::Rect star_bounds(star_location.x() + 1, star_location.y(), width(), height()); BookmarkBubbleView::Show(host_->browser()->GetTopLevelHWND(), star_bounds, this, host_->profile(), url, newly_bookmarked); |