| 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/browser_actions_toolbar_gtk.h" | 5 #include "chrome/browser/ui/gtk/browser_actions_toolbar_gtk.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 #include "base/i18n/rtl.h" | 10 #include "base/i18n/rtl.h" |
| (...skipping 286 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 297 GdkEventExpose* event, | 297 GdkEventExpose* event, |
| 298 BrowserActionButton* button) { | 298 BrowserActionButton* button) { |
| 299 int tab_id = button->toolbar_->GetCurrentTabId(); | 299 int tab_id = button->toolbar_->GetCurrentTabId(); |
| 300 if (tab_id < 0) | 300 if (tab_id < 0) |
| 301 return FALSE; | 301 return FALSE; |
| 302 | 302 |
| 303 ExtensionAction* action = button->extension_->browser_action(); | 303 ExtensionAction* action = button->extension_->browser_action(); |
| 304 if (action->GetBadgeText(tab_id).empty()) | 304 if (action->GetBadgeText(tab_id).empty()) |
| 305 return FALSE; | 305 return FALSE; |
| 306 | 306 |
| 307 gfx::CanvasSkiaPaint canvas(event, false); | 307 gfx::CanvasSkiaPaint canvas_paint(event, false); |
| 308 gfx::Rect bounding_rect(widget->allocation); | 308 gfx::Rect bounding_rect(widget->allocation); |
| 309 action->PaintBadge(&canvas, bounding_rect, tab_id); | 309 action->PaintBadge(canvas_paint.AsCanvas(), bounding_rect, tab_id); |
| 310 return FALSE; | 310 return FALSE; |
| 311 } | 311 } |
| 312 | 312 |
| 313 static void OnDragBegin(GtkWidget* widget, | 313 static void OnDragBegin(GtkWidget* widget, |
| 314 GdkDragContext* drag_context, | 314 GdkDragContext* drag_context, |
| 315 BrowserActionButton* button) { | 315 BrowserActionButton* button) { |
| 316 // Simply pass along the notification to the toolbar. The point of this | 316 // Simply pass along the notification to the toolbar. The point of this |
| 317 // function is to tell the toolbar which BrowserActionButton initiated the | 317 // function is to tell the toolbar which BrowserActionButton initiated the |
| 318 // drag. | 318 // drag. |
| 319 button->toolbar_->DragStarted(button, drag_context); | 319 button->toolbar_->DragStarted(button, drag_context); |
| (...skipping 633 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 953 | 953 |
| 954 menu->PopupAsContext(gfx::Point(event->x_root, event->y_root), | 954 menu->PopupAsContext(gfx::Point(event->x_root, event->y_root), |
| 955 event->time); | 955 event->time); |
| 956 return TRUE; | 956 return TRUE; |
| 957 } | 957 } |
| 958 | 958 |
| 959 void BrowserActionsToolbarGtk::OnButtonShowOrHide(GtkWidget* sender) { | 959 void BrowserActionsToolbarGtk::OnButtonShowOrHide(GtkWidget* sender) { |
| 960 if (!resize_animation_.is_animating()) | 960 if (!resize_animation_.is_animating()) |
| 961 UpdateChevronVisibility(); | 961 UpdateChevronVisibility(); |
| 962 } | 962 } |
| OLD | NEW |