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

Side by Side Diff: chrome/browser/ui/gtk/browser_actions_toolbar_gtk.cc

Issue 9030029: GTK: A bunch more removal of deprecated raw GtkWidget access, focusing on GtkWidget->window (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: tony nits Created 8 years, 11 months 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 unified diff | Download patch
OLDNEW
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/bind.h" 10 #include "base/bind.h"
(...skipping 290 matching lines...) Expand 10 before | Expand all | Expand 10 after
301 BrowserActionButton* button) { 301 BrowserActionButton* button) {
302 int tab_id = button->toolbar_->GetCurrentTabId(); 302 int tab_id = button->toolbar_->GetCurrentTabId();
303 if (tab_id < 0) 303 if (tab_id < 0)
304 return FALSE; 304 return FALSE;
305 305
306 ExtensionAction* action = button->extension_->browser_action(); 306 ExtensionAction* action = button->extension_->browser_action();
307 if (action->GetBadgeText(tab_id).empty()) 307 if (action->GetBadgeText(tab_id).empty())
308 return FALSE; 308 return FALSE;
309 309
310 gfx::CanvasSkiaPaint canvas(event, false); 310 gfx::CanvasSkiaPaint canvas(event, false);
311 gfx::Rect bounding_rect(widget->allocation); 311 GtkAllocation allocation;
312 action->PaintBadge(&canvas, bounding_rect, tab_id); 312 gtk_widget_get_allocation(widget, &allocation);
313 action->PaintBadge(&canvas, gfx::Rect(allocation), tab_id);
313 return FALSE; 314 return FALSE;
314 } 315 }
315 316
316 static void OnDragBegin(GtkWidget* widget, 317 static void OnDragBegin(GtkWidget* widget,
317 GdkDragContext* drag_context, 318 GdkDragContext* drag_context,
318 BrowserActionButton* button) { 319 BrowserActionButton* button) {
319 // Simply pass along the notification to the toolbar. The point of this 320 // Simply pass along the notification to the toolbar. The point of this
320 // function is to tell the toolbar which BrowserActionButton initiated the 321 // function is to tell the toolbar which BrowserActionButton initiated the
321 // drag. 322 // drag.
322 button->toolbar_->DragStarted(button, drag_context); 323 button->toolbar_->DragStarted(button, drag_context);
(...skipping 649 matching lines...) Expand 10 before | Expand all | Expand 10 after
972 973
973 menu->PopupAsContext(gfx::Point(event->x_root, event->y_root), 974 menu->PopupAsContext(gfx::Point(event->x_root, event->y_root),
974 event->time); 975 event->time);
975 return TRUE; 976 return TRUE;
976 } 977 }
977 978
978 void BrowserActionsToolbarGtk::OnButtonShowOrHide(GtkWidget* sender) { 979 void BrowserActionsToolbarGtk::OnButtonShowOrHide(GtkWidget* sender) {
979 if (!resize_animation_.is_animating()) 980 if (!resize_animation_.is_animating())
980 UpdateChevronVisibility(); 981 UpdateChevronVisibility();
981 } 982 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/gtk/avatar_menu_item_gtk.cc ('k') | chrome/browser/ui/gtk/download/download_item_gtk.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698