Refactor ScrollableShelf on |space_for_icons_|

|space_for_icons_| indicates the available space in scrollable shelf
to accommodate shelf icons. Now it is an integer type. Replace it with
gfx::Rect.

Bug: 997807
Change-Id: I4f9ba3206bd69dfdaf50894de46239e676db6454
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1801326
Commit-Queue: Andrew Xu <andrewxu@chromium.org>
Reviewed-by: Manu Cornet <manucornet@chromium.org>
Reviewed-by: Xiyuan Xia <xiyuan@chromium.org>
Cr-Commit-Position: refs/heads/master@{#696446}
void ScrollableShelfView::UpdateLayoutStrategy(int available_length) {
  gfx::Size preferred_size = GetPreferredSize();
  int preferred_length = GetShelf()->IsHorizontalAlignment()
                             ? preferred_size.width()
                             : preferred_size.height();
  preferred_length += 2 * GetAppIconEndPadding();

  int scroll_length = GetShelf()->IsHorizontalAlignment() ? scroll_offset_.x()
                                                          : scroll_offset_.y();

  if (preferred_length <= available_length) {
    layout_strategy_ = kNotShowArrowButtons;
  } else if (scroll_length == 0) {
    layout_strategy_ = kShowRightArrowButton;
  } else if (scroll_length == CalculateScrollUpperBound()) {
    layout_strategy_ = kShowLeftArrowButton;
  } else {
    layout_strategy_ = kShowButtons;
  }
}

void ScrollableShelfView::UpdateLayoutStrategy(int available_length) {
  gfx::Size preferred_size = GetPreferredSize();
  int preferred_length = GetShelf()->IsHorizontalAlignment()
                             ? preferred_size.width()
                             : preferred_size.height();
  preferred_length += 2 * GetAppIconEndPadding();

  int scroll_length = GetShelf()->IsHorizontalAlignment() ? scroll_offset_.x()
                                                          : scroll_offset_.y();

  if (preferred_length <= available_length) {
    layout_strategy_ = kNotShowArrowButtons;
  } else if (scroll_length == 0) {
    layout_strategy_ = kShowRightArrowButton;
  } else if (scroll_length == CalculateScrollUpperBound()) {
    layout_strategy_ = kShowLeftArrowButton;
  } else {
    layout_strategy_ = kShowButtons;
  }
}
