Commit 655a02bf authored by Peter Kasting's avatar Peter Kasting Committed by Commit Bot

Make declaration/definition order match parent class.

BUG=none
TEST=none
TBR=estade

Change-Id: Ida938109e9ce253f9c496be144c3ca5828f609a6
Reviewed-on: https://chromium-review.googlesource.com/996919Reviewed-by: default avatarPeter Kasting <pkasting@chromium.org>
Commit-Queue: Peter Kasting <pkasting@chromium.org>
Cr-Commit-Position: refs/heads/master@{#548293}
parent d22bdd95
...@@ -63,36 +63,6 @@ InfoBarContainerView::~InfoBarContainerView() { ...@@ -63,36 +63,6 @@ InfoBarContainerView::~InfoBarContainerView() {
RemoveAllInfoBarsForDestruction(); RemoveAllInfoBarsForDestruction();
} }
gfx::Size InfoBarContainerView::CalculatePreferredSize() const {
gfx::Size size;
// Iterate over all infobars; the last child is the content shadow.
for (int i = 0; i < child_count() - 1; ++i) {
const gfx::Size child_size = child_at(i)->GetPreferredSize();
size.Enlarge(0, child_size.height());
size.SetToMax(child_size); // Only affects our width.
}
// No need to reserve space for the bottom bar's separator; the shadow is good
// enough.
size.Enlarge(0, -InfoBarContainerDelegate::kSeparatorLineHeight);
// Don't reserve space for the bottom shadow here. Because the shadow paints
// to its own layer and this class doesn't, it can paint outside the size
// computed here. Not including the shadow bounds means the browser will
// automatically lay out web content beginning below the bottom infobar
// (instead of below the shadow), and clicks in the shadow region will go to
// the web content instead of the infobars; both of these effects are
// desirable. On the other hand, it also means the browser doesn't know the
// shadow is there and could lay out something atop it or size the window too
// small for it; but these are unlikely.
return size;
}
const char* InfoBarContainerView::GetClassName() const {
return kViewClassName;
}
void InfoBarContainerView::Layout() { void InfoBarContainerView::Layout() {
int top = 0; int top = 0;
...@@ -118,11 +88,41 @@ void InfoBarContainerView::Layout() { ...@@ -118,11 +88,41 @@ void InfoBarContainerView::Layout() {
content_shadow_->GetPreferredSize().height()); content_shadow_->GetPreferredSize().height());
} }
const char* InfoBarContainerView::GetClassName() const {
return kViewClassName;
}
void InfoBarContainerView::GetAccessibleNodeData(ui::AXNodeData* node_data) { void InfoBarContainerView::GetAccessibleNodeData(ui::AXNodeData* node_data) {
node_data->role = ax::mojom::Role::kGroup; node_data->role = ax::mojom::Role::kGroup;
node_data->SetName(l10n_util::GetStringUTF8(IDS_ACCNAME_INFOBAR_CONTAINER)); node_data->SetName(l10n_util::GetStringUTF8(IDS_ACCNAME_INFOBAR_CONTAINER));
} }
gfx::Size InfoBarContainerView::CalculatePreferredSize() const {
gfx::Size size;
// Iterate over all infobars; the last child is the content shadow.
for (int i = 0; i < child_count() - 1; ++i) {
const gfx::Size child_size = child_at(i)->GetPreferredSize();
size.Enlarge(0, child_size.height());
size.SetToMax(child_size); // Only affects our width.
}
// No need to reserve space for the bottom bar's separator; the shadow is good
// enough.
size.Enlarge(0, -InfoBarContainerDelegate::kSeparatorLineHeight);
// Don't reserve space for the bottom shadow here. Because the shadow paints
// to its own layer and this class doesn't, it can paint outside the size
// computed here. Not including the shadow bounds means the browser will
// automatically lay out web content beginning below the bottom infobar
// (instead of below the shadow), and clicks in the shadow region will go to
// the web content instead of the infobars; both of these effects are
// desirable. On the other hand, it also means the browser doesn't know the
// shadow is there and could lay out something atop it or size the window too
// small for it; but these are unlikely.
return size;
}
void InfoBarContainerView::PlatformSpecificAddInfoBar( void InfoBarContainerView::PlatformSpecificAddInfoBar(
infobars::InfoBar* infobar, infobars::InfoBar* infobar,
size_t position) { size_t position) {
......
...@@ -21,11 +21,11 @@ class InfoBarContainerView : public views::AccessiblePaneView, ...@@ -21,11 +21,11 @@ class InfoBarContainerView : public views::AccessiblePaneView,
explicit InfoBarContainerView(Delegate* delegate); explicit InfoBarContainerView(Delegate* delegate);
~InfoBarContainerView() override; ~InfoBarContainerView() override;
// AccessiblePaneView: // views::AccessiblePaneView:
gfx::Size CalculatePreferredSize() const override;
const char* GetClassName() const override;
void Layout() override; void Layout() override;
const char* GetClassName() const override;
void GetAccessibleNodeData(ui::AXNodeData* node_data) override; void GetAccessibleNodeData(ui::AXNodeData* node_data) override;
gfx::Size CalculatePreferredSize() const override;
// InfobarContainer: // InfobarContainer:
void PlatformSpecificAddInfoBar(infobars::InfoBar* infobar, void PlatformSpecificAddInfoBar(infobars::InfoBar* infobar,
......
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