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

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

Issue 8872004: GTK: More changes from raw widget->allocation to using the accessor. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Created 9 years 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/bubble/bubble_gtk.cc ('k') | chrome/browser/ui/gtk/nine_box.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/gtk/find_bar_gtk.cc
diff --git a/chrome/browser/ui/gtk/find_bar_gtk.cc b/chrome/browser/ui/gtk/find_bar_gtk.cc
index 07caea5a5a6c7a13bf64c3a76201358b48586599..06f0ec25fc093cc0117f14d877d1eacbd93a51f1 100644
--- a/chrome/browser/ui/gtk/find_bar_gtk.cc
+++ b/chrome/browser/ui/gtk/find_bar_gtk.cc
@@ -422,8 +422,11 @@ gfx::Rect FindBarGtk::GetDialogPosition(gfx::Rect avoid_overlapping_rect) {
// The height is not used.
// At very low browser widths we can wind up with a negative |dialog_bounds|
// width, so clamp it to 0.
+ GtkAllocation parent_allocation;
+ gtk_widget_get_allocation(gtk_widget_get_parent(widget()),
+ &parent_allocation);
gfx::Rect dialog_bounds = gfx::Rect(ltr ? 0 : 15, 0,
- std::max(0, widget()->parent->allocation.width - (ltr ? 15 : 0)), 0);
+ std::max(0, parent_allocation.width - (ltr ? 15 : 0)), 0);
GtkRequisition req;
gtk_widget_size_request(container_, &req);
@@ -575,7 +578,9 @@ string16 FindBarGtk::GetMatchCountText() {
}
int FindBarGtk::GetWidth() {
- return container_->allocation.width;
+ GtkAllocation allocation;
+ gtk_widget_get_allocation(container_, &allocation);
+ return allocation.width;
}
void FindBarGtk::FindEntryTextInContents(bool forward_search) {
« no previous file with comments | « chrome/browser/ui/gtk/bubble/bubble_gtk.cc ('k') | chrome/browser/ui/gtk/nine_box.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698