| OLD | NEW |
| 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "chrome/browser/gtk/bookmark_bar_gtk.h" | 5 #include "chrome/browser/gtk/bookmark_bar_gtk.h" |
| 6 | 6 |
| 7 #include <vector> | 7 #include <vector> |
| 8 | 8 |
| 9 #include "app/gfx/gtk_util.h" | 9 #include "app/gfx/gtk_util.h" |
| 10 #include "app/gfx/canvas_paint.h" | 10 #include "app/gfx/canvas_paint.h" |
| (...skipping 1160 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1171 event->area.x + event->area.width - tabstrip_origin.x(), | 1171 event->area.x + event->area.width - tabstrip_origin.x(), |
| 1172 event->area.y + event->area.height - tabstrip_origin.y()); | 1172 event->area.y + event->area.height - tabstrip_origin.y()); |
| 1173 cairo_fill(cr); | 1173 cairo_fill(cr); |
| 1174 | 1174 |
| 1175 cairo_destroy(cr); | 1175 cairo_destroy(cr); |
| 1176 } else { | 1176 } else { |
| 1177 gfx::Size tab_contents_size; | 1177 gfx::Size tab_contents_size; |
| 1178 if (!bar->GetTabContentsSize(&tab_contents_size)) | 1178 if (!bar->GetTabContentsSize(&tab_contents_size)) |
| 1179 return FALSE; | 1179 return FALSE; |
| 1180 gfx::CanvasPaint canvas(event, true); | 1180 gfx::CanvasPaint canvas(event, true); |
| 1181 |
| 1182 gfx::Rect area = GTK_WIDGET_NO_WINDOW(widget) ? |
| 1183 gfx::Rect(widget->allocation) : |
| 1184 gfx::Rect(0, 0, widget->allocation.width, widget->allocation.height); |
| 1181 NtpBackgroundUtil::PaintBackgroundDetachedMode(theme_provider, &canvas, | 1185 NtpBackgroundUtil::PaintBackgroundDetachedMode(theme_provider, &canvas, |
| 1182 // We can't just use gfx::Rect(widget->allocation) because the x,y for | 1186 area, tab_contents_size.height()); |
| 1183 // the allocation is relative to the parent widget rather than the | |
| 1184 // GdkWindow. | |
| 1185 gfx::Rect(0, 0, widget->allocation.width, widget->allocation.height), | |
| 1186 tab_contents_size.height()); | |
| 1187 } | 1187 } |
| 1188 | 1188 |
| 1189 return FALSE; // Propagate expose to children. | 1189 return FALSE; // Propagate expose to children. |
| 1190 } | 1190 } |
| 1191 | 1191 |
| 1192 // static | 1192 // static |
| 1193 void BookmarkBarGtk::OnParentSizeAllocate(GtkWidget* widget, | 1193 void BookmarkBarGtk::OnParentSizeAllocate(GtkWidget* widget, |
| 1194 GtkAllocation* allocation, | 1194 GtkAllocation* allocation, |
| 1195 BookmarkBarGtk* bar) { | 1195 BookmarkBarGtk* bar) { |
| 1196 // In floating mode, our layout depends on the size of the tab contents. | 1196 // In floating mode, our layout depends on the size of the tab contents. |
| (...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1323 string16 link_text; | 1323 string16 link_text; |
| 1324 SyncStatusUIHelper::MessageType sync_status; | 1324 SyncStatusUIHelper::MessageType sync_status; |
| 1325 sync_status = SyncStatusUIHelper::GetLabels( | 1325 sync_status = SyncStatusUIHelper::GetLabels( |
| 1326 sync_service_, &status_text, &link_text); | 1326 sync_service_, &status_text, &link_text); |
| 1327 if (sync_status == SyncStatusUIHelper::SYNC_ERROR) { | 1327 if (sync_status == SyncStatusUIHelper::SYNC_ERROR) { |
| 1328 show_sync_error_button = true; | 1328 show_sync_error_button = true; |
| 1329 } | 1329 } |
| 1330 } | 1330 } |
| 1331 return show_sync_error_button; | 1331 return show_sync_error_button; |
| 1332 } | 1332 } |
| OLD | NEW |