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

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

Issue 8921022: GTK: Even more cleanup to access allocation through the accessor. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Created 9 years 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
« no previous file with comments | « no previous file | chrome/browser/ui/gtk/menu_bar_helper.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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/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
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
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 }
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/ui/gtk/menu_bar_helper.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698