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

Side by Side Diff: chrome/browser/gtk/find_bar_gtk.cc

Issue 200071: Revert "Upload GdkPixbufs into cairo surfaces so they (hopefully) live on the X (Closed)
Patch Set: Created 11 years, 3 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
« no previous file with comments | « chrome/browser/gtk/custom_button.cc ('k') | chrome/browser/gtk/go_button_gtk.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) 2009 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2009 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/gtk/find_bar_gtk.h" 5 #include "chrome/browser/gtk/find_bar_gtk.h"
6 6
7 #include <gdk/gdkkeysyms.h> 7 #include <gdk/gdkkeysyms.h>
8 8
9 #include "app/l10n_util.h" 9 #include "app/l10n_util.h"
10 #include "base/gfx/gtk_util.h" 10 #include "base/gfx/gtk_util.h"
11 #include "base/string_util.h" 11 #include "base/string_util.h"
12 #include "chrome/browser/browser.h" 12 #include "chrome/browser/browser.h"
13 #include "chrome/browser/profile.h" 13 #include "chrome/browser/profile.h"
14 #include "chrome/browser/find_bar_controller.h" 14 #include "chrome/browser/find_bar_controller.h"
15 #include "chrome/browser/gtk/browser_window_gtk.h" 15 #include "chrome/browser/gtk/browser_window_gtk.h"
16 #include "chrome/browser/gtk/cairo_cached_surface.h"
17 #include "chrome/browser/gtk/custom_button.h" 16 #include "chrome/browser/gtk/custom_button.h"
18 #include "chrome/browser/gtk/gtk_theme_provider.h" 17 #include "chrome/browser/gtk/gtk_theme_provider.h"
19 #include "chrome/browser/gtk/nine_box.h" 18 #include "chrome/browser/gtk/nine_box.h"
20 #include "chrome/browser/gtk/slide_animator_gtk.h" 19 #include "chrome/browser/gtk/slide_animator_gtk.h"
21 #include "chrome/browser/gtk/tab_contents_container_gtk.h" 20 #include "chrome/browser/gtk/tab_contents_container_gtk.h"
22 #include "chrome/browser/gtk/tabs/tab_strip_gtk.h" 21 #include "chrome/browser/gtk/tabs/tab_strip_gtk.h"
23 #include "chrome/browser/gtk/view_id_util.h" 22 #include "chrome/browser/gtk/view_id_util.h"
24 #include "chrome/browser/tab_contents/tab_contents.h" 23 #include "chrome/browser/tab_contents/tab_contents.h"
25 #include "chrome/common/gtk_util.h" 24 #include "chrome/common/gtk_util.h"
26 #include "chrome/common/notification_service.h" 25 #include "chrome/common/notification_service.h"
(...skipping 729 matching lines...) Expand 10 before | Expand all | Expand 10 after
756 bar->container_width_ = widget->allocation.width; 755 bar->container_width_ = widget->allocation.width;
757 bar->container_height_ = widget->allocation.height; 756 bar->container_height_ = widget->allocation.height;
758 } 757 }
759 758
760 // Draw the background theme image. 759 // Draw the background theme image.
761 cairo_t* cr = gdk_cairo_create(GDK_DRAWABLE(widget->window)); 760 cairo_t* cr = gdk_cairo_create(GDK_DRAWABLE(widget->window));
762 cairo_rectangle(cr, e->area.x, e->area.y, e->area.width, e->area.height); 761 cairo_rectangle(cr, e->area.x, e->area.y, e->area.width, e->area.height);
763 cairo_clip(cr); 762 cairo_clip(cr);
764 gfx::Point tabstrip_origin = 763 gfx::Point tabstrip_origin =
765 bar->window_->tabstrip()->GetTabStripOriginForWidget(widget); 764 bar->window_->tabstrip()->GetTabStripOriginForWidget(widget);
766 CairoCachedSurface* background = bar->theme_provider_->GetSurfaceNamed( 765 GdkPixbuf* background = bar->browser_->profile()->GetThemeProvider()->
767 IDR_THEME_TOOLBAR, widget); 766 GetPixbufNamed(IDR_THEME_TOOLBAR);
768 background->SetSource(cr, tabstrip_origin.x(), tabstrip_origin.y()); 767 gdk_cairo_set_source_pixbuf(cr, background,
768 tabstrip_origin.x(), tabstrip_origin.y());
769 cairo_pattern_set_extend(cairo_get_source(cr), CAIRO_EXTEND_REPEAT); 769 cairo_pattern_set_extend(cairo_get_source(cr), CAIRO_EXTEND_REPEAT);
770 cairo_rectangle(cr, tabstrip_origin.x(), tabstrip_origin.y(), 770 cairo_rectangle(cr, tabstrip_origin.x(), tabstrip_origin.y(),
771 e->area.x + e->area.width - tabstrip_origin.x(), 771 e->area.x + e->area.width - tabstrip_origin.x(),
772 background->Height()); 772 gdk_pixbuf_get_height(background));
773 cairo_fill(cr); 773 cairo_fill(cr);
774 cairo_destroy(cr); 774 cairo_destroy(cr);
775 775
776 // Draw the border. 776 // Draw the border.
777 GetDialogBorder()->RenderToWidget(widget); 777 GetDialogBorder()->RenderToWidget(widget);
778 } 778 }
779 779
780 // Propagate to the container's child. 780 // Propagate to the container's child.
781 GtkWidget* child = gtk_bin_get_child(GTK_BIN(widget)); 781 GtkWidget* child = gtk_bin_get_child(GTK_BIN(widget));
782 if (child) 782 if (child)
(...skipping 11 matching lines...) Expand all
794 } 794 }
795 795
796 // static 796 // static
797 gboolean FindBarGtk::OnButtonPress(GtkWidget* text_entry, GdkEventButton* e, 797 gboolean FindBarGtk::OnButtonPress(GtkWidget* text_entry, GdkEventButton* e,
798 FindBarGtk* find_bar) { 798 FindBarGtk* find_bar) {
799 find_bar->StoreOutsideFocus(); 799 find_bar->StoreOutsideFocus();
800 800
801 // Continue propagating the event. 801 // Continue propagating the event.
802 return FALSE; 802 return FALSE;
803 } 803 }
OLDNEW
« no previous file with comments | « chrome/browser/gtk/custom_button.cc ('k') | chrome/browser/gtk/go_button_gtk.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698