summaryrefslogtreecommitdiffstats
path: root/chrome/views
diff options
context:
space:
mode:
Diffstat (limited to 'chrome/views')
-rw-r--r--chrome/views/background.cc2
-rw-r--r--chrome/views/base_button.cc8
-rw-r--r--chrome/views/bitmap_scroll_bar.cc40
-rw-r--r--chrome/views/border.cc24
-rw-r--r--chrome/views/button.cc8
-rw-r--r--chrome/views/button_dropdown.cc8
-rw-r--r--chrome/views/checkbox.cc10
-rw-r--r--chrome/views/chrome_menu.cc118
-rw-r--r--chrome/views/client_view.cc112
-rw-r--r--chrome/views/client_view.h158
-rw-r--r--chrome/views/combo_box.cc2
-rw-r--r--chrome/views/custom_frame_window.cc59
-rw-r--r--chrome/views/dialog_client_view.cc14
-rw-r--r--chrome/views/event.h4
-rw-r--r--chrome/views/focus_manager_unittest.cc2
-rw-r--r--chrome/views/grid_layout.cc2
-rw-r--r--chrome/views/grid_layout_unittest.cc8
-rw-r--r--chrome/views/image_view.cc8
-rw-r--r--chrome/views/label.cc16
-rw-r--r--chrome/views/link.cc4
-rw-r--r--chrome/views/menu_button.cc12
-rw-r--r--chrome/views/native_button.cc2
-rw-r--r--chrome/views/native_scroll_bar.cc4
-rw-r--r--chrome/views/non_client_view.cc18
-rw-r--r--chrome/views/painter.h2
-rw-r--r--chrome/views/radio_button.cc4
-rw-r--r--chrome/views/resize_corner.cc2
-rw-r--r--chrome/views/root_view.cc24
-rw-r--r--chrome/views/scroll_view.cc70
-rw-r--r--chrome/views/separator.cc4
-rw-r--r--chrome/views/tabbed_pane.cc4
-rw-r--r--chrome/views/table_view.cc4
-rw-r--r--chrome/views/text_button.cc6
-rw-r--r--chrome/views/text_field.cc2
-rw-r--r--chrome/views/throbber.cc4
-rw-r--r--chrome/views/tree_view.cc6
-rw-r--r--chrome/views/view.cc64
-rw-r--r--chrome/views/view.h28
-rw-r--r--chrome/views/view_unittest.cc16
-rw-r--r--chrome/views/window.cc4
40 files changed, 442 insertions, 445 deletions
diff --git a/chrome/views/background.cc b/chrome/views/background.cc
index 3371670..3734a6e 100644
--- a/chrome/views/background.cc
+++ b/chrome/views/background.cc
@@ -48,7 +48,7 @@ class BackgroundPainter : public ChromeViews::Background {
void Paint(ChromeCanvas* canvas, View* view) const {
- Painter::PaintPainterAt(0, 0, view->GetWidth(), view->GetHeight(), canvas,
+ Painter::PaintPainterAt(0, 0, view->width(), view->height(), canvas,
painter_);
}
diff --git a/chrome/views/base_button.cc b/chrome/views/base_button.cc
index 59b49ef..e9ab838 100644
--- a/chrome/views/base_button.cc
+++ b/chrome/views/base_button.cc
@@ -144,7 +144,7 @@ void BaseButton::SetTooltipText(const std::wstring& tooltip) {
bool BaseButton::OnMousePressed(const ChromeViews::MouseEvent& e) {
if (state_ != BS_DISABLED) {
- if (IsTriggerableEvent(e) && HitTest(WTL::CPoint(e.GetX(), e.GetY()))) {
+ if (IsTriggerableEvent(e) && HitTest(WTL::CPoint(e.x(), e.y()))) {
SetState(BS_PUSHED);
}
if (IsFocusable())
@@ -155,7 +155,7 @@ bool BaseButton::OnMousePressed(const ChromeViews::MouseEvent& e) {
bool BaseButton::OnMouseDragged(const ChromeViews::MouseEvent& e) {
if (state_ != BS_DISABLED) {
- if (!HitTest(WTL::CPoint(e.GetX(), e.GetY())))
+ if (!HitTest(WTL::CPoint(e.x(), e.y())))
SetState(BS_NORMAL);
else if (IsTriggerableEvent(e))
SetState(BS_PUSHED);
@@ -173,7 +173,7 @@ void BaseButton::OnMouseReleased(const ChromeViews::MouseEvent& e,
}
if (state_ != BS_DISABLED) {
- if (canceled || !HitTest(WTL::CPoint(e.GetX(), e.GetY()))) {
+ if (canceled || !HitTest(WTL::CPoint(e.x(), e.y()))) {
SetState(BS_NORMAL);
} else {
SetState(BS_HOT);
@@ -198,7 +198,7 @@ void BaseButton::OnMouseMoved(const ChromeViews::MouseEvent& e) {
using namespace ChromeViews;
if (state_ != BS_DISABLED) {
- if (HitTest(WTL::CPoint(e.GetX(), e.GetY()))) {
+ if (HitTest(WTL::CPoint(e.x(), e.y()))) {
SetState(BS_HOT);
} else {
SetState(BS_NORMAL);
diff --git a/chrome/views/bitmap_scroll_bar.cc b/chrome/views/bitmap_scroll_bar.cc
index a0656e7..7dcf18e 100644
--- a/chrome/views/bitmap_scroll_bar.cc
+++ b/chrome/views/bitmap_scroll_bar.cc
@@ -146,14 +146,14 @@ class BitmapScrollBarThumb : public View {
canvas->DrawBitmapInt(*start_cap_bitmap(), 0, 0);
int top_cap_height = start_cap_bitmap()->height();
int bottom_cap_height = end_cap_bitmap()->height();
- int thumb_body_height = GetHeight() - top_cap_height - bottom_cap_height;
+ int thumb_body_height = height() - top_cap_height - bottom_cap_height;
canvas->TileImageInt(*background_bitmap(), 0, top_cap_height,
background_bitmap()->width(), thumb_body_height);
canvas->DrawBitmapInt(*end_cap_bitmap(), 0,
- GetHeight() - bottom_cap_height);
+ height() - bottom_cap_height);
// Paint the grippy over the track.
- int grippy_x = (GetWidth() - grippy_bitmap()->width()) / 2;
+ int grippy_x = (width() - grippy_bitmap()->width()) / 2;
int grippy_y = (thumb_body_height - grippy_bitmap()->height()) / 2;
canvas->DrawBitmapInt(*grippy_bitmap(), grippy_x, grippy_y);
}
@@ -167,7 +167,7 @@ class BitmapScrollBarThumb : public View {
}
virtual bool OnMousePressed(const MouseEvent& event) {
- mouse_offset_ = scroll_bar_->IsHorizontal() ? event.GetX() : event.GetY();
+ mouse_offset_ = scroll_bar_->IsHorizontal() ? event.x() : event.y();
drag_start_position_ = GetPosition();
SetState(BaseButton::BS_PUSHED);
return true;
@@ -178,24 +178,24 @@ class BitmapScrollBarThumb : public View {
// the bounds of the thumb, the scrollbar will snap the scroll back to the
// point it was at before the drag began.
if (scroll_bar_->IsHorizontal()) {
- if ((event.GetY() < GetY() - kScrollThumbDragOutSnap) ||
- (event.GetY() > (GetY() + GetHeight() + kScrollThumbDragOutSnap))) {
+ if ((event.y() < y() - kScrollThumbDragOutSnap) ||
+ (event.y() > (y() + height() + kScrollThumbDragOutSnap))) {
scroll_bar_->ScrollToThumbPosition(drag_start_position_, false);
return true;
}
} else {
- if ((event.GetX() < GetX() - kScrollThumbDragOutSnap) ||
- (event.GetX() > (GetX() + GetWidth() + kScrollThumbDragOutSnap))) {
+ if ((event.x() < x() - kScrollThumbDragOutSnap) ||
+ (event.x() > (x() + width() + kScrollThumbDragOutSnap))) {
scroll_bar_->ScrollToThumbPosition(drag_start_position_, false);
return true;
}
}
if (scroll_bar_->IsHorizontal()) {
- int thumb_x = event.GetX() - mouse_offset_;
- scroll_bar_->ScrollToThumbPosition(GetX() + thumb_x, false);
+ int thumb_x = event.x() - mouse_offset_;
+ scroll_bar_->ScrollToThumbPosition(x() + thumb_x, false);
} else {
- int thumb_y = event.GetY() - mouse_offset_;
- scroll_bar_->ScrollToThumbPosition(GetY() + thumb_y, false);
+ int thumb_y = event.y() - mouse_offset_;
+ scroll_bar_->ScrollToThumbPosition(y() + thumb_y, false);
}
return true;
}
@@ -292,14 +292,14 @@ gfx::Rect BitmapScrollBar::GetTrackBounds() const {
if (!show_scroll_buttons_)
prefsize.cx = 0;
int new_width = std::max(0,
- static_cast<int>(GetWidth() - (prefsize.cx * 2)));
+ static_cast<int>(width() - (prefsize.cx * 2)));
gfx::Rect track_bounds(prefsize.cx, 0, new_width, prefsize.cy);
return track_bounds;
}
if (!show_scroll_buttons_)
prefsize.cy = 0;
gfx::Rect track_bounds(0, prefsize.cy, prefsize.cx,
- std::max(0l, GetHeight() - (prefsize.cy * 2)));
+ std::max(0l, height() - (prefsize.cy * 2)));
return track_bounds;
}
@@ -417,10 +417,10 @@ void BitmapScrollBar::Layout() {
prev_button_->SetBounds(0, 0, prefsize.cx, prefsize.cy);
next_button_->GetPreferredSize(&prefsize);
if (IsHorizontal()) {
- next_button_->SetBounds(GetWidth() - prefsize.cx, 0, prefsize.cx,
+ next_button_->SetBounds(width() - prefsize.cx, 0, prefsize.cx,
prefsize.cy);
} else {
- next_button_->SetBounds(0, GetHeight() - prefsize.cy, prefsize.cx,
+ next_button_->SetBounds(0, height() - prefsize.cy, prefsize.cx,
prefsize.cy);
}
} else {
@@ -468,15 +468,15 @@ bool BitmapScrollBar::OnMousePressed(const MouseEvent& event) {
CRect thumb_bounds;
thumb_->GetBounds(&thumb_bounds);
if (IsHorizontal()) {
- if (event.GetX() < thumb_bounds.left) {
+ if (event.x() < thumb_bounds.left) {
last_scroll_amount_ = SCROLL_PREV_PAGE;
- } else if (event.GetX() > thumb_bounds.right) {
+ } else if (event.x() > thumb_bounds.right) {
last_scroll_amount_ = SCROLL_NEXT_PAGE;
}
} else {
- if (event.GetY() < thumb_bounds.top) {
+ if (event.y() < thumb_bounds.top) {
last_scroll_amount_ = SCROLL_PREV_PAGE;
- } else if (event.GetY() > thumb_bounds.bottom) {
+ } else if (event.y() > thumb_bounds.bottom) {
last_scroll_amount_ = SCROLL_NEXT_PAGE;
}
}
diff --git a/chrome/views/border.cc b/chrome/views/border.cc
index 4b71707..7298583 100644
--- a/chrome/views/border.cc
+++ b/chrome/views/border.cc
@@ -39,25 +39,25 @@ void SolidBorder::Paint(const View& view, ChromeCanvas* canvas) const {
return; // Empty clip rectangle, nothing to paint.
// Top border.
- gfx::Rect border_bounds(0, 0, view.GetWidth(), insets_.top());
+ gfx::Rect border_bounds(0, 0, view.width(), insets_.top());
if (clip_rect.Intersects(border_bounds))
- canvas->FillRectInt(color_, 0, 0, view.GetWidth(), insets_.top());
+ canvas->FillRectInt(color_, 0, 0, view.width(), insets_.top());
// Left border.
- border_bounds.SetRect(0, 0, insets_.left(), view.GetHeight());
+ border_bounds.SetRect(0, 0, insets_.left(), view.height());
if (clip_rect.Intersects(border_bounds))
- canvas->FillRectInt(color_, 0, 0, insets_.left(), view.GetHeight());
+ canvas->FillRectInt(color_, 0, 0, insets_.left(), view.height());
// Bottom border.
- border_bounds.SetRect(0, view.GetHeight() - insets_.bottom(),
- view.GetWidth(), insets_.bottom());
+ border_bounds.SetRect(0, view.height() - insets_.bottom(),
+ view.width(), insets_.bottom());
if (clip_rect.Intersects(border_bounds))
- canvas->FillRectInt(color_, 0, view.GetHeight() - insets_.bottom(),
- view.GetWidth(), insets_.bottom());
+ canvas->FillRectInt(color_, 0, view.height() - insets_.bottom(),
+ view.width(), insets_.bottom());
// Right border.
- border_bounds.SetRect(view.GetWidth() - insets_.right(), 0,
- insets_.right(), view.GetHeight());
+ border_bounds.SetRect(view.width() - insets_.right(), 0,
+ insets_.right(), view.height());
if (clip_rect.Intersects(border_bounds))
- canvas->FillRectInt(color_, view.GetWidth() - insets_.right(), 0,
- insets_.right(), view.GetHeight());
+ canvas->FillRectInt(color_, view.width() - insets_.right(), 0,
+ insets_.right(), view.height());
}
void SolidBorder::GetInsets(gfx::Insets* insets) const {
diff --git a/chrome/views/button.cc b/chrome/views/button.cc
index 2476652..5489841 100644
--- a/chrome/views/button.cc
+++ b/chrome/views/button.cc
@@ -92,14 +92,14 @@ void Button::Paint(ChromeCanvas* canvas) {
int x = 0, y = 0;
if (h_alignment_ == ALIGN_CENTER)
- x = (GetWidth() - img.width()) / 2;
+ x = (width() - img.width()) / 2;
else if (h_alignment_ == ALIGN_RIGHT)
- x = GetWidth() - img.width();
+ x = width() - img.width();
if (v_alignment_ == ALIGN_MIDDLE)
- y = (GetHeight() - img.height()) / 2;
+ y = (height() - img.height()) / 2;
else if (v_alignment_ == ALIGN_BOTTOM)
- y = GetHeight() - img.height();
+ y = height() - img.height();
canvas->DrawBitmapInt(img, x, y);
}
diff --git a/chrome/views/button_dropdown.cc b/chrome/views/button_dropdown.cc
index bec2e88..aef0e1d 100644
--- a/chrome/views/button_dropdown.cc
+++ b/chrome/views/button_dropdown.cc
@@ -40,11 +40,11 @@ ButtonDropDown::~ButtonDropDown() {
////////////////////////////////////////////////////////////////////////////////
bool ButtonDropDown::OnMousePressed(const ChromeViews::MouseEvent& e) {
- if (IsEnabled() && e.IsLeftMouseButton() && HitTest(WTL::CPoint(e.GetX(), e.GetY()))) {
+ if (IsEnabled() && e.IsLeftMouseButton() && HitTest(WTL::CPoint(e.x(), e.y()))) {
// Store the y pos of the mouse coordinates so we can use them later to
// determine if the user dragged the mouse down (which should pop up the
// drag down menu immediately, instead of waiting for the timer)
- y_position_on_lbuttondown_ = e.GetY();
+ y_position_on_lbuttondown_ = e.y();
// Schedule a task that will show the menu.
MessageLoop::current()->PostDelayedTask(FROM_HERE,
@@ -66,7 +66,7 @@ void ButtonDropDown::OnMouseReleased(const ChromeViews::MouseEvent& e,
if (e.IsLeftMouseButton())
show_menu_factory_.RevokeAll();
- if (IsEnabled() && e.IsRightMouseButton() && HitTest(WTL::CPoint(e.GetX(), e.GetY()))) {
+ if (IsEnabled() && e.IsRightMouseButton() && HitTest(WTL::CPoint(e.x(), e.y()))) {
show_menu_factory_.RevokeAll();
// Make the button look depressed while the menu is open.
// NOTE: SetState() schedules a paint, but it won't occur until after the
@@ -90,7 +90,7 @@ bool ButtonDropDown::OnMouseDragged(const ChromeViews::MouseEvent& e) {
// If the mouse is dragged to a y position lower than where it was when
// clicked then we should not wait for the menu to appear but show
// it immediately.
- if (e.GetY() > y_position_on_lbuttondown_ + dragging_threshold) {
+ if (e.y() > y_position_on_lbuttondown_ + dragging_threshold) {
show_menu_factory_.RevokeAll();
ShowDropDownMenu(GetViewContainer()->GetHWND());
}
diff --git a/chrome/views/checkbox.cc b/chrome/views/checkbox.cc
index ee9f1af..0b59e9c 100644
--- a/chrome/views/checkbox.cc
+++ b/chrome/views/checkbox.cc
@@ -61,7 +61,7 @@ std::string CheckBox::GetClassName() const {
void CheckBox::Layout() {
int label_x = GetTextIndent();
- label_->SetBounds(label_x, 0, GetWidth() - label_x, GetHeight());
+ label_->SetBounds(label_x, 0, width() - label_x, height());
if (hwnd_view_) {
int first_line_height = label_->GetFont().height();
hwnd_view_->SetBounds(0, ((first_line_height - kCheckBoxHeight) / 2) + 1,
@@ -75,7 +75,7 @@ void CheckBox::ComputeTextRect(gfx::Rect* out) {
label_->GetPreferredSize(&s);
out->set_x(GetTextIndent());
out->set_y(kFocusPaddingVertical);
- int new_width = std::min(GetWidth() - (kCheckBoxWidth + kCheckBoxToLabel),
+ int new_width = std::min(width() - (kCheckBoxWidth + kCheckBoxToLabel),
static_cast<int>(s.cx));
out->set_width(std::max(0, new_width));
out->set_height(s.cy);
@@ -105,7 +105,7 @@ HWND CheckBox::CreateNativeControl(HWND parent_container) {
L"BUTTON",
L"",
WS_CHILD | BS_CHECKBOX | WS_VISIBLE,
- 0, 0, GetWidth(), GetHeight(),
+ 0, 0, width(), height(),
parent_container, NULL, NULL, NULL);
ConfigureNativeButton(r);
return r;
@@ -141,10 +141,10 @@ void CheckBox::HighlightButton(bool f) {
}
bool CheckBox::LabelHitTest(const MouseEvent& event) {
- CPoint p(event.GetX(), event.GetY());
+ CPoint p(event.x(), event.y());
gfx::Rect r;
ComputeTextRect(&r);
- return r.Contains(event.GetX(), event.GetY());
+ return r.Contains(event.x(), event.y());
}
void CheckBox::OnMouseEntered(const MouseEvent& event) {
diff --git a/chrome/views/chrome_menu.cc b/chrome/views/chrome_menu.cc
index 33452cd..360f8c4 100644
--- a/chrome/views/chrome_menu.cc
+++ b/chrome/views/chrome_menu.cc
@@ -175,7 +175,7 @@ namespace {
// Convenience for scrolling the view such that the origin is visible.
static void ScrollToVisible(View* view) {
- view->ScrollRectToVisible(0, 0, view->GetWidth(), view->GetHeight());
+ view->ScrollRectToVisible(0, 0, view->width(), view->height());
}
// MenuScrollTask --------------------------------------------------------------
@@ -234,7 +234,7 @@ public:
if (is_scrolling_up_)
target_y = std::max(0, target_y - delta_y);
else
- target_y = std::min(submenu_->GetHeight() - vis_rect.height(),
+ target_y = std::min(submenu_->height() - vis_rect.height(),
target_y + delta_y);
submenu_->ScrollRectToVisible(vis_rect.x(), target_y, vis_rect.width(),
vis_rect.height());
@@ -309,14 +309,14 @@ class MenuScrollButton : public View {
HDC dc = canvas->beginPlatformPaint();
// The background.
- RECT item_bounds = { 0, 0, GetWidth(), GetHeight() };
+ RECT item_bounds = { 0, 0, width(), height() };
NativeTheme::instance()->PaintMenuItemBackground(
NativeTheme::MENU, dc, MENU_POPUPITEM, MPI_NORMAL, false,
&item_bounds);
// Then the arrow.
- int x = GetWidth() / 2;
- int y = (GetHeight() - kScrollArrowHeight) / 2;
+ int x = width() / 2;
+ int y = (height() - kScrollArrowHeight) / 2;
int delta_y = 1;
if (!is_up_) {
delta_y = -1;
@@ -363,11 +363,11 @@ class MenuScrollView : public View {
View* child = GetContents();
// Convert y to view's coordinates.
- y -= child->GetY();
+ y -= child->y();
CSize pref;
child->GetPreferredSize(&pref);
// Constrain y to make sure we don't show past the bottom of the view.
- y = std::max(0, std::min(static_cast<int>(pref.cy) - GetHeight(), y));
+ y = std::max(0, std::min(static_cast<int>(pref.cy) - this->height(), y));
child->SetY(-y);
}
@@ -403,7 +403,7 @@ class MenuScrollViewContainer : public View {
virtual void Paint(ChromeCanvas* canvas) {
HDC dc = canvas->beginPlatformPaint();
- CRect bounds(0, 0, GetWidth(), GetHeight());
+ CRect bounds(0, 0, width(), height());
NativeTheme::instance()->PaintMenuBackground(
NativeTheme::MENU, dc, MENU_POPUPBACKGROUND, 0, &bounds);
canvas->endPlatformPaint();
@@ -417,8 +417,8 @@ class MenuScrollViewContainer : public View {
gfx::Insets insets = GetInsets();
int x = insets.left();
int y = insets.top();
- int width = GetWidth() - insets.width();
- int content_height = GetHeight() - insets.height();
+ int width = View::width() - insets.width();
+ int content_height = height() - insets.height();
if (!scroll_up_button_->IsVisible()) {
scroll_view_->SetBounds(x, y, width, content_height);
scroll_view_->Layout();
@@ -433,7 +433,7 @@ class MenuScrollViewContainer : public View {
const int scroll_view_y = y + pref.cy;
scroll_down_button_->GetPreferredSize(&pref);
- scroll_down_button_->SetBounds(x, GetHeight() - pref.cy - insets.top(),
+ scroll_down_button_->SetBounds(x, height() - pref.cy - insets.top(),
width, pref.cy);
content_height -= pref.cy;
@@ -444,8 +444,8 @@ class MenuScrollViewContainer : public View {
virtual void DidChangeBounds(const CRect& previous, const CRect& current) {
CSize content_pref;
scroll_view_->GetContents()->GetPreferredSize(&content_pref);
- scroll_up_button_->SetVisible(content_pref.cy > GetHeight());
- scroll_down_button_->SetVisible(content_pref.cy > GetHeight());
+ scroll_up_button_->SetVisible(content_pref.cy > height());
+ scroll_down_button_->SetVisible(content_pref.cy > height());
}
virtual void GetPreferredSize(CSize* out) {
@@ -478,20 +478,20 @@ class MenuSeparator : public View {
void Paint(ChromeCanvas* canvas) {
// The gutter is rendered before the background.
int start_x = 0;
- int start_y = GetHeight() / 3;
+ int start_y = height() / 3;
HDC dc = canvas->beginPlatformPaint();
if (render_gutter) {
// If render_gutter is true, we're on Vista and need to render the
// gutter, then indent the separator from the gutter.
RECT gutter_bounds = { label_start - kGutterToLabel - gutter_width, 0, 0,
- GetHeight() };
+ height() };
gutter_bounds.right = gutter_bounds.left + gutter_width;
NativeTheme::instance()->PaintMenuGutter(dc, MENU_POPUPGUTTER, MPI_NORMAL,
&gutter_bounds);
start_x = gutter_bounds.left + gutter_width;
start_y = 0;
}
- RECT separator_bounds = { start_x, start_y, GetWidth(), GetHeight() };
+ RECT separator_bounds = { start_x, start_y, width(), height() };
NativeTheme::instance()->PaintMenuSeparator(dc, MENU_POPUPSEPARATOR,
MPI_NORMAL, &separator_bounds);
canvas->endPlatformPaint();
@@ -533,8 +533,8 @@ class MenuHostRootView : public RootView {
return true;
forward_drag_to_menu_controller_ =
- ((event.GetX() < 0 || event.GetY() < 0 || event.GetX() >= GetWidth() ||
- event.GetY() >= GetHeight()) ||
+ ((event.x() < 0 || event.y() < 0 || event.x() >= width() ||
+ event.y() >= height()) ||
!RootView::OnMousePressed(event));
if (forward_drag_to_menu_controller_)
GetMenuController()->OnMousePressed(submenu_, event);
@@ -801,12 +801,12 @@ void SubmenuView::Layout() {
return;
CSize pref;
GetPreferredSize(&pref);
- SetBounds(GetX(), GetY(), parent->GetWidth(), pref.cy);
+ SetBounds(x(), y(), parent->width(), pref.cy);
gfx::Insets insets = GetInsets();
int x = insets.left();
int y = insets.top();
- int menu_item_width = GetWidth() - insets.width();
+ int menu_item_width = width() - insets.width();
for (int i = 0; i < GetChildViewCount(); ++i) {
View* child = GetChildViewAt(i);
CSize child_pref_size;
@@ -874,7 +874,7 @@ int SubmenuView::OnPerformDrop(const DropTargetEvent& event) {
bool SubmenuView::OnMouseWheel(const MouseWheelEvent& e) {
gfx::Rect vis_bounds = GetVisibleBounds();
int menu_item_count = GetMenuItemCount();
- if (vis_bounds.height() == GetHeight() || !menu_item_count) {
+ if (vis_bounds.height() == height() || !menu_item_count) {
// All menu items are visible, nothing to scroll.
return true;
}
@@ -884,10 +884,10 @@ bool SubmenuView::OnMouseWheel(const MouseWheelEvent& e) {
int first_vis_index = -1;
for (int i = 0; i < menu_item_count; ++i) {
MenuItemView* menu_item = GetMenuItemAt(i);
- if (menu_item->GetY() == vis_bounds.y()) {
+ if (menu_item->y() == vis_bounds.y()) {
first_vis_index = i;
break;
- } else if (menu_item->GetY() > vis_bounds.y()) {
+ } else if (menu_item->y() > vis_bounds.y()) {
first_vis_index = std::max(0, i - 1);
break;
}
@@ -902,23 +902,23 @@ bool SubmenuView::OnMouseWheel(const MouseWheelEvent& e) {
while (delta-- > 0) {
int scroll_amount = 0;
if (scroll_up) {
- if (GetMenuItemAt(first_vis_index)->GetY() == vis_bounds.y()) {
+ if (GetMenuItemAt(first_vis_index)->y() == vis_bounds.y()) {
if (first_vis_index != 0) {
- scroll_amount = GetMenuItemAt(first_vis_index - 1)->GetY() -
+ scroll_amount = GetMenuItemAt(first_vis_index - 1)->y() -
vis_bounds.y();
first_vis_index--;
} else {
break;
}
} else {
- scroll_amount = GetMenuItemAt(first_vis_index)->GetY() - vis_bounds.y();
+ scroll_amount = GetMenuItemAt(first_vis_index)->y() - vis_bounds.y();
}
} else {
if (first_vis_index + 1 == GetMenuItemCount())
break;
- scroll_amount = GetMenuItemAt(first_vis_index + 1)->GetY() -
+ scroll_amount = GetMenuItemAt(first_vis_index + 1)->y() -
vis_bounds.y();
- if (GetMenuItemAt(first_vis_index)->GetY() == vis_bounds.y())
+ if (GetMenuItemAt(first_vis_index)->y() == vis_bounds.y())
first_vis_index++;
}
ScrollRectToVisible(0, vis_bounds.y() + scroll_amount, vis_bounds.width(),
@@ -1362,7 +1362,7 @@ void MenuItemView::Paint(ChromeCanvas* canvas, bool for_drag) {
// The gutter is rendered before the background.
if (render_gutter && !for_drag) {
RECT gutter_bounds = { label_start - kGutterToLabel - gutter_width, 0, 0,
- GetHeight() };
+ height() };
gutter_bounds.right = gutter_bounds.left + gutter_width;
AdjustBoundsForRTLUI(&gutter_bounds);
NativeTheme::instance()->PaintMenuGutter(dc, MENU_POPUPGUTTER, MPI_NORMAL, &gutter_bounds);
@@ -1370,7 +1370,7 @@ void MenuItemView::Paint(ChromeCanvas* canvas, bool for_drag) {
// Render the background.
if (!for_drag) {
- RECT item_bounds = { 0, 0, GetWidth(), GetHeight() };
+ RECT item_bounds = { 0, 0, width(), height() };
AdjustBoundsForRTLUI(&item_bounds);
NativeTheme::instance()->PaintMenuItemBackground(
NativeTheme::MENU, dc, MENU_POPUPITEM, state, render_selection,
@@ -1378,14 +1378,14 @@ void MenuItemView::Paint(ChromeCanvas* canvas, bool for_drag) {
}
int icon_x = kItemLeftMargin;
- int icon_y = kItemTopMargin + (GetHeight() - kItemTopMargin -
+ int icon_y = kItemTopMargin + (height() - kItemTopMargin -
kItemBottomMargin - check_height) / 2;
int icon_height = check_height;
int icon_width = check_width;
if (type_ == CHECKBOX && GetDelegate()->IsItemChecked(GetCommand())) {
// Draw the check background.
- RECT check_bg_bounds = { 0, 0, icon_x + icon_width, GetHeight() };
+ RECT check_bg_bounds = { 0, 0, icon_x + icon_width, height() };
const int bg_state = IsEnabled() ? MCB_NORMAL : MCB_DISABLED;
AdjustBoundsForRTLUI(&check_bg_bounds);
NativeTheme::instance()->PaintMenuCheckBackground(
@@ -1410,7 +1410,7 @@ void MenuItemView::Paint(ChromeCanvas* canvas, bool for_drag) {
(IsEnabled() ? COLOR_MENUTEXT : COLOR_GRAYTEXT);
SkColor fg_color = NativeTheme::instance()->GetThemeColorWithDefault(
NativeTheme::MENU, MENU_POPUPITEM, state, TMT_TEXTCOLOR, default_sys_color);
- int width = GetWidth() - item_right_margin - label_start;
+ int width = this->width() - item_right_margin - label_start;
gfx::Rect text_bounds(label_start, kItemTopMargin, width, font_.height());
text_bounds.set_x(MirroredLeftPointForRect(text_bounds));
canvas->DrawStringInt(GetTitle(), font_, fg_color, text_bounds.x(),
@@ -1420,7 +1420,7 @@ void MenuItemView::Paint(ChromeCanvas* canvas, bool for_drag) {
if (icon_.width() > 0) {
gfx::Rect icon_bounds(kItemLeftMargin,
- kItemTopMargin + (GetHeight() - kItemTopMargin -
+ kItemTopMargin + (height() - kItemTopMargin -
kItemBottomMargin - icon_.height()) / 2,
icon_.width(),
icon_.height());
@@ -1430,8 +1430,8 @@ void MenuItemView::Paint(ChromeCanvas* canvas, bool for_drag) {
if (HasSubmenu()) {
int state_id = IsEnabled() ? MSM_NORMAL : MSM_DISABLED;
- RECT arrow_bounds = { GetWidth() - item_right_margin + kLabelToArrowPadding,
- 0, 0, GetHeight() };
+ RECT arrow_bounds = { this->width() - item_right_margin + kLabelToArrowPadding,
+ 0, 0, height() };
arrow_bounds.right = arrow_bounds.left + arrow_width;
AdjustBoundsForRTLUI(&arrow_bounds);
@@ -1662,7 +1662,7 @@ void MenuController::OnMousePressed(SubmenuView* source,
return;
MenuPart part =
- GetMenuPartByScreenCoordinate(source, event.GetX(), event.GetY());
+ GetMenuPartByScreenCoordinate(source, event.x(), event.y());
if (part.is_scroll())
return; // Ignore presses on scroll buttons.
@@ -1690,8 +1690,8 @@ void MenuController::OnMousePressed(SubmenuView* source,
} else {
if (part.menu->GetDelegate()->CanDrag(part.menu)) {
possible_drag_ = true;
- press_x_ = event.GetX();
- press_y_ = event.GetY();
+ press_x_ = event.x();
+ press_y_ = event.y();
}
if (part.menu->HasSubmenu())
open_submenu = true;
@@ -1707,15 +1707,15 @@ void MenuController::OnMouseDragged(SubmenuView* source,
DLOG(INFO) << "OnMouseDragged source=" << source;
#endif
MenuPart part =
- GetMenuPartByScreenCoordinate(source, event.GetX(), event.GetY());
+ GetMenuPartByScreenCoordinate(source, event.x(), event.y());
UpdateScrolling(part);
if (!blocking_run_)
return;
if (possible_drag_) {
- if (ChromeViews::View::ExceededDragThreshold(event.GetX() - press_x_,
- event.GetY() - press_y_)) {
+ if (ChromeViews::View::ExceededDragThreshold(event.x() - press_x_,
+ event.y() - press_y_)) {
MenuItemView* item = state_.item;
DCHECK(item);
// Points are in the coordinates of the submenu, need to map to that of
@@ -1724,17 +1724,17 @@ void MenuController::OnMouseDragged(SubmenuView* source,
CPoint press_loc(press_x_, press_y_);
View::ConvertPointToScreen(source->GetScrollViewContainer(), &press_loc);
View::ConvertPointToView(NULL, item, &press_loc);
- CPoint drag_loc(event.GetX(), event.GetY());
+ CPoint drag_loc(event.x(), event.y());
View::ConvertPointToScreen(source->GetScrollViewContainer(), &drag_loc);
View::ConvertPointToView(NULL, item, &drag_loc);
in_drag_ = true;
- ChromeCanvas canvas(item->GetWidth(), item->GetHeight(), false);
+ ChromeCanvas canvas(item->width(), item->height(), false);
item->Paint(&canvas, true);
scoped_refptr<OSExchangeData> data(new OSExchangeData);
item->GetDelegate()->WriteDragData(item, data.get());
- drag_utils::SetDragImageOnDataObject(canvas, item->GetWidth(),
- item->GetHeight(), press_loc.x,
+ drag_utils::SetDragImageOnDataObject(canvas, item->width(),
+ item->height(), press_loc.x,
press_loc.y, data);
scoped_refptr<BaseDragSource> drag_source(new BaseDragSource);
@@ -1774,7 +1774,7 @@ void MenuController::OnMouseReleased(SubmenuView* source,
possible_drag_ = false;
DCHECK(blocking_run_);
MenuPart part =
- GetMenuPartByScreenCoordinate(source, event.GetX(), event.GetY());
+ GetMenuPartByScreenCoordinate(source, event.x(), event.y());
any_menu_contains_mouse_ = (part.type == MenuPart::MENU_ITEM);
if (event.IsRightMouseButton() && (part.type == MenuPart::MENU_ITEM &&
part.menu)) {
@@ -1783,7 +1783,7 @@ void MenuController::OnMouseReleased(SubmenuView* source,
bool open_submenu = (state_.item == pending_state_.item &&
state_.submenu_open);
SetSelection(pending_state_.item, open_submenu, true);
- CPoint loc(event.GetX(), event.GetY());
+ CPoint loc(event.x(), event.y());
View::ConvertPointToScreen(source->GetScrollViewContainer(), &loc);
// If we open a context menu just return now
@@ -1812,7 +1812,7 @@ void MenuController::OnMouseMoved(SubmenuView* source,
return;
MenuPart part =
- GetMenuPartByScreenCoordinate(source, event.GetX(), event.GetY());
+ GetMenuPartByScreenCoordinate(source, event.x(), event.y());
UpdateScrolling(part);
@@ -1853,7 +1853,7 @@ int MenuController::OnDragUpdated(SubmenuView* source,
const DropTargetEvent& event) {
StopCancelAllTimer();
- CPoint screen_loc(event.GetX(), event.GetY());
+ CPoint screen_loc(event.x(), event.y());
View::ConvertPointToScreen(source, &screen_loc);
if (valid_drop_coordinates_ && screen_loc.x == drop_x_ &&
screen_loc.y == drop_y_) {
@@ -1863,22 +1863,22 @@ int MenuController::OnDragUpdated(SubmenuView* source,
drop_y_ = screen_loc.y;
valid_drop_coordinates_ = true;
- MenuItemView* menu_item = GetMenuItemAt(source, event.GetX(), event.GetY());
+ MenuItemView* menu_item = GetMenuItemAt(source, event.x(), event.y());
bool over_empty_menu = false;
if (!menu_item) {
// See if we're over an empty menu.
- menu_item = GetEmptyMenuItemAt(source, event.GetX(), event.GetY());
+ menu_item = GetEmptyMenuItemAt(source, event.x(), event.y());
if (menu_item)
over_empty_menu = true;
}
MenuDelegate::DropPosition drop_position = MenuDelegate::DROP_NONE;
int drop_operation = DragDropTypes::DRAG_NONE;
if (menu_item) {
- CPoint menu_item_loc(event.GetX(), event.GetY());
+ CPoint menu_item_loc(event.x(), event.y());
View::ConvertPointToView(source, menu_item, &menu_item_loc);
MenuItemView* query_menu_item;
if (!over_empty_menu) {
- int menu_item_height = menu_item->GetHeight();
+ int menu_item_height = menu_item->height();
if (menu_item->HasSubmenu() &&
(menu_item_loc.y > MenuItemView::kDropBetweenPixels &&
menu_item_loc.y < (menu_item_height -
@@ -2201,9 +2201,9 @@ bool MenuController::GetMenuPartByScreenCoordinateImpl(
View* scroll_view_container = menu->GetScrollViewContainer();
View::ConvertPointToView(NULL, scroll_view_container, &scroll_view_loc);
if (scroll_view_loc.x < 0 ||
- scroll_view_loc.x >= scroll_view_container->GetWidth() ||
+ scroll_view_loc.x >= scroll_view_container->width() ||
scroll_view_loc.y < 0 ||
- scroll_view_loc.y >= scroll_view_container->GetHeight()) {
+ scroll_view_loc.y >= scroll_view_container->height()) {
// Point isn't contained in menu.
return false;
}
@@ -2452,7 +2452,7 @@ gfx::Rect MenuController::CalculateMenuBounds(MenuItemView* item,
(!prefer_leading && layout_is_rtl);
if (create_on_the_right) {
- x = item_loc.x + item->GetWidth() - kSubmenuHorizontalInset;
+ x = item_loc.x + item->width() - kSubmenuHorizontalInset;
if (state_.monitor_bounds.width() != 0 &&
x + pref.cx > state_.monitor_bounds.right()) {
if (layout_is_rtl)
@@ -2468,7 +2468,7 @@ gfx::Rect MenuController::CalculateMenuBounds(MenuItemView* item,
*is_leading = false;
else
*is_leading = true;
- x = item_loc.x + item->GetWidth() - kSubmenuHorizontalInset;
+ x = item_loc.x + item->width() - kSubmenuHorizontalInset;
}
}
y = item_loc.y - kSubmenuBorderSize;
@@ -2622,7 +2622,7 @@ bool MenuController::SelectByChar(wchar_t character) {
void MenuController::RepostEvent(SubmenuView* source,
const MouseEvent& event) {
- CPoint screen_loc(event.GetX(), event.GetY());
+ CPoint screen_loc(event.x(), event.y());
View::ConvertPointToScreen(source->GetScrollViewContainer(), &screen_loc);
HWND window = WindowFromPoint(screen_loc);
if (window) {
diff --git a/chrome/views/client_view.cc b/chrome/views/client_view.cc
index eeff7f4..bf66d90 100644
--- a/chrome/views/client_view.cc
+++ b/chrome/views/client_view.cc
@@ -1,56 +1,56 @@
-// Copyright (c) 2006-2008 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 "base/logging.h"
-#include "chrome/views/client_view.h"
-
-namespace ChromeViews {
-
-///////////////////////////////////////////////////////////////////////////////
-// ClientView, public:
-
-ClientView::ClientView(Window* window, View* contents_view)
- : window_(window),
- contents_view_(contents_view) {
-}
-
-int ClientView::NonClientHitTest(const gfx::Point& point) {
- CRect bounds;
- GetBounds(&bounds, APPLY_MIRRORING_TRANSFORMATION);
- if (gfx::Rect(bounds).Contains(point.x(), point.y()))
- return HTCLIENT;
- return HTNOWHERE;
-}
-
-///////////////////////////////////////////////////////////////////////////////
-// ClientView, View overrides:
-
-void ClientView::GetPreferredSize(CSize* out) {
- DCHECK(out);
- // |contents_view_| is allowed to be NULL up until the point where this view
- // is attached to a ViewContainer.
- if (contents_view_)
- contents_view_->GetPreferredSize(out);
-}
-
-void ClientView::ViewHierarchyChanged(bool is_add, View* parent, View* child) {
- if (is_add && child == this) {
- DCHECK(GetViewContainer());
- DCHECK(contents_view_); // |contents_view_| must be valid now!
- AddChildView(contents_view_);
- }
-}
-
-void ClientView::DidChangeBounds(const CRect& previous, const CRect& current) {
- Layout();
-}
-
-void ClientView::Layout() {
- // |contents_view_| is allowed to be NULL up until the point where this view
- // is attached to a ViewContainer.
- if (contents_view_)
- contents_view_->SetBounds(0, 0, GetWidth(), GetHeight());
-}
-
-}; // namespace ChromeViews
+// Copyright (c) 2006-2008 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 "base/logging.h"
+#include "chrome/views/client_view.h"
+
+namespace ChromeViews {
+
+///////////////////////////////////////////////////////////////////////////////
+// ClientView, public:
+
+ClientView::ClientView(Window* window, View* contents_view)
+ : window_(window),
+ contents_view_(contents_view) {
+}
+
+int ClientView::NonClientHitTest(const gfx::Point& point) {
+ CRect bounds;
+ GetBounds(&bounds, APPLY_MIRRORING_TRANSFORMATION);
+ if (gfx::Rect(bounds).Contains(point.x(), point.y()))
+ return HTCLIENT;
+ return HTNOWHERE;
+}
+
+///////////////////////////////////////////////////////////////////////////////
+// ClientView, View overrides:
+
+void ClientView::GetPreferredSize(CSize* out) {
+ DCHECK(out);
+ // |contents_view_| is allowed to be NULL up until the point where this view
+ // is attached to a ViewContainer.
+ if (contents_view_)
+ contents_view_->GetPreferredSize(out);
+}
+
+void ClientView::ViewHierarchyChanged(bool is_add, View* parent, View* child) {
+ if (is_add && child == this) {
+ DCHECK(GetViewContainer());
+ DCHECK(contents_view_); // |contents_view_| must be valid now!
+ AddChildView(contents_view_);
+ }
+}
+
+void ClientView::DidChangeBounds(const CRect& previous, const CRect& current) {
+ Layout();
+}
+
+void ClientView::Layout() {
+ // |contents_view_| is allowed to be NULL up until the point where this view
+ // is attached to a ViewContainer.
+ if (contents_view_)
+ contents_view_->SetBounds(0, 0, width(), height());
+}
+
+}; // namespace ChromeViews
diff --git a/chrome/views/client_view.h b/chrome/views/client_view.h
index 80feb43..ad086f5 100644
--- a/chrome/views/client_view.h
+++ b/chrome/views/client_view.h
@@ -1,79 +1,79 @@
-// Copyright (c) 2006-2008 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_VIEWS_CLIENT_VIEW_H_
-#define CHROME_VIEWS_CLIENT_VIEW_H_
-
-#include "chrome/views/view.h"
-
-namespace ChromeViews {
-
-class DialogClientView;
-class Window;
-
-///////////////////////////////////////////////////////////////////////////////
-// ClientView
-//
-// A ClientView is a View subclass that is used to occupy the "client area"
-// of a window. It provides basic information to the window that contains it
-// such as non-client hit testing information, sizing etc. Sub-classes of
-// ClientView are used to create more elaborate contents, e.g.
-// "DialogClientView".
-class ClientView : public View {
- public:
- // Constructs a ClientView object for the specified window with the specified
- // contents. Since this object is created during the process of creating
- // |window|, |contents_view| must be valid if you want the initial size of
- // the window to be based on |contents_view|'s preferred size.
- ClientView(Window* window, View* contents_view);
- virtual ~ClientView() {}
-
- // Manual RTTI ftw.
- virtual DialogClientView* AsDialogClientView() { return NULL; }
-
- // Returns true to signal that the Window can be closed. Specialized
- // ClientView subclasses can override this default behavior to allow the
- // close to be blocked until the user corrects mistakes, accepts a warning
- // dialog, etc.
- virtual bool CanClose() const { return true; }
-
- // Tests to see if the specified point (in view coordinates) is within the
- // bounds of this view. If so, it returns HTCLIENT in this default
- // implementation. If it is outside the bounds of this view, this must return
- // HTNOWHERE to tell the caller to do further processing to determine where
- // in the non-client area it is (if it is).
- // Subclasses of ClientView can extend this logic by overriding this method
- // to detect if regions within the client area count as parts of the "non-
- // client" area. A good example of this is the size box at the bottom right
- // corner of resizable dialog boxes.
- virtual int NonClientHitTest(const gfx::Point& point);
-
- // Overridden from View:
- virtual void GetPreferredSize(CSize* out);
-
- protected:
- // Overridden from View:
- virtual void ViewHierarchyChanged(bool is_add, View* parent, View* child);
- virtual void DidChangeBounds(const CRect& previous, const CRect& current);
- virtual void Layout();
-
- // Accessors for private data members.
- Window* window() const { return window_; }
- void set_window(Window* window) { window_ = window; }
- View* contents_view() const { return contents_view_; }
- void set_contents_view(View* contents_view) {
- contents_view_ = contents_view;
- }
-
- private:
- // The Window that hosts this ClientView.
- Window* window_;
-
- // The View that this ClientView contains.
- View* contents_view_;
-};
-
-} // namespace ChromeViews
-
-#endif // #ifndef CHROME_VIEWS_CLIENT_VIEW_H_
+// Copyright (c) 2006-2008 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_VIEWS_CLIENT_VIEW_H_
+#define CHROME_VIEWS_CLIENT_VIEW_H_
+
+#include "chrome/views/view.h"
+
+namespace ChromeViews {
+
+class DialogClientView;
+class Window;
+
+///////////////////////////////////////////////////////////////////////////////
+// ClientView
+//
+// A ClientView is a View subclass that is used to occupy the "client area"
+// of a window. It provides basic information to the window that contains it
+// such as non-client hit testing information, sizing etc. Sub-classes of
+// ClientView are used to create more elaborate contents, e.g.
+// "DialogClientView".
+class ClientView : public View {
+ public:
+ // Constructs a ClientView object for the specified window with the specified
+ // contents. Since this object is created during the process of creating
+ // |window|, |contents_view| must be valid if you want the initial size of
+ // the window to be based on |contents_view|'s preferred size.
+ ClientView(Window* window, View* contents_view);
+ virtual ~ClientView() {}
+
+ // Manual RTTI ftw.
+ virtual DialogClientView* AsDialogClientView() { return NULL; }
+
+ // Returns true to signal that the Window can be closed. Specialized
+ // ClientView subclasses can override this default behavior to allow the
+ // close to be blocked until the user corrects mistakes, accepts a warning
+ // dialog, etc.
+ virtual bool CanClose() const { return true; }
+
+ // Tests to see if the specified point (in view coordinates) is within the
+ // bounds of this view. If so, it returns HTCLIENT in this default
+ // implementation. If it is outside the bounds of this view, this must return
+ // HTNOWHERE to tell the caller to do further processing to determine where
+ // in the non-client area it is (if it is).
+ // Subclasses of ClientView can extend this logic by overriding this method
+ // to detect if regions within the client area count as parts of the "non-
+ // client" area. A good example of this is the size box at the bottom right
+ // corner of resizable dialog boxes.
+ virtual int NonClientHitTest(const gfx::Point& point);
+
+ // Overridden from View:
+ virtual void GetPreferredSize(CSize* out);
+
+ protected:
+ // Overridden from View:
+ virtual void ViewHierarchyChanged(bool is_add, View* parent, View* child);
+ virtual void DidChangeBounds(const CRect& previous, const CRect& current);
+ virtual void Layout();
+
+ // Accessors for private data members.
+ Window* window() const { return window_; }
+ void set_window(Window* window) { window_ = window; }
+ View* contents_view() const { return contents_view_; }
+ void set_contents_view(View* contents_view) {
+ contents_view_ = contents_view;
+ }
+
+ private:
+ // The Window that hosts this ClientView.
+ Window* window_;
+
+ // The View that this ClientView contains.
+ View* contents_view_;
+};
+
+} // namespace ChromeViews
+
+#endif // #ifndef CHROME_VIEWS_CLIENT_VIEW_H_
diff --git a/chrome/views/combo_box.cc b/chrome/views/combo_box.cc
index 148cf19..f1010a5 100644
--- a/chrome/views/combo_box.cc
+++ b/chrome/views/combo_box.cc
@@ -65,7 +65,7 @@ void ComboBox::GetPreferredSize(CSize* out) {
HWND ComboBox::CreateNativeControl(HWND parent_container) {
HWND r = ::CreateWindowEx(GetAdditionalExStyle(), L"COMBOBOX", L"",
WS_CHILD | WS_VSCROLL | CBS_DROPDOWNLIST,
- 0, 0, GetWidth(), GetHeight(),
+ 0, 0, width(), height(),
parent_container, NULL, NULL, NULL);
HFONT font = ResourceBundle::GetSharedInstance().
GetFont(ResourceBundle::BaseFont).hfont();
diff --git a/chrome/views/custom_frame_window.cc b/chrome/views/custom_frame_window.cc
index a60355c..9a1a079 100644
--- a/chrome/views/custom_frame_window.cc
+++ b/chrome/views/custom_frame_window.cc
@@ -364,8 +364,8 @@ gfx::Size DefaultNonClientView::CalculateWindowSizeForClientSize(
CPoint DefaultNonClientView::GetSystemMenuPoint() const {
CPoint system_menu_point(
- system_menu_button_->GetX(),
- system_menu_button_->GetY() + system_menu_button_->GetHeight());
+ system_menu_button_->x(),
+ system_menu_button_->y() + system_menu_button_->height());
MapWindowPoints(container_->GetHWND(), HWND_DESKTOP, &system_menu_point, 1);
return system_menu_point;
}
@@ -523,9 +523,6 @@ int DefaultNonClientView::CalculateContentsTop() const {
}
void DefaultNonClientView::PaintFrameBorder(ChromeCanvas* canvas) {
- int width = GetWidth();
- int height = GetHeight();
-
SkBitmap* top_left_corner =
resources()->GetPartBitmap(FRAME_TOP_LEFT_CORNER);
SkBitmap* top_right_corner =
@@ -542,33 +539,33 @@ void DefaultNonClientView::PaintFrameBorder(ChromeCanvas* canvas) {
// Top.
canvas->DrawBitmapInt(*top_left_corner, 0, 0);
canvas->TileImageInt(*top_edge, top_left_corner->width(), 0,
- width - top_right_corner->width(), top_edge->height());
+ width() - top_right_corner->width(), top_edge->height());
canvas->DrawBitmapInt(*top_right_corner,
- width - top_right_corner->width(), 0);
+ width() - top_right_corner->width(), 0);
// Right.
int top_stack_height = top_right_corner->height();
- canvas->TileImageInt(*right_edge, width - right_edge->width(),
+ canvas->TileImageInt(*right_edge, width() - right_edge->width(),
top_stack_height, right_edge->width(),
- height - top_stack_height -
+ height() - top_stack_height -
bottom_right_corner->height());
// Bottom.
canvas->DrawBitmapInt(*bottom_right_corner,
- width - bottom_right_corner->width(),
- height - bottom_right_corner->height());
+ width() - bottom_right_corner->width(),
+ height() - bottom_right_corner->height());
canvas->TileImageInt(*bottom_edge, bottom_left_corner->width(),
- height - bottom_edge->height(),
- width - bottom_left_corner->width() -
+ height() - bottom_edge->height(),
+ width() - bottom_left_corner->width() -
bottom_right_corner->width(),
bottom_edge->height());
canvas->DrawBitmapInt(*bottom_left_corner, 0,
- height - bottom_left_corner->height());
+ height() - bottom_left_corner->height());
// Left.
top_stack_height = top_left_corner->height();
canvas->TileImageInt(*left_edge, 0, top_stack_height, left_edge->width(),
- height - top_stack_height -
+ height() - top_stack_height -
bottom_left_corner->height());
}
@@ -577,9 +574,9 @@ void DefaultNonClientView::PaintMaximizedFrameBorder(
SkBitmap* top_edge = resources()->GetPartBitmap(FRAME_TOP_EDGE);
SkBitmap* bottom_edge =
resources()->GetPartBitmap(FRAME_BOTTOM_EDGE);
- canvas->TileImageInt(*top_edge, 0, 0, GetWidth(), top_edge->height());
- canvas->TileImageInt(*bottom_edge, 0, GetHeight() - bottom_edge->height(),
- GetWidth(), bottom_edge->height());
+ canvas->TileImageInt(*top_edge, 0, 0, width(), top_edge->height());
+ canvas->TileImageInt(*bottom_edge, 0, height() - bottom_edge->height(),
+ width(), bottom_edge->height());
}
void DefaultNonClientView::PaintClientEdge(ChromeCanvas* canvas) {
@@ -633,7 +630,7 @@ void DefaultNonClientView::LayoutWindowControls() {
close_button_->GetPreferredSize(&ps);
close_button_->SetImageAlignment(Button::ALIGN_LEFT, Button::ALIGN_BOTTOM);
close_button_->SetBounds(
- GetWidth() - ps.cx - kWindowControlsRightZoomedOffset,
+ width() - ps.cx - kWindowControlsRightZoomedOffset,
0, ps.cx + kWindowControlsRightZoomedOffset,
ps.cy + kWindowControlsTopZoomedOffset);
@@ -641,20 +638,20 @@ void DefaultNonClientView::LayoutWindowControls() {
restore_button_->GetPreferredSize(&ps);
restore_button_->SetImageAlignment(Button::ALIGN_LEFT,
Button::ALIGN_BOTTOM);
- restore_button_->SetBounds(close_button_->GetX() - ps.cx, 0, ps.cx,
+ restore_button_->SetBounds(close_button_->x() - ps.cx, 0, ps.cx,
ps.cy + kWindowControlsTopZoomedOffset);
minimize_button_->GetPreferredSize(&ps);
minimize_button_->SetImageAlignment(Button::ALIGN_LEFT,
Button::ALIGN_BOTTOM);
- minimize_button_->SetBounds(restore_button_->GetX() - ps.cx, 0, ps.cx,
+ minimize_button_->SetBounds(restore_button_->x() - ps.cx, 0, ps.cx,
ps.cy + kWindowControlsTopZoomedOffset);
}
} else if (container_->IsMinimized()) {
close_button_->GetPreferredSize(&ps);
close_button_->SetImageAlignment(Button::ALIGN_LEFT, Button::ALIGN_BOTTOM);
close_button_->SetBounds(
- GetWidth() - ps.cx - kWindowControlsRightZoomedOffset,
+ width() - ps.cx - kWindowControlsRightZoomedOffset,
0, ps.cx + kWindowControlsRightZoomedOffset,
ps.cy + kWindowControlsTopZoomedOffset);
@@ -662,19 +659,19 @@ void DefaultNonClientView::LayoutWindowControls() {
restore_button_->GetPreferredSize(&ps);
restore_button_->SetImageAlignment(Button::ALIGN_LEFT,
Button::ALIGN_BOTTOM);
- restore_button_->SetBounds(close_button_->GetX() - ps.cx, 0, ps.cx,
+ restore_button_->SetBounds(close_button_->x() - ps.cx, 0, ps.cx,
ps.cy + kWindowControlsTopZoomedOffset);
minimize_button_->GetPreferredSize(&ps);
minimize_button_->SetImageAlignment(Button::ALIGN_LEFT,
Button::ALIGN_BOTTOM);
- minimize_button_->SetBounds(restore_button_->GetX() - ps.cx, 0, ps.cx,
+ minimize_button_->SetBounds(restore_button_->x() - ps.cx, 0, ps.cx,
ps.cy + kWindowControlsTopZoomedOffset);
}
} else {
close_button_->GetPreferredSize(&ps);
close_button_->SetImageAlignment(Button::ALIGN_LEFT, Button::ALIGN_TOP);
- close_button_->SetBounds(GetWidth() - kWindowControlsRightOffset - ps.cx,
+ close_button_->SetBounds(width() - kWindowControlsRightOffset - ps.cx,
kWindowControlsTopOffset, ps.cx, ps.cy);
if (should_show_minmax_buttons_) {
@@ -694,13 +691,13 @@ void DefaultNonClientView::LayoutWindowControls() {
maximize_button_->GetPreferredSize(&ps);
maximize_button_->SetImageAlignment(Button::ALIGN_LEFT,
Button::ALIGN_TOP);
- maximize_button_->SetBounds(close_button_->GetX() - ps.cx,
+ maximize_button_->SetBounds(close_button_->x() - ps.cx,
kWindowControlsTopOffset, ps.cx, ps.cy);
minimize_button_->GetPreferredSize(&ps);
minimize_button_->SetImageAlignment(Button::ALIGN_LEFT,
Button::ALIGN_TOP);
- minimize_button_->SetBounds(maximize_button_->GetX() - ps.cx,
+ minimize_button_->SetBounds(maximize_button_->x() - ps.cx,
kWindowControlsTopOffset, ps.cx, ps.cy);
}
}
@@ -745,7 +742,7 @@ void DefaultNonClientView::LayoutTitleBar() {
system_menu_button_->GetBounds(&system_menu_bounds);
int spacing = d->ShouldShowWindowIcon() ? kWindowIconTitleSpacing : 0;
int title_right = should_show_minmax_buttons_ ?
- minimize_button_->GetX() : close_button_->GetX();
+ minimize_button_->x() : close_button_->x();
int title_left = system_menu_bounds.right + spacing;
title_bounds_.SetRect(title_left, kTitleTopOffset + top_offset,
std::max(0, static_cast<int>(title_right - system_menu_bounds.right)),
@@ -768,7 +765,7 @@ void DefaultNonClientView::LayoutTitleBar() {
void DefaultNonClientView::LayoutClientView() {
gfx::Rect client_bounds(
- CalculateClientAreaBounds(GetWidth(), GetHeight()));
+ CalculateClientAreaBounds(width(), height()));
container_->client_view()->SetBounds(client_bounds.ToRECT());
}
@@ -993,8 +990,8 @@ void CustomFrameWindow::OnNCPaint(HRGN rgn) {
CRect window_rect;
GetWindowRect(&window_rect);
- if (window_rect.Width() != root_view_->GetWidth() ||
- window_rect.Height() != root_view_->GetHeight()) {
+ if (window_rect.Width() != root_view_->width() ||
+ window_rect.Height() != root_view_->height()) {
// If the size of the window differs from the size of the root view it
// means we're being asked to paint before we've gotten a WM_SIZE. This can
// happen when the user is interactively resizing the window. To avoid
diff --git a/chrome/views/dialog_client_view.cc b/chrome/views/dialog_client_view.cc
index b996dca..be30759 100644
--- a/chrome/views/dialog_client_view.cc
+++ b/chrome/views/dialog_client_view.cc
@@ -37,7 +37,7 @@ void UpdateButtonHelper(ChromeViews::NativeButton* button_view,
void FillViewWithSysColor(ChromeCanvas* canvas, View* view, COLORREF color) {
SkColor sk_color =
SkColorSetRGB(GetRValue(color), GetGValue(color), GetBValue(color));
- canvas->FillRectInt(sk_color, 0, 0, view->GetWidth(), view->GetHeight());
+ canvas->FillRectInt(sk_color, 0, 0, view->width(), view->height());
}
// DialogButton ----------------------------------------------------------------
@@ -198,7 +198,7 @@ bool DialogClientView::CanClose() const {
}
int DialogClientView::NonClientHitTest(const gfx::Point& point) {
- if (size_box_bounds_.Contains(point.x() - GetX(), point.y() - GetY()))
+ if (size_box_bounds_.Contains(point.x() - x(), point.y() - y()))
return HTBOTTOMRIGHT;
return ClientView::NonClientHitTest(point);
}
@@ -244,9 +244,9 @@ void DialogClientView::GetPreferredSize(CSize* out) {
int button_height = 0;
if (has_dialog_buttons()) {
if (cancel_button_)
- button_height = cancel_button_->GetHeight();
+ button_height = cancel_button_->height();
else
- button_height = ok_button_->GetHeight();
+ button_height = ok_button_->height();
// Account for padding above and below the button.
button_height += kDialogButtonContentSpacing + kButtonVEdgeMargin;
}
@@ -311,8 +311,8 @@ int DialogClientView::GetButtonWidth(int button) const {
int DialogClientView::GetButtonsHeight() const {
if (has_dialog_buttons()) {
if (cancel_button_)
- return cancel_button_->GetHeight() + kDialogButtonContentSpacing;
- return ok_button_->GetHeight() + kDialogButtonContentSpacing;
+ return cancel_button_->height() + kDialogButtonContentSpacing;
+ return ok_button_->height() + kDialogButtonContentSpacing;
}
return 0;
}
@@ -343,7 +343,7 @@ void DialogClientView::LayoutDialogButtons() {
int button_width = GetButtonWidth(DialogDelegate::DIALOGBUTTON_OK);
int ok_button_right = lb.right - kButtonHEdgeMargin;
if (cancel_button_)
- ok_button_right = cancel_button_->GetX() - kRelatedButtonHSpacing;
+ ok_button_right = cancel_button_->x() - kRelatedButtonHSpacing;
CRect bounds;
bounds.left = ok_button_right - button_width;
bounds.top = lb.bottom - ps.cy - kButtonVEdgeMargin;
diff --git a/chrome/views/event.h b/chrome/views/event.h
index 074e046..17cbe60 100644
--- a/chrome/views/event.h
+++ b/chrome/views/event.h
@@ -128,12 +128,12 @@ class LocatedEvent : public Event {
LocatedEvent(const LocatedEvent& model, View* from, View* to);
// Returns the X location.
- int GetX() const {
+ int x() const {
return location_.x();
}
// Returns the Y location.
- int GetY() const {
+ int y() const {
return location_.y();
}
diff --git a/chrome/views/focus_manager_unittest.cc b/chrome/views/focus_manager_unittest.cc
index dd3405c..8f0040f 100644
--- a/chrome/views/focus_manager_unittest.cc
+++ b/chrome/views/focus_manager_unittest.cc
@@ -111,7 +111,7 @@ class BorderView : public ChromeViews::NativeControl {
WC_TABCONTROL,
L"",
WS_CHILD,
- 0, 0, GetWidth(), GetHeight(),
+ 0, 0, width(), height(),
parent_container, NULL, NULL, NULL);
// Create the view container which is a child of the TabControl.
view_container_ = new ChromeViews::HWNDViewContainer();
diff --git a/chrome/views/grid_layout.cc b/chrome/views/grid_layout.cc
index 18f7ba0..e0c7257 100644
--- a/chrome/views/grid_layout.cc
+++ b/chrome/views/grid_layout.cc
@@ -765,7 +765,7 @@ void GridLayout::Layout(View* host) {
// SizeRowsAndColumns sets the size and location of each row/column, but
// not of the views.
CSize pref;
- SizeRowsAndColumns(true, host_->GetWidth(), host_->GetHeight(), &pref);
+ SizeRowsAndColumns(true, host_->width(), host_->height(), &pref);
// Size each view.
for (std::vector<ViewState*>::iterator i = view_states_.begin();
diff --git a/chrome/views/grid_layout_unittest.cc b/chrome/views/grid_layout_unittest.cc
index 2f92c71..080cddb 100644
--- a/chrome/views/grid_layout_unittest.cc
+++ b/chrome/views/grid_layout_unittest.cc
@@ -13,10 +13,10 @@ using ChromeViews::View;
static void ExpectViewBoundsEquals(int x, int y, int w, int h,
const View* view) {
- EXPECT_EQ(x, view->GetX());
- EXPECT_EQ(y, view->GetY());
- EXPECT_EQ(w, view->GetWidth());
- EXPECT_EQ(h, view->GetHeight());
+ EXPECT_EQ(x, view->x());
+ EXPECT_EQ(y, view->y());
+ EXPECT_EQ(w, view->width());
+ EXPECT_EQ(h, view->height());
}
class SettableSizeView : public View {
diff --git a/chrome/views/image_view.cc b/chrome/views/image_view.cc
index bde1b6b..00c771d 100644
--- a/chrome/views/image_view.cc
+++ b/chrome/views/image_view.cc
@@ -80,10 +80,10 @@ void ImageView::ComputeImageOrigin(int image_width, int image_height,
*x = 0;
break;
case TRAILING:
- *x = GetWidth() - image_width;
+ *x = width() - image_width;
break;
case CENTER:
- *x = (GetWidth() - image_width) / 2;
+ *x = (width() - image_width) / 2;
break;
default:
NOTREACHED();
@@ -94,10 +94,10 @@ void ImageView::ComputeImageOrigin(int image_width, int image_height,
*y = 0;
break;
case TRAILING:
- *y = GetHeight() - image_height;
+ *y = height() - image_height;
break;
case CENTER:
- *y = (GetHeight() - image_height) / 2;
+ *y = (height() - image_height) / 2;
break;
default:
NOTREACHED();
diff --git a/chrome/views/label.cc b/chrome/views/label.cc
index a87e400..31053ac 100644
--- a/chrome/views/label.cc
+++ b/chrome/views/label.cc
@@ -54,7 +54,7 @@ void Label::GetPreferredSize(CSize* out) {
DCHECK(out);
if (is_multi_line_) {
ChromeCanvas cc(0, 0, true);
- int w = GetWidth(), h = 0;
+ int w = width(), h = 0;
cc.SizeStringInt(text_, font_, &w, &h, ComputeMultiLineFlags());
out->cx = w;
out->cy = h;
@@ -110,8 +110,8 @@ void Label::Paint(ChromeCanvas* canvas) {
}
if (is_multi_line_) {
- canvas->DrawStringInt(paint_text, font_, color_, 0, 0, GetWidth(),
- GetHeight(), ComputeMultiLineFlags());
+ canvas->DrawStringInt(paint_text, font_, color_, 0, 0, width(),
+ height(), ComputeMultiLineFlags());
PaintFocusBorder(canvas);
} else {
gfx::Rect text_bounds = GetTextBounds();
@@ -262,7 +262,7 @@ bool Label::GetTooltipText(int x, int y, std::wstring* tooltip) {
}
// Show the full text if the text does not fit.
- if (!is_multi_line_ && font_.GetStringWidth(text_) > GetWidth()) {
+ if (!is_multi_line_ && font_.GetStringWidth(text_) > width()) {
*tooltip = text_;
return true;
}
@@ -302,7 +302,7 @@ ChromeFont Label::GetDefaultFont() {
}
void Label::UpdateContainsMouse(const MouseEvent& event) {
- SetContainsMouse(GetTextBounds().Contains(event.GetX(), event.GetY()));
+ SetContainsMouse(GetTextBounds().Contains(event.x(), event.y()));
}
void Label::SetContainsMouse(bool contains_mouse) {
@@ -317,12 +317,12 @@ gfx::Rect Label::GetTextBounds() {
CSize text_size;
GetTextSize(&text_size);
gfx::Insets insets = GetInsets();
- int avail_width = GetWidth() - insets.left() - insets.right();
+ int avail_width = width() - insets.left() - insets.right();
// Respect the size set by the owner view
text_size.cx = std::min(avail_width, static_cast<int>(text_size.cx));
int text_y = insets.top() +
- (GetHeight() - text_size.cy - insets.top() - insets.bottom()) / 2;
+ (height() - text_size.cy - insets.top() - insets.bottom()) / 2;
int text_x;
switch (horiz_alignment_) {
case ALIGN_LEFT:
@@ -334,7 +334,7 @@ gfx::Rect Label::GetTextBounds() {
text_x = insets.left() + (avail_width + 1 - text_size.cx) / 2;
break;
case ALIGN_RIGHT:
- text_x = GetWidth() - insets.right() - text_size.cx;
+ text_x = width() - insets.right() - text_size.cx;
break;
}
return gfx::Rect(text_x, text_y, text_size.cx, text_size.cy);
diff --git a/chrome/views/link.cc b/chrome/views/link.cc
index a8d0f4f..8350a7b 100644
--- a/chrome/views/link.cc
+++ b/chrome/views/link.cc
@@ -84,7 +84,7 @@ bool Link::OnMousePressed(const MouseEvent& e) {
bool Link::OnMouseDragged(const MouseEvent& e) {
SetHighlighted(enabled_ &&
(e.IsLeftMouseButton() || e.IsMiddleMouseButton()) &&
- HitTest(WTL::CPoint(e.GetX(), e.GetY())));
+ HitTest(WTL::CPoint(e.x(), e.y())));
return true;
}
@@ -94,7 +94,7 @@ void Link::OnMouseReleased(const MouseEvent& e, bool canceled) {
SetHighlighted(false);
if (enabled_ && !canceled &&
(e.IsLeftMouseButton() || e.IsMiddleMouseButton()) &&
- HitTest(WTL::CPoint(e.GetX(), e.GetY()))) {
+ HitTest(WTL::CPoint(e.x(), e.y()))) {
// Focus the link on click.
RequestFocus();
diff --git a/chrome/views/menu_button.cc b/chrome/views/menu_button.cc
index 91f6d55..b2bdbea 100644
--- a/chrome/views/menu_button.cc
+++ b/chrome/views/menu_button.cc
@@ -83,9 +83,9 @@ void MenuButton::Paint(ChromeCanvas* canvas, bool for_drag) {
// a MenuButton control (see TextButton::Paint() for a detailed
// explanation regarding why we can not flip the canvas). Therefore, we
// need to manually mirror the position of the down arrow.
- gfx::Rect arrow_bounds(GetWidth() - insets.right() -
+ gfx::Rect arrow_bounds(width() - insets.right() -
kMenuMarker->width() - kMenuMarkerPaddingRight,
- GetHeight() / 2,
+ height() / 2,
kMenuMarker->width(),
kMenuMarker->height());
arrow_bounds.set_x(MirroredLeftPointForRect(arrow_bounds));
@@ -182,8 +182,8 @@ bool MenuButton::OnMousePressed(const ChromeViews::MouseEvent& e) {
if (GetState() != BS_DISABLED) {
// If we're draggable (GetDragOperations returns a non-zero value), then
// don't pop on press, instead wait for release.
- if (e.IsOnlyLeftMouseButton() && HitTest(WTL::CPoint(e.GetX(), e.GetY())) &&
- GetDragOperations(e.GetX(), e.GetY()) == DragDropTypes::DRAG_NONE) {
+ if (e.IsOnlyLeftMouseButton() && HitTest(WTL::CPoint(e.x(), e.y())) &&
+ GetDragOperations(e.x(), e.y()) == DragDropTypes::DRAG_NONE) {
TimeDelta delta = Time::Now() - menu_closed_time_;
int64 delta_in_milliseconds = delta.InMilliseconds();
if (delta_in_milliseconds > kMinimumTimeBetweenButtonClicks) {
@@ -196,9 +196,9 @@ bool MenuButton::OnMousePressed(const ChromeViews::MouseEvent& e) {
void MenuButton::OnMouseReleased(const ChromeViews::MouseEvent& e,
bool canceled) {
- if (GetDragOperations(e.GetX(), e.GetY()) != DragDropTypes::DRAG_NONE &&
+ if (GetDragOperations(e.x(), e.y()) != DragDropTypes::DRAG_NONE &&
GetState() != BS_DISABLED && !canceled && !InDrag() &&
- e.IsOnlyLeftMouseButton() && HitTest(WTL::CPoint(e.GetX(), e.GetY()))) {
+ e.IsOnlyLeftMouseButton() && HitTest(WTL::CPoint(e.x(), e.y()))) {
Activate();
} else {
TextButton::OnMouseReleased(e, canceled);
diff --git a/chrome/views/native_button.cc b/chrome/views/native_button.cc
index fc7f409..2db380b 100644
--- a/chrome/views/native_button.cc
+++ b/chrome/views/native_button.cc
@@ -82,7 +82,7 @@ HWND NativeButton::CreateNativeControl(HWND parent_container) {
if (is_default_)
flags |= BS_DEFPUSHBUTTON;
HWND r = ::CreateWindowEx(GetAdditionalExStyle(), L"BUTTON", L"", flags, 0, 0,
- GetWidth(), GetHeight(), parent_container, NULL,
+ width(), height(), parent_container, NULL,
NULL, NULL);
SendMessage(r, WM_SETFONT, reinterpret_cast<WPARAM>(font_.hfont()), FALSE);
ConfigureNativeButton(r);
diff --git a/chrome/views/native_scroll_bar.cc b/chrome/views/native_scroll_bar.cc
index 00e442c..0f36834 100644
--- a/chrome/views/native_scroll_bar.cc
+++ b/chrome/views/native_scroll_bar.cc
@@ -81,8 +81,8 @@ class ScrollBarContainer : public CWindowImpl<ScrollBarContainer,
SBS_HORZ : SBS_VERT),
0,
0,
- parent_->GetWidth(),
- parent_->GetHeight(),
+ parent_->width(),
+ parent_->height(),
m_hWnd,
NULL,
NULL,
diff --git a/chrome/views/non_client_view.cc b/chrome/views/non_client_view.cc
index 661367a..ff91dff 100644
--- a/chrome/views/non_client_view.cc
+++ b/chrome/views/non_client_view.cc
@@ -11,13 +11,11 @@ int NonClientView::GetHTComponentForFrame(const gfx::Point& point,
int resize_area_corner_size,
int top_resize_area_size,
bool can_resize) {
- int width = GetWidth();
- int height = GetHeight();
int component = HTNOWHERE;
if (point.x() < resize_area_size) {
if (point.y() < resize_area_corner_size) {
component = HTTOPLEFT;
- } else if (point.y() >= (height - resize_area_corner_size)) {
+ } else if (point.y() >= (height() - resize_area_corner_size)) {
component = HTBOTTOMLEFT;
} else {
component = HTLEFT;
@@ -25,26 +23,26 @@ int NonClientView::GetHTComponentForFrame(const gfx::Point& point,
} else if (point.x() < resize_area_corner_size) {
if (point.y() < top_resize_area_size) {
component = HTTOPLEFT;
- } else if (point.y() >= (height - resize_area_size)) {
+ } else if (point.y() >= (height() - resize_area_size)) {
component = HTBOTTOMLEFT;
}
- } else if (point.x() >= (width - resize_area_size)) {
+ } else if (point.x() >= (width() - resize_area_size)) {
if (point.y() < resize_area_corner_size) {
component = HTTOPRIGHT;
- } else if (point.y() >= (height - resize_area_corner_size)) {
+ } else if (point.y() >= (height() - resize_area_corner_size)) {
component = HTBOTTOMRIGHT;
- } else if (point.x() >= (width - resize_area_size)) {
+ } else if (point.x() >= (width() - resize_area_size)) {
component = HTRIGHT;
}
- } else if (point.x() >= (width - resize_area_corner_size)) {
+ } else if (point.x() >= (width() - resize_area_corner_size)) {
if (point.y() < top_resize_area_size) {
component = HTTOPRIGHT;
- } else if (point.y() >= (height - resize_area_size)) {
+ } else if (point.y() >= (height() - resize_area_size)) {
component = HTBOTTOMRIGHT;
}
} else if (point.y() < top_resize_area_size) {
component = HTTOP;
- } else if (point.y() >= (height - resize_area_size)) {
+ } else if (point.y() >= (height() - resize_area_size)) {
component = HTBOTTOM;
}
diff --git a/chrome/views/painter.h b/chrome/views/painter.h
index d9516e7..e0e3519 100644
--- a/chrome/views/painter.h
+++ b/chrome/views/painter.h
@@ -97,7 +97,7 @@ class HorizontalPainter : public Painter {
virtual void Paint(int w, int h, ChromeCanvas* canvas);
// Height of the images.
- int GetHeight() const { return height_; }
+ int height() const { return height_; }
private:
// The image chunks.
diff --git a/chrome/views/radio_button.cc b/chrome/views/radio_button.cc
index 44a1935..1e860e7 100644
--- a/chrome/views/radio_button.cc
+++ b/chrome/views/radio_button.cc
@@ -30,7 +30,7 @@ HWND RadioButton::CreateNativeControl(HWND parent_container) {
L"BUTTON",
L"",
WS_CHILD | BS_RADIOBUTTON ,
- 0, 0, GetWidth(), GetHeight(),
+ 0, 0, width(), height(),
parent_container, NULL, NULL, NULL);
ConfigureNativeButton(r);
return r;
@@ -69,7 +69,7 @@ void RadioButton::GetPreferredSize(CSize *out) {
void RadioButton::Layout() {
int label_x = GetTextIndent();
- label_->SetBounds(label_x, 0, GetWidth() - label_x, GetHeight());
+ label_->SetBounds(label_x, 0, width() - label_x, height());
if (hwnd_view_) {
int first_line_height = label_->GetFont().height();
hwnd_view_->SetBounds(0, ((first_line_height - kRadioHeight) / 2) + 1,
diff --git a/chrome/views/resize_corner.cc b/chrome/views/resize_corner.cc
index 9ac6586..d1a91b4 100644
--- a/chrome/views/resize_corner.cc
+++ b/chrome/views/resize_corner.cc
@@ -19,7 +19,7 @@ ResizeCorner::~ResizeCorner() {
void ResizeCorner::Paint(ChromeCanvas* canvas) {
// Paint the little handle.
- RECT widgetRect = { 0, 0, GetWidth(), GetHeight() };
+ RECT widgetRect = { 0, 0, width(), height() };
HDC hdc = canvas->beginPlatformPaint();
gfx::NativeTheme::instance()->PaintStatusGripper(hdc,
SP_GRIPPER,
diff --git a/chrome/views/root_view.cc b/chrome/views/root_view.cc
index d1c21c7..d3d1e96 100644
--- a/chrome/views/root_view.cc
+++ b/chrome/views/root_view.cc
@@ -158,9 +158,9 @@ void RootView::ProcessPaint(ChromeCanvas* canvas) {
canvas->save();
// Set the clip rect according to the invalid rect.
- int x = invalid_rect_.left + GetX();
- int y = invalid_rect_.top + GetY();
- canvas->ClipRectInt(x, y, invalid_rect_.Width(), invalid_rect_.Height());
+ int clip_x = invalid_rect_.left + x();
+ int clip_y = invalid_rect_.top + y();
+ canvas->ClipRectInt(clip_x, clip_y, invalid_rect_.Width(), invalid_rect_.Height());
// Paint the tree
View::ProcessPaint(canvas);
@@ -278,7 +278,7 @@ bool RootView::OnMousePressed(const MouseEvent& e) {
bool hit_disabled_view = false;
// Walk up the tree until we find a view that wants the mouse event.
- for (mouse_pressed_handler_ = GetViewForPoint(WTL::CPoint(e.GetX(), e.GetY()));
+ for (mouse_pressed_handler_ = GetViewForPoint(WTL::CPoint(e.x(), e.y()));
mouse_pressed_handler_ && (mouse_pressed_handler_ != this);
mouse_pressed_handler_ = mouse_pressed_handler_->GetParent()) {
if (!mouse_pressed_handler_->IsEnabled()) {
@@ -355,7 +355,7 @@ bool RootView::OnMouseDragged(const MouseEvent& e) {
SetMouseLocationAndFlags(e);
CPoint p;
- ConvertPointToMouseHandler(WTL::CPoint(e.GetX(), e.GetY()), &p);
+ ConvertPointToMouseHandler(WTL::CPoint(e.x(), e.y()), &p);
MouseEvent mouse_event(e.GetType(), p.x, p.y, e.GetFlags());
if (!mouse_pressed_handler_->ProcessMouseDragged(mouse_event,
&drag_info)) {
@@ -373,7 +373,7 @@ void RootView::OnMouseReleased(const MouseEvent& e, bool canceled) {
if (mouse_pressed_handler_) {
CPoint p;
- ConvertPointToMouseHandler(WTL::CPoint(e.GetX(), e.GetY()), &p);
+ ConvertPointToMouseHandler(WTL::CPoint(e.x(), e.y()), &p);
MouseEvent mouse_released(e.GetType(), p.x, p.y, e.GetFlags());
// We allow the view to delete us from ProcessMouseReleased. As such,
// configure state such that we're done first, then call View.
@@ -386,10 +386,10 @@ void RootView::OnMouseReleased(const MouseEvent& e, bool canceled) {
}
void RootView::UpdateCursor(const MouseEvent& e) {
- View *v = GetViewForPoint(WTL::CPoint(e.GetX(), e.GetY()));
+ View *v = GetViewForPoint(WTL::CPoint(e.x(), e.y()));
if (v && v != this) {
- CPoint l(e.GetX(), e.GetY());
+ CPoint l(e.x(), e.y());
View::ConvertPointToView(this, v, &l);
HCURSOR cursor = v->GetCursorForPoint(e.GetType(), l.x, l.y);
if (cursor) {
@@ -403,7 +403,7 @@ void RootView::UpdateCursor(const MouseEvent& e) {
}
void RootView::OnMouseMoved(const MouseEvent& e) {
- View *v = GetViewForPoint(WTL::CPoint(e.GetX(), e.GetY()));
+ View *v = GetViewForPoint(WTL::CPoint(e.x(), e.y()));
// Find the first enabled view.
while (v && !v->IsEnabled())
v = v->GetParent();
@@ -431,7 +431,7 @@ void RootView::OnMouseMoved(const MouseEvent& e) {
mouse_move_handler_->OnMouseMoved(moved_event);
HCURSOR cursor = mouse_move_handler_->GetCursorForPoint(
- moved_event.GetType(), moved_event.GetX(), moved_event.GetY());
+ moved_event.GetType(), moved_event.x(), moved_event.y());
if (cursor) {
previous_cursor_ = ::SetCursor(cursor);
} else if (previous_cursor_) {
@@ -880,8 +880,8 @@ void RootView::UnregisterViewForVisibleBoundsNotification(View* view) {
void RootView::SetMouseLocationAndFlags(const MouseEvent& e) {
last_mouse_event_flags_ = e.GetFlags();
- last_mouse_event_x_ = e.GetX();
- last_mouse_event_y_ = e.GetY();
+ last_mouse_event_x_ = e.x();
+ last_mouse_event_y_ = e.y();
}
std::string RootView::GetClassName() const {
diff --git a/chrome/views/scroll_view.cc b/chrome/views/scroll_view.cc
index 9f7f0e3..6b43fb4 100644
--- a/chrome/views/scroll_view.cc
+++ b/chrome/views/scroll_view.cc
@@ -25,8 +25,8 @@ class Viewport : public View {
return;
View* contents = GetChildViewAt(0);
- x -= contents->GetX();
- y -= contents->GetY();
+ x -= contents->x();
+ y -= contents->y();
static_cast<ScrollView*>(GetParent())->ScrollContentsRegionToBeVisible(
x, y, width, height);
}
@@ -177,7 +177,7 @@ void ScrollView::Layout() {
bool horiz_sb_required = false;
bool vert_sb_required = false;
if (contents_) {
- WTL::CSize content_size(contents_->GetWidth(), contents_->GetHeight());
+ WTL::CSize content_size(contents_->width(), contents_->height());
ComputeScrollBarsVisibility(viewport_size,
content_size,
&horiz_sb_required,
@@ -246,15 +246,15 @@ void ScrollView::CheckScrollBounds() {
if (contents_) {
int x, y;
- x = CheckScrollBounds(viewport_->GetWidth(),
- contents_->GetWidth(),
- -contents_->GetX());
- y = CheckScrollBounds(viewport_->GetHeight(),
- contents_->GetHeight(),
- -contents_->GetY());
+ x = CheckScrollBounds(viewport_->width(),
+ contents_->width(),
+ -contents_->x());
+ y = CheckScrollBounds(viewport_->height(),
+ contents_->height(),
+ -contents_->y());
// This is no op if bounds are the same
- contents_->SetBounds(-x, -y, contents_->GetWidth(), contents_->GetHeight());
+ contents_->SetBounds(-x, -y, contents_->width(), contents_->height());
}
}
@@ -270,7 +270,7 @@ gfx::Rect ScrollView::GetVisibleRect() const {
(horiz_sb_ && horiz_sb_->IsVisible()) ? horiz_sb_->GetPosition() : 0;
const int y =
(vert_sb_ && vert_sb_->IsVisible()) ? vert_sb_->GetPosition() : 0;
- return gfx::Rect(x, y, viewport_->GetWidth(), viewport_->GetHeight());
+ return gfx::Rect(x, y, viewport_->width(), viewport_->height());
}
void ScrollView::ScrollContentsRegionToBeVisible(int x,
@@ -283,24 +283,24 @@ void ScrollView::ScrollContentsRegionToBeVisible(int x,
}
const int contents_max_x =
- std::max(viewport_->GetWidth(), contents_->GetWidth());
+ std::max(viewport_->width(), contents_->width());
const int contents_max_y =
- std::max(viewport_->GetHeight(), contents_->GetHeight());
+ std::max(viewport_->height(), contents_->height());
x = std::max(0, std::min(contents_max_x, x));
y = std::max(0, std::min(contents_max_y, y));
const int max_x = std::min(contents_max_x,
- x + std::min(width, viewport_->GetWidth()));
+ x + std::min(width, viewport_->width()));
const int max_y = std::min(contents_max_y,
y + std::min(height,
- viewport_->GetHeight()));
+ viewport_->height()));
const gfx::Rect vis_rect = GetVisibleRect();
if (vis_rect.Contains(gfx::Rect(x, y, max_x, max_y)))
return;
const int new_x =
- (vis_rect.x() < x) ? x : std::max(0, max_x - viewport_->GetWidth());
+ (vis_rect.x() < x) ? x : std::max(0, max_x - viewport_->width());
const int new_y =
- (vis_rect.y() < y) ? y : std::max(0, max_x - viewport_->GetHeight());
+ (vis_rect.y() < y) ? y : std::max(0, max_x - viewport_->height());
contents_->SetX(-new_x);
contents_->SetY(-new_y);
@@ -313,15 +313,15 @@ void ScrollView::UpdateScrollBarPositions() {
}
if (horiz_sb_->IsVisible()) {
- int vw = viewport_->GetWidth();
- int cw = contents_->GetWidth();
- int origin = contents_->GetX();
+ int vw = viewport_->width();
+ int cw = contents_->width();
+ int origin = contents_->x();
horiz_sb_->Update(vw, cw, -origin);
}
if (vert_sb_->IsVisible()) {
- int vh = viewport_->GetHeight();
- int ch = contents_->GetHeight();
- int origin = contents_->GetY();
+ int vh = viewport_->height();
+ int ch = contents_->height();
+ int origin = contents_->y();
vert_sb_->Update(vh, ch, -origin);
}
}
@@ -332,9 +332,9 @@ void ScrollView::ScrollToPosition(ScrollBar* source, int position) {
return;
if (source == horiz_sb_ && horiz_sb_->IsVisible()) {
- int vw = viewport_->GetWidth();
- int cw = contents_->GetWidth();
- int origin = contents_->GetX();
+ int vw = viewport_->width();
+ int cw = contents_->width();
+ int origin = contents_->x();
if (-origin != position) {
int max_pos = std::max(0, cw - vw);
if (position < 0)
@@ -347,9 +347,9 @@ void ScrollView::ScrollToPosition(ScrollBar* source, int position) {
contents_->SchedulePaint(bounds, true);
}
} else if (source == vert_sb_ && vert_sb_->IsVisible()) {
- int vh = viewport_->GetHeight();
- int ch = contents_->GetHeight();
- int origin = contents_->GetY();
+ int vh = viewport_->height();
+ int ch = contents_->height();
+ int origin = contents_->y();
if (-origin != position) {
int max_pos = std::max(0, ch - vh);
if (position < 0)
@@ -379,8 +379,8 @@ int ScrollView::GetScrollIncrement(ScrollBar* source, bool is_page,
}
// No view, or the view didn't return a valid amount.
if (is_page)
- return is_horizontal ? viewport_->GetWidth() : viewport_->GetHeight();
- return is_horizontal ? viewport_->GetWidth() / 5 : viewport_->GetHeight() / 5;
+ return is_horizontal ? viewport_->width() : viewport_->height();
+ return is_horizontal ? viewport_->width() / 5 : viewport_->height() / 5;
}
void ScrollView::ViewHierarchyChanged(bool is_add, View *parent, View *child) {
@@ -447,11 +447,11 @@ int VariableRowHeightScrollHelper::GetPageScrollIncrement(
if (is_horizontal)
return 0;
// y coordinate is most likely negative.
- int y = abs(scroll_view->GetContents()->GetY());
- int vis_height = scroll_view->GetContents()->GetParent()->GetHeight();
+ int y = abs(scroll_view->GetContents()->y());
+ int vis_height = scroll_view->GetContents()->GetParent()->height();
if (is_positive) {
// Align the bottom most row to the top of the view.
- int bottom = std::min(scroll_view->GetContents()->GetHeight() - 1,
+ int bottom = std::min(scroll_view->GetContents()->height() - 1,
y + vis_height);
RowInfo bottom_row_info = GetRowInfo(bottom);
// If 0, ScrollView will provide a default value.
@@ -471,7 +471,7 @@ int VariableRowHeightScrollHelper::GetLineScrollIncrement(
if (is_horizontal)
return 0;
// y coordinate is most likely negative.
- int y = abs(scroll_view->GetContents()->GetY());
+ int y = abs(scroll_view->GetContents()->y());
RowInfo row = GetRowInfo(y);
if (is_positive) {
return row.height - (y - row.origin);
diff --git a/chrome/views/separator.cc b/chrome/views/separator.cc
index fc34705..0c9c6fa 100644
--- a/chrome/views/separator.cc
+++ b/chrome/views/separator.cc
@@ -23,7 +23,7 @@ HWND Separator::CreateNativeControl(HWND parent_container) {
return ::CreateWindowEx(GetAdditionalExStyle(), L"STATIC", L"",
WS_CHILD | SS_ETCHEDHORZ | SS_SUNKEN,
- 0, 0, GetWidth(), GetHeight(),
+ 0, 0, width(), height(),
parent_container, NULL, NULL, NULL);
}
@@ -33,7 +33,7 @@ LRESULT Separator::OnNotify(int w_param, LPNMHDR l_param) {
void Separator::GetPreferredSize(CSize* out) {
DCHECK(out);
- out->cx = GetWidth();
+ out->cx = width();
out->cy = fixed_height_;
}
diff --git a/chrome/views/tabbed_pane.cc b/chrome/views/tabbed_pane.cc
index 421edc3..473f1db 100644
--- a/chrome/views/tabbed_pane.cc
+++ b/chrome/views/tabbed_pane.cc
@@ -39,7 +39,7 @@ class TabBackground : public Background {
virtual void Paint(ChromeCanvas* canvas, View* view) const {
HDC dc = canvas->beginPlatformPaint();
- RECT r = {0, 0, view->GetWidth(), view->GetHeight()};
+ RECT r = {0, 0, view->width(), view->height()};
gfx::NativeTheme::instance()->PaintTabPanelBackground(dc, &r);
canvas->endPlatformPaint();
}
@@ -158,7 +158,7 @@ HWND TabbedPane::CreateNativeControl(HWND parent_container) {
WC_TABCONTROL,
L"",
WS_CHILD | WS_CLIPSIBLINGS | WS_VISIBLE,
- 0, 0, GetWidth(), GetHeight(),
+ 0, 0, width(), height(),
parent_container, NULL, NULL, NULL);
HFONT font = ResourceBundle::GetSharedInstance().
diff --git a/chrome/views/table_view.cc b/chrome/views/table_view.cc
index 6d1bc60..ab4d717 100644
--- a/chrome/views/table_view.cc
+++ b/chrome/views/table_view.cc
@@ -83,7 +83,7 @@ void TableView::DidChangeBounds(const CRect& previous,
return;
SendMessage(list_view_, WM_SETREDRAW, static_cast<WPARAM>(FALSE), 0);
Layout();
- if ((!sized_columns_ || autosize_columns_) && GetWidth() > 0) {
+ if ((!sized_columns_ || autosize_columns_) && width() > 0) {
sized_columns_ = true;
ResetColumnSizes();
}
@@ -458,7 +458,7 @@ HWND TableView::CreateNativeControl(HWND parent_container) {
WC_LISTVIEW,
L"",
style,
- 0, 0, GetWidth(), GetHeight(),
+ 0, 0, width(), height(),
parent_container, NULL, NULL, NULL);
model_->SetObserver(this);
diff --git a/chrome/views/text_button.cc b/chrome/views/text_button.cc
index 5c694b4e..e4e7225 100644
--- a/chrome/views/text_button.cc
+++ b/chrome/views/text_button.cc
@@ -225,8 +225,8 @@ void TextButton::Paint(ChromeCanvas* canvas, bool for_drag) {
}
gfx::Insets insets = GetInsets();
- int available_width = GetWidth() - insets.width();
- int available_height = GetHeight() - insets.height();
+ int available_width = width() - insets.width();
+ int available_height = height() - insets.height();
// Use the actual text (not max) size to properly center the text.
int content_width = text_size_.cx;
if (icon_.width() > 0) {
@@ -248,7 +248,7 @@ void TextButton::Paint(ChromeCanvas* canvas, bool for_drag) {
if (icon_.width() > 0)
text_x += icon_.width() + kIconTextPadding;
const int text_width = std::min(static_cast<int>(text_size_.cx),
- GetWidth() - insets.right() - text_x);
+ width() - insets.right() - text_x);
int text_y = (available_height - text_size_.cy) / 2 + insets.top();
if (text_width > 0) {
diff --git a/chrome/views/text_field.cc b/chrome/views/text_field.cc
index 7d0cd93..8d61868 100644
--- a/chrome/views/text_field.cc
+++ b/chrome/views/text_field.cc
@@ -247,7 +247,7 @@ TextField::Edit::Edit(TextField* parent, bool draw_border)
// Make sure we apply RTL related extended window styles if necessary.
DWORD ex_style = l10n_util::GetExtendedStyles();
- RECT r = {0, 0, parent_->GetWidth(), parent_->GetHeight()};
+ RECT r = {0, 0, parent_->width(), parent_->height()};
Create(parent_->GetViewContainer()->GetHWND(), r, NULL, style, ex_style);
// Set up the text_object_model_.
diff --git a/chrome/views/throbber.cc b/chrome/views/throbber.cc
index eee8a02..754ea6c 100644
--- a/chrome/views/throbber.cc
+++ b/chrome/views/throbber.cc
@@ -161,8 +161,8 @@ void CheckmarkThrobber::Paint(ChromeCanvas* canvas) {
}
// Otherwise we paint our tick mark or nothing depending on our state.
if (checked_) {
- int checkmark_x = (GetWidth() - checkmark_->width()) / 2;
- int checkmark_y = (GetHeight() - checkmark_->height()) / 2;
+ int checkmark_x = (width() - checkmark_->width()) / 2;
+ int checkmark_y = (height() - checkmark_->height()) / 2;
canvas->DrawBitmapInt(*checkmark_, checkmark_x, checkmark_y);
}
}
diff --git a/chrome/views/tree_view.cc b/chrome/views/tree_view.cc
index 0294788..3952ec0 100644
--- a/chrome/views/tree_view.cc
+++ b/chrome/views/tree_view.cc
@@ -290,7 +290,7 @@ HWND TreeView::CreateNativeControl(HWND parent_container) {
WC_TREEVIEW,
L"",
style,
- 0, 0, GetWidth(), GetHeight(),
+ 0, 0, width(), height(),
parent_container, NULL, NULL, NULL);
SetWindowLongPtr(tree_view_, GWLP_USERDATA,
reinterpret_cast<LONG_PTR>(&wrapper_));
@@ -444,8 +444,8 @@ void TreeView::OnContextMenu(const CPoint& location) {
return;
}
if (!valid_loc) {
- x = GetWidth() / 2;
- y = GetHeight() / 2;
+ x = width() / 2;
+ y = height() / 2;
}
CPoint screen_loc(x, y);
ConvertPointToScreen(this, &screen_loc);
diff --git a/chrome/views/view.cc b/chrome/views/view.cc
index 18dfd65..8230e58 100644
--- a/chrome/views/view.cc
+++ b/chrome/views/view.cc
@@ -125,8 +125,8 @@ void View::GetBounds(CRect* out, PositionMirroringSettings settings) const {
}
}
-// GetY(), GetWidth() and GetHeight() are agnostic to the RTL UI layout of the
-// parent view. GetX(), on the other hand, is not.
+// y(), width() and height() are agnostic to the RTL UI layout of the
+// parent view. x(), on the other hand, is not.
int View::GetX(PositionMirroringSettings settings) const {
if (settings == IGNORE_MIRRORING_TRANSFORMATION) {
return bounds_.left;
@@ -172,26 +172,26 @@ void View::GetLocalBounds(CRect* out, bool include_border) const {
if (include_border || border_ == NULL) {
out->left = 0;
out->top = 0;
- out->right = GetWidth();
- out->bottom = GetHeight();
+ out->right = width();
+ out->bottom = height();
} else {
gfx::Insets insets;
border_->GetInsets(&insets);
out->left = insets.left();
out->top = insets.top();
- out->right = GetWidth() - insets.left();
- out->bottom = GetHeight() - insets.top();
+ out->right = width() - insets.left();
+ out->bottom = height() - insets.top();
}
}
void View::GetSize(CSize* sz) const {
- sz->cx = GetWidth();
- sz->cy = GetHeight();
+ sz->cx = width();
+ sz->cy = height();
}
void View::GetPosition(CPoint* p) const {
p->x = GetX(APPLY_MIRRORING_TRANSFORMATION);
- p->y = GetY();
+ p->y = y();
}
void View::GetPreferredSize(CSize* out) {
@@ -205,8 +205,8 @@ void View::GetPreferredSize(CSize* out) {
void View::SizeToPreferredSize() {
CSize size;
GetPreferredSize(&size);
- if ((size.cx != GetWidth()) || (size.cy != GetHeight()))
- SetBounds(GetX(), GetY(), size.cx, size.cy);
+ if ((size.cx != width()) || (size.cy != height()))
+ SetBounds(x(), y(), size.cx, size.cy);
}
void View::GetMinimumSize(CSize* out) {
@@ -232,7 +232,7 @@ void View::ScrollRectToVisible(int x, int y, int width, int height) {
// the region.
if (parent)
parent->ScrollRectToVisible(
- GetX(APPLY_MIRRORING_TRANSFORMATION) + x, GetY() + y, width, height);
+ GetX(APPLY_MIRRORING_TRANSFORMATION) + x, View::y() + y, width, height);
}
/////////////////////////////////////////////////////////////////////////////
@@ -284,7 +284,7 @@ bool View::UILayoutIsRightToLeft() const {
inline int View::MirroredX() const {
View* parent = GetParent();
if (parent && parent->UILayoutIsRightToLeft()) {
- return parent->GetWidth() - bounds_.left - GetWidth();
+ return parent->width() - bounds_.left - width();
}
return bounds_.left;
}
@@ -293,7 +293,7 @@ int View::MirroredLeftPointForRect(const gfx::Rect& bounds) const {
if (!UILayoutIsRightToLeft()) {
return bounds.x();
}
- return GetWidth() - bounds.x() - bounds.width();
+ return width() - bounds.x() - bounds.width();
}
////////////////////////////////////////////////////////////////////////////////
@@ -395,7 +395,7 @@ void View::PaintBorder(ChromeCanvas* canvas) {
void View::PaintFocusBorder(ChromeCanvas* canvas) {
if (HasFocus() && IsFocusable())
- canvas->DrawFocusRect(0, 0, GetWidth(), GetHeight());
+ canvas->DrawFocusRect(0, 0, width(), height());
}
void View::PaintChildren(ChromeCanvas* canvas) {
@@ -438,7 +438,7 @@ void View::ProcessPaint(ChromeCanvas* canvas) {
// should change the transform appropriately.
bool flip_canvas = FlipCanvasOnPaintForRTLUI();
if (flip_canvas) {
- canvas->TranslateInt(GetWidth(), 0);
+ canvas->TranslateInt(width(), 0);
canvas->ScaleInt(-1, 1);
canvas->save();
}
@@ -527,8 +527,8 @@ void View::SetContextMenuController(ContextMenuController* menu_controller) {
bool View::ProcessMousePressed(const MouseEvent& e, DragInfo* drag_info) {
const bool enabled = enabled_;
int drag_operations;
- if (enabled && e.IsOnlyLeftMouseButton() && HitTest(WTL::CPoint(e.GetX(), e.GetY())))
- drag_operations = GetDragOperations(e.GetX(), e.GetY());
+ if (enabled && e.IsOnlyLeftMouseButton() && HitTest(WTL::CPoint(e.x(), e.y())))
+ drag_operations = GetDragOperations(e.x(), e.y());
else
drag_operations = 0;
ContextMenuController* context_menu_controller = context_menu_controller_;
@@ -540,7 +540,7 @@ bool View::ProcessMousePressed(const MouseEvent& e, DragInfo* drag_info) {
return result;
if (drag_operations != DragDropTypes::DRAG_NONE) {
- drag_info->PossibleDrag(e.GetX(), e.GetY());
+ drag_info->PossibleDrag(e.x(), e.y());
return true;
}
return !!context_menu_controller || result;
@@ -551,8 +551,8 @@ bool View::ProcessMouseDragged(const MouseEvent& e, DragInfo* drag_info) {
// done.
ContextMenuController* context_menu_controller = context_menu_controller_;
const bool possible_drag = drag_info->possible_drag;
- if (possible_drag && ExceededDragThreshold(drag_info->start_x - e.GetX(),
- drag_info->start_y - e.GetY())) {
+ if (possible_drag && ExceededDragThreshold(drag_info->start_x - e.x(),
+ drag_info->start_y - e.y())) {
DoDrag(e, drag_info->start_x, drag_info->start_y);
} else {
if (OnMouseDragged(e))
@@ -567,7 +567,7 @@ void View::ProcessMouseReleased(const MouseEvent& e, bool canceled) {
if (!canceled && context_menu_controller_ && e.IsOnlyRightMouseButton()) {
// Assume that if there is a context menu controller we won't be deleted
// from mouse released.
- CPoint location(e.GetX(), e.GetY());
+ CPoint location(e.x(), e.y());
ConvertPointToScreen(this, &location);
ContextMenuController* context_menu_controller = context_menu_controller_;
OnMouseReleased(e, canceled);
@@ -1159,8 +1159,8 @@ bool View::HasFloatingViewForPoint(int x, int y) {
for (i = 0, c = static_cast<int>(floating_views_.size()); i < c; ++i) {
v = floating_views_[i];
- r.SetRect(v->GetX(APPLY_MIRRORING_TRANSFORMATION), v->GetY(),
- v->GetWidth(), v->GetHeight());
+ r.SetRect(v->GetX(APPLY_MIRRORING_TRANSFORMATION), v->y(),
+ v->width(), v->height());
if (r.Contains(x, y))
return true;
}
@@ -1312,7 +1312,7 @@ void View::ConvertPointToView(View* src,
for (v = dst; v && v != src; v = v->GetParent()) {
offset.SetPoint(offset.x() + v->GetX(APPLY_MIRRORING_TRANSFORMATION),
- offset.y() + v->GetY());
+ offset.y() + v->y());
}
// The source was not found. The caller wants a conversion
@@ -1349,7 +1349,7 @@ void View::ConvertPointToViewContainer(View* src, CPoint* p) {
for (v = src; v; v = v->GetParent()) {
offset.x += v->GetX(APPLY_MIRRORING_TRANSFORMATION);
- offset.y += v->GetY();
+ offset.y += v->y();
}
p->x += offset.x;
p->y += offset.y;
@@ -1445,7 +1445,7 @@ bool View::IsVisibleInRootView() const {
}
bool View::HitTest(const CPoint& l) const {
- if (l.x >= 0 && l.x < GetWidth() && l.y >= 0 && l.y < GetHeight()) {
+ if (l.x >= 0 && l.x < width() && l.y >= 0 && l.y < height()) {
if (HasHitTestMask()) {
gfx::Path mask;
GetHitTestMask(&mask);
@@ -1589,7 +1589,7 @@ std::string View::GetClassName() const {
}
gfx::Rect View::GetVisibleBounds() {
- gfx::Rect vis_bounds(0, 0, GetWidth(), GetHeight());
+ gfx::Rect vis_bounds(0, 0, width(), height());
gfx::Rect ancestor_bounds;
View* view = this;
int root_x = 0;
@@ -1597,12 +1597,12 @@ gfx::Rect View::GetVisibleBounds() {
bool has_view_container = false;
while (view != NULL && !vis_bounds.IsEmpty()) {
root_x += view->GetX(APPLY_MIRRORING_TRANSFORMATION);
- root_y += view->GetY();
- vis_bounds.Offset(view->GetX(APPLY_MIRRORING_TRANSFORMATION), view->GetY());
+ root_y += view->y();
+ vis_bounds.Offset(view->GetX(APPLY_MIRRORING_TRANSFORMATION), view->y());
View* ancestor = view->GetParent();
if (ancestor != NULL) {
- ancestor_bounds.SetRect(0, 0, ancestor->GetWidth(),
- ancestor->GetHeight());
+ ancestor_bounds.SetRect(0, 0, ancestor->width(),
+ ancestor->height());
vis_bounds = vis_bounds.Intersect(ancestor_bounds);
} else if (!view->GetViewContainer()) {
// If the view has no ViewContainer, we're not visible. Return an empty
diff --git a/chrome/views/view.h b/chrome/views/view.h
index a4ae692..cd9a89f 100644
--- a/chrome/views/view.h
+++ b/chrome/views/view.h
@@ -118,7 +118,7 @@ class View : public AcceleratorTarget {
CURRENT
};
- // Used in the versions of GetBounds() and GetX() that take a transformation
+ // Used in the versions of GetBounds() and x() that take a transformation
// parameter in order to determine whether or not to take into account the
// mirroring setting of the View when returning bounds positions.
enum PositionMirroringSettings {
@@ -160,17 +160,19 @@ class View : public AcceleratorTarget {
// Set the bounds in the parent's coordinate system.
void SetBounds(const CRect& bounds);
void SetBounds(int x, int y, int width, int height);
- void SetX(int x) { SetBounds(x, GetY(), GetWidth(), GetHeight()); }
- void SetY(int y) { SetBounds(GetX(), y, GetWidth(), GetHeight()); }
+ void SetX(int x) { SetBounds(x, y(), width(), height()); }
+ void SetY(int y) { SetBounds(x(), y, width(), height()); }
// Returns the left coordinate of the View, relative to the parent View,
- // which is essentially the value of bounds_.left.
+ // which is the value of bounds_.left.
//
// This is the function subclasses should use whenever they need to obtain
// the left position of one of their child views (for example, when
// implementing View::Layout()).
- int GetX() const {
- return GetX(IGNORE_MIRRORING_TRANSFORMATION);
+ int x() const {
+ // This is equivalent to GetX(IGNORE_MIRRORING_TRANSFORMATION), but
+ // inlinable.
+ return bounds_.left;
};
// Return the left coordinate of the View, relative to the parent. If
@@ -181,22 +183,22 @@ class View : public AcceleratorTarget {
//
// NOTE: in the vast majority of the cases, the mirroring implementation is
// transparent to the View subclasses and therefore you should use the
- // paremeterless version of GetX() when you need to get the X
+ // paremeterless version of x() when you need to get the X
// coordinate of a child View.
int GetX(PositionMirroringSettings settings) const;
- int GetY() const {
+ int y() const {
return bounds_.top;
};
- int GetWidth() const {
+ int width() const {
return bounds_.Width();
};
- int GetHeight() const {
+ int height() const {
return bounds_.Height();
};
// Return this control local bounds. If include_border is true, local bounds
- // is the rectangle {0, 0, GetWidth(), GetHeight()}, otherwise, it does not
+ // is the rectangle {0, 0, width(), height()}, otherwise, it does not
// include the area where the border (if any) is painted.
void GetLocalBounds(CRect* out, bool include_border) const;
@@ -206,7 +208,7 @@ class View : public AcceleratorTarget {
// Get the position of the View, relative to the parent.
//
// Note that if the parent uses right-to-left UI layout, then the mirrored
- // position of this View is returned. Use GetX()/GetY() if you want to ignore
+ // position of this View is returned. Use x()/y() if you want to ignore
// mirroring.
void GetPosition(CPoint* out) const;
@@ -352,7 +354,7 @@ class View : public AcceleratorTarget {
// MirroredXCoordinateInsideView(20) -> 80
// MirroredXCoordinateInsideView(99) -> 1
int MirroredXCoordinateInsideView(int x) const {
- return UILayoutIsRightToLeft() ? GetWidth() - x : x;
+ return UILayoutIsRightToLeft() ? width() - x : x;
}
// Painting functions
diff --git a/chrome/views/view_unittest.cc b/chrome/views/view_unittest.cc
index c4faf75..4894525 100644
--- a/chrome/views/view_unittest.cc
+++ b/chrome/views/view_unittest.cc
@@ -258,22 +258,22 @@ TEST_F(ViewTest, AddRemoveNotifications) {
bool TestView::OnMousePressed(const MouseEvent& event) {
last_mouse_event_type_ = event.GetType();
- location_.x = event.GetX();
- location_.y = event.GetY();
+ location_.x = event.x();
+ location_.y = event.y();
return true;
}
bool TestView::OnMouseDragged(const MouseEvent& event) {
last_mouse_event_type_ = event.GetType();
- location_.x = event.GetX();
- location_.y = event.GetY();
+ location_.x = event.x();
+ location_.y = event.y();
return true;
}
void TestView::OnMouseReleased(const MouseEvent& event, bool canceled) {
last_mouse_event_type_ = event.GetType();
- location_.x = event.GetX();
- location_.y = event.GetY();
+ location_.x = event.x();
+ location_.y = event.y();
}
TEST_F(ViewTest, MouseEvent) {
@@ -524,8 +524,8 @@ class HitTestView : public ChromeViews::View {
DCHECK(has_hittest_mask_);
DCHECK(mask);
- SkScalar w = SkIntToScalar(GetWidth());
- SkScalar h = SkIntToScalar(GetHeight());
+ SkScalar w = SkIntToScalar(width());
+ SkScalar h = SkIntToScalar(height());
// Create a triangular mask within the bounds of this View.
mask->moveTo(w / 2, 0);
diff --git a/chrome/views/window.cc b/chrome/views/window.cc
index d75ea9e..1729598 100644
--- a/chrome/views/window.cc
+++ b/chrome/views/window.cc
@@ -435,8 +435,8 @@ LRESULT Window::OnSetCursor(HWND window, UINT hittest_code, UINT message) {
}
void Window::OnSize(UINT size_param, const CSize& new_size) {
- if (root_view_->GetWidth() == new_size.cx &&
- root_view_->GetHeight() == new_size.cy)
+ if (root_view_->width() == new_size.cx &&
+ root_view_->height() == new_size.cy)
return;
SaveWindowPosition();