Commit a7a0c21c authored by Daniel Bratell's avatar Daniel Bratell Committed by Commit Bot

Rename one of two ItemView classes

There is one ItemView class in notification_view_md.h so if that
header is in the same translation unit as notification_view.cc
then the local ItemView class will fail to compile. That happens
in jumbo builds.

Bug: 773275
Change-Id: I2911c4cbcc73df186d9520d4182a186a76d2ce34
Reviewed-on: https://chromium-review.googlesource.com/824364
Commit-Queue: Daniel Bratell <bratell@opera.com>
Commit-Queue: Peter Beverloo <peter@chromium.org>
Reviewed-by: default avatarPeter Beverloo <peter@chromium.org>
Cr-Commit-Position: refs/heads/master@{#523774}
parent 883d108c
...@@ -85,23 +85,23 @@ std::unique_ptr<views::Border> MakeSeparatorBorder(int top, ...@@ -85,23 +85,23 @@ std::unique_ptr<views::Border> MakeSeparatorBorder(int top,
return views::CreateSolidSidedBorder(top, left, 0, 0, color); return views::CreateSolidSidedBorder(top, left, 0, 0, color);
} }
// ItemView //////////////////////////////////////////////////////////////////// // NotificationItemView ////////////////////////////////////////////////////////
// ItemViews are responsible for drawing each list notification item's title and // NotificationItemViews are responsible for drawing each list notification
// message next to each other within a single column. // item's title and message next to each other within a single column.
class ItemView : public views::View { class NotificationItemView : public views::View {
public: public:
explicit ItemView(const NotificationItem& item); explicit NotificationItemView(const NotificationItem& item);
~ItemView() override; ~NotificationItemView() override;
// Overridden from views::View: // Overridden from views::View:
void SetVisible(bool visible) override; void SetVisible(bool visible) override;
private: private:
DISALLOW_COPY_AND_ASSIGN(ItemView); DISALLOW_COPY_AND_ASSIGN(NotificationItemView);
}; };
ItemView::ItemView(const NotificationItem& item) { NotificationItemView::NotificationItemView(const NotificationItem& item) {
SetLayoutManager(new views::BoxLayout(views::BoxLayout::kHorizontal, SetLayoutManager(new views::BoxLayout(views::BoxLayout::kHorizontal,
gfx::Insets(), gfx::Insets(),
kItemTitleToMessagePadding)); kItemTitleToMessagePadding));
...@@ -124,10 +124,9 @@ ItemView::ItemView(const NotificationItem& item) { ...@@ -124,10 +124,9 @@ ItemView::ItemView(const NotificationItem& item) {
SchedulePaint(); SchedulePaint();
} }
ItemView::~ItemView() { NotificationItemView::~NotificationItemView() {}
}
void ItemView::SetVisible(bool visible) { void NotificationItemView::SetVisible(bool visible) {
views::View::SetVisible(visible); views::View::SetVisible(visible);
for (int i = 0; i < child_count(); ++i) for (int i = 0; i < child_count(); ++i)
child_at(i)->SetVisible(visible); child_at(i)->SetVisible(visible);
...@@ -522,7 +521,7 @@ void NotificationView::CreateOrUpdateListItemViews( ...@@ -522,7 +521,7 @@ void NotificationView::CreateOrUpdateListItemViews(
DCHECK(top_view_); DCHECK(top_view_);
for (size_t i = 0; i < items.size() && i < kNotificationMaximumItems; ++i) { for (size_t i = 0; i < items.size() && i < kNotificationMaximumItems; ++i) {
ItemView* item_view = new ItemView(items[i]); NotificationItemView* item_view = new NotificationItemView(items[i]);
item_view->SetBorder(MakeTextBorder(padding, i ? 0 : 4, 0)); item_view->SetBorder(MakeTextBorder(padding, i ? 0 : 4, 0));
item_views_.push_back(item_view); item_views_.push_back(item_view);
top_view_->AddChildView(item_view); top_view_->AddChildView(item_view);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment