| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/ui/gtk/bookmarks/bookmark_bar_gtk.h" | 5 #include "chrome/browser/ui/gtk/bookmarks/bookmark_bar_gtk.h" |
| 6 | 6 |
| 7 #include <vector> | 7 #include <vector> |
| 8 | 8 |
| 9 #include "base/metrics/histogram.h" | 9 #include "base/metrics/histogram.h" |
| 10 #include "base/utf_string_conversions.h" | 10 #include "base/utf_string_conversions.h" |
| (...skipping 1351 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1362 gfx::Point tabstrip_origin = | 1362 gfx::Point tabstrip_origin = |
| 1363 tabstrip_origin_provider_->GetTabStripOriginForWidget(widget); | 1363 tabstrip_origin_provider_->GetTabStripOriginForWidget(widget); |
| 1364 gtk_util::DrawThemedToolbarBackground(widget, cr, event, tabstrip_origin, | 1364 gtk_util::DrawThemedToolbarBackground(widget, cr, event, tabstrip_origin, |
| 1365 theme_provider); | 1365 theme_provider); |
| 1366 | 1366 |
| 1367 cairo_destroy(cr); | 1367 cairo_destroy(cr); |
| 1368 } else { | 1368 } else { |
| 1369 gfx::Size tab_contents_size; | 1369 gfx::Size tab_contents_size; |
| 1370 if (!GetTabContentsSize(&tab_contents_size)) | 1370 if (!GetTabContentsSize(&tab_contents_size)) |
| 1371 return FALSE; | 1371 return FALSE; |
| 1372 gfx::CanvasSkiaPaint canvas(event, true); | 1372 gfx::CanvasSkiaPaint canvas_paint(event, true); |
| 1373 | 1373 |
| 1374 gfx::Rect area = GTK_WIDGET_NO_WINDOW(widget) ? | 1374 gfx::Rect area = GTK_WIDGET_NO_WINDOW(widget) ? |
| 1375 gfx::Rect(widget->allocation) : | 1375 gfx::Rect(widget->allocation) : |
| 1376 gfx::Rect(0, 0, widget->allocation.width, widget->allocation.height); | 1376 gfx::Rect(0, 0, widget->allocation.width, widget->allocation.height); |
| 1377 NtpBackgroundUtil::PaintBackgroundDetachedMode(theme_provider, &canvas, | 1377 NtpBackgroundUtil::PaintBackgroundDetachedMode(theme_provider, |
| 1378 area, tab_contents_size.height()); | 1378 canvas_paint.AsCanvas(), area, tab_contents_size.height()); |
| 1379 } | 1379 } |
| 1380 | 1380 |
| 1381 return FALSE; // Propagate expose to children. | 1381 return FALSE; // Propagate expose to children. |
| 1382 } | 1382 } |
| 1383 | 1383 |
| 1384 void BookmarkBarGtk::OnEventBoxDestroy(GtkWidget* widget) { | 1384 void BookmarkBarGtk::OnEventBoxDestroy(GtkWidget* widget) { |
| 1385 if (model_) | 1385 if (model_) |
| 1386 model_->RemoveObserver(this); | 1386 model_->RemoveObserver(this); |
| 1387 | 1387 |
| 1388 if (sync_service_) | 1388 if (sync_service_) |
| (...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1462 | 1462 |
| 1463 // Find the GtkWidget* for the actual target button. | 1463 // Find the GtkWidget* for the actual target button. |
| 1464 int shift = dir == GTK_MENU_DIR_PARENT ? -1 : 1; | 1464 int shift = dir == GTK_MENU_DIR_PARENT ? -1 : 1; |
| 1465 button_idx = (button_idx + shift + folder_list.size()) % folder_list.size(); | 1465 button_idx = (button_idx + shift + folder_list.size()) % folder_list.size(); |
| 1466 PopupForButton(folder_list[button_idx]); | 1466 PopupForButton(folder_list[button_idx]); |
| 1467 } | 1467 } |
| 1468 | 1468 |
| 1469 void BookmarkBarGtk::CloseMenu() { | 1469 void BookmarkBarGtk::CloseMenu() { |
| 1470 current_context_menu_->Cancel(); | 1470 current_context_menu_->Cancel(); |
| 1471 } | 1471 } |
| OLD | NEW |