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

Unified Diff: chrome/browser/ui/gtk/status_bubble_gtk.cc

Issue 8773025: GTK: More removal of raw GtkWidget->allocation access. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Created 9 years, 1 month 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
« no previous file with comments | « chrome/browser/ui/gtk/notifications/balloon_view_gtk.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/gtk/status_bubble_gtk.cc
diff --git a/chrome/browser/ui/gtk/status_bubble_gtk.cc b/chrome/browser/ui/gtk/status_bubble_gtk.cc
index 7d113ea1b0cbcce66ce8573be7f7975ed633adf0..a5c34f0c459c3b41ef9e77d2a8ec35fdbdccbdda 100644
--- a/chrome/browser/ui/gtk/status_bubble_gtk.cc
+++ b/chrome/browser/ui/gtk/status_bubble_gtk.cc
@@ -97,7 +97,9 @@ void StatusBubbleGtk::SetStatusTextToURL() {
if (!parent || !gtk_widget_get_realized(parent))
return;
- int desired_width = parent->allocation.width;
+ GtkAllocation allocation;
+ gtk_widget_get_allocation(parent, &allocation);
+ int desired_width = allocation.width;
if (!expanded()) {
expand_timer_.Stop();
expand_timer_.Start(FROM_HERE,
@@ -190,6 +192,9 @@ void StatusBubbleGtk::MouseMoved(
GtkRequisition requisition;
gtk_widget_size_request(container_.get(), &requisition);
+ GtkAllocation parent_allocation;
+ gtk_widget_get_allocation(parent, &parent_allocation);
+
// Get our base position (that is, not including the current offset)
// relative to the origin of the root window.
gint toplevel_x = 0, toplevel_y = 0;
@@ -198,9 +203,9 @@ void StatusBubbleGtk::MouseMoved(
gtk_util::GetWidgetRectRelativeToToplevel(parent);
gfx::Rect bubble_rect(
toplevel_x + parent_rect.x() +
- (ltr ? 0 : parent->allocation.width - requisition.width),
+ (ltr ? 0 : parent_allocation.width - requisition.width),
toplevel_y + parent_rect.y() +
- parent->allocation.height - requisition.height,
+ parent_allocation.height - requisition.height,
requisition.width,
requisition.height);
@@ -328,7 +333,9 @@ void StatusBubbleGtk::SetFlipHorizontally(bool flip_horizontally) {
}
void StatusBubbleGtk::ExpandURL() {
- start_width_ = label_.get()->allocation.width;
+ GtkAllocation allocation;
+ gtk_widget_get_allocation(label_.get(), &allocation);
+ start_width_ = allocation.width;
expand_animation_.reset(new ui::SlideAnimation(this));
expand_animation_->SetTweenType(ui::Tween::LINEAR);
expand_animation_->Show();
« no previous file with comments | « chrome/browser/ui/gtk/notifications/balloon_view_gtk.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698