Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(5203)

Unified Diff: chrome/browser/ui/views/global_error_bubble_view.cc

Issue 941133002: Update global error bubble view's boundary (position and size) after loading elevation icon. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/browser/ui/views/global_error_bubble_view.cc
diff --git a/chrome/browser/ui/views/global_error_bubble_view.cc b/chrome/browser/ui/views/global_error_bubble_view.cc
index b4eee9fe2c08966e578db2612a0a4d25061ec5ef..601ca382013dbeb580ee2c6cd4df8a2dbab97d93 100644
--- a/chrome/browser/ui/views/global_error_bubble_view.cc
+++ b/chrome/browser/ui/views/global_error_bubble_view.cc
@@ -102,7 +102,10 @@ GlobalErrorBubbleView::GlobalErrorBubbleView(
accept_button->SetIsDefault(true);
accept_button->set_tag(TAG_ACCEPT_BUTTON);
if (error_->ShouldAddElevationIconToAcceptButton())
- elevation_icon_setter_.reset(new ElevationIconSetter(accept_button.get()));
+ elevation_icon_setter_.reset(
+ new ElevationIconSetter(
+ accept_button.get(),
+ base::Bind(&GlobalErrorBubbleView::UpdateBound, AsWeakPtr())));
Peter Kasting 2015/02/21 01:06:27 Why not just pass &views::BubbleDelegateView::Size
xiaoling 2015/02/21 01:15:00 Because the function is the protected. Is there an
Peter Kasting 2015/02/21 01:21:49 Sorry, try passing &GlobalErrorBubbleView::SizeToC
xiaoling 2015/02/23 18:19:41 Thanks for the trick. It worked, although I'm not
base::string16 cancel_string(error_->GetBubbleViewCancelButtonLabel());
scoped_ptr<views::LabelButton> cancel_button;
@@ -169,6 +172,10 @@ GlobalErrorBubbleView::GlobalErrorBubbleView(
set_close_on_deactivate(error_->ShouldCloseOnDeactivate());
}
+void GlobalErrorBubbleView::UpdateBound() {
+ views::BubbleDelegateView::SizeToContents();
+}
+
GlobalErrorBubbleView::~GlobalErrorBubbleView() {
// |elevation_icon_setter_| references |accept_button_|, so make sure it is
// destroyed before |accept_button_|.
« no previous file with comments | « chrome/browser/ui/views/global_error_bubble_view.h ('k') | chrome/browser/ui/views/infobars/confirm_infobar.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698