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

Unified Diff: chrome/browser/ui/gtk/tabs/dragged_view_gtk.cc

Issue 8921022: GTK: Even more cleanup to access allocation through 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/menu_bar_helper.cc ('k') | chrome/browser/ui/gtk/tabs/tab_gtk.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/gtk/tabs/dragged_view_gtk.cc
diff --git a/chrome/browser/ui/gtk/tabs/dragged_view_gtk.cc b/chrome/browser/ui/gtk/tabs/dragged_view_gtk.cc
index 30859c52d10166d29c714fae720b36be957e4658..634f6c08d545978ba29c8c76a152ac6d4913dadf 100644
--- a/chrome/browser/ui/gtk/tabs/dragged_view_gtk.cc
+++ b/chrome/browser/ui/gtk/tabs/dragged_view_gtk.cc
@@ -344,7 +344,10 @@ void DraggedViewGtk::SetContainerShapeMask() {
cairo_set_operator(cairo_context, CAIRO_OPERATOR_SOURCE);
else
cairo_set_operator(cairo_context, CAIRO_OPERATOR_OVER);
- PaintTab(i, container_, cairo_context, container_->allocation.width);
+
+ GtkAllocation allocation;
+ gtk_widget_get_allocation(container_, &allocation);
+ PaintTab(i, container_, cairo_context, allocation.width);
}
if (!attached_) {
@@ -383,6 +386,9 @@ gboolean DraggedViewGtk::OnExpose(GtkWidget* widget, GdkEventExpose* event) {
int tab_height = static_cast<int>(
kScalingFactor * renderers_[drag_data_->source_tab_index()]->height());
+ GtkAllocation allocation;
+ gtk_widget_get_allocation(widget, &allocation);
+
// Draw the render area.
BackingStore* backing_store = drag_data_->GetSourceTabContents()->
render_view_host()->GetBackingStore(false);
@@ -390,8 +396,8 @@ gboolean DraggedViewGtk::OnExpose(GtkWidget* widget, GdkEventExpose* event) {
// This leaves room for the border.
static_cast<BackingStoreGtk*>(backing_store)->PaintToRect(
gfx::Rect(kDragFrameBorderSize, tab_height,
- widget->allocation.width - kTwiceDragFrameBorderSize,
- widget->allocation.height - tab_height -
+ allocation.width - kTwiceDragFrameBorderSize,
+ allocation.height - tab_height -
kDragFrameBorderSize),
GDK_DRAWABLE(widget->window));
}
@@ -408,8 +414,8 @@ gboolean DraggedViewGtk::OnExpose(GtkWidget* widget, GdkEventExpose* event) {
double offset = kDragFrameBorderSize / 2.0 - 0.5;
double left_x = offset;
double top_y = tab_height - kDragFrameBorderSize + offset;
- double right_x = widget->allocation.width - offset;
- double bottom_y = widget->allocation.height - offset;
+ double right_x = allocation.width - offset;
+ double bottom_y = allocation.height - offset;
cairo_move_to(cr, left_x, top_y);
cairo_line_to(cr, left_x, bottom_y);
@@ -426,11 +432,11 @@ gboolean DraggedViewGtk::OnExpose(GtkWidget* widget, GdkEventExpose* event) {
for (int i = renderers_.size() - 1; i >= 0; i--) {
if (i == drag_data_->source_tab_index())
continue;
- PaintTab(i, widget, cr, widget->allocation.width);
+ PaintTab(i, widget, cr, allocation.width);
}
// Painting the active tab last, so that it appears on top.
PaintTab(drag_data_->source_tab_index(), widget, cr,
- widget->allocation.width);
+ allocation.width);
cairo_destroy(cr);
« no previous file with comments | « chrome/browser/ui/gtk/menu_bar_helper.cc ('k') | chrome/browser/ui/gtk/tabs/tab_gtk.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698