Commit 01ad5021 authored by sky@chromium.org's avatar sky@chromium.org

Attempt at fixing crash. Because BrowserActionView lazily creates its

button it is entirely possible for Layout() to be invoked before the
button_ has been created.

BUG=143001
TEST=none
R=ben@chromium.org

Review URL: https://chromiumcodereview.appspot.com/10857024

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@151828 0039d316-1c4b-4281-b951-d872f2087c98
parent c9fa5968
......@@ -57,7 +57,7 @@ void ActionBoxMenu::RunMenu(views::MenuButton* menu_button) {
}
void ActionBoxMenu::ExecuteCommand(int id) {
};
}
views::Border* ActionBoxMenu::CreateMenuBorder() {
// TODO(yefim): Use correct theme color on non-Windows.
......
......@@ -64,6 +64,10 @@ gfx::ImageSkia BrowserActionView::GetIconWithBadge() {
}
void BrowserActionView::Layout() {
// |button_| is NULL if Layout() is invoked before we have a valid widget.
if (!button_)
return;
// We can't rely on button_->GetPreferredSize() here because that's not set
// correctly until the first call to
// BrowserActionsContainer::RefreshBrowserActionViews(), whereas this can be
......
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