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/location_bar_view_gtk.h" | 5 #include "chrome/browser/ui/gtk/location_bar_view_gtk.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <string> | 8 #include <string> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 1371 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1382 } | 1382 } |
1383 | 1383 |
1384 gboolean LocationBarViewGtk::ContentSettingImageViewGtk::OnExpose( | 1384 gboolean LocationBarViewGtk::ContentSettingImageViewGtk::OnExpose( |
1385 GtkWidget* sender, GdkEventExpose* event) { | 1385 GtkWidget* sender, GdkEventExpose* event) { |
1386 TRACE_EVENT0("ui::gtk", | 1386 TRACE_EVENT0("ui::gtk", |
1387 "LocationBarViewGtk::ContentSettingImageViewGtk::OnExpose"); | 1387 "LocationBarViewGtk::ContentSettingImageViewGtk::OnExpose"); |
1388 | 1388 |
1389 if (!(animation_.IsShowing() || animation_.IsClosing())) | 1389 if (!(animation_.IsShowing() || animation_.IsClosing())) |
1390 return FALSE; | 1390 return FALSE; |
1391 | 1391 |
1392 const int height = sender->allocation.height; | 1392 GtkAllocation allocation; |
| 1393 gtk_widget_get_allocation(sender, &allocation); |
| 1394 const int height = allocation.height; |
1393 | 1395 |
1394 cairo_t* cr = gdk_cairo_create(GDK_DRAWABLE(sender->window)); | 1396 cairo_t* cr = gdk_cairo_create(GDK_DRAWABLE(sender->window)); |
1395 gdk_cairo_rectangle(cr, &event->area); | 1397 gdk_cairo_rectangle(cr, &event->area); |
1396 cairo_clip(cr); | 1398 cairo_clip(cr); |
1397 | 1399 |
1398 cairo_pattern_t* pattern = cairo_pattern_create_linear(0, 0, 0, height); | 1400 cairo_pattern_t* pattern = cairo_pattern_create_linear(0, 0, 0, height); |
1399 | 1401 |
1400 cairo_pattern_add_color_stop_rgb(pattern, 0.0, | 1402 cairo_pattern_add_color_stop_rgb(pattern, 0.0, |
1401 kContentSettingTopColor[0], | 1403 kContentSettingTopColor[0], |
1402 kContentSettingTopColor[1], | 1404 kContentSettingTopColor[1], |
(...skipping 238 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1641 | 1643 |
1642 std::string badge_text = page_action_->GetBadgeText(tab_id); | 1644 std::string badge_text = page_action_->GetBadgeText(tab_id); |
1643 if (badge_text.empty()) | 1645 if (badge_text.empty()) |
1644 return FALSE; | 1646 return FALSE; |
1645 | 1647 |
1646 gfx::CanvasSkiaPaint canvas(event, false); | 1648 gfx::CanvasSkiaPaint canvas(event, false); |
1647 gfx::Rect bounding_rect(widget->allocation); | 1649 gfx::Rect bounding_rect(widget->allocation); |
1648 page_action_->PaintBadge(&canvas, bounding_rect, tab_id); | 1650 page_action_->PaintBadge(&canvas, bounding_rect, tab_id); |
1649 return FALSE; | 1651 return FALSE; |
1650 } | 1652 } |
OLD | NEW |