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

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

Issue 196044: GTK Theme: Don't render IDR_THEME_TOOLBAR on GtkWidgets. (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/bookmark_bar_gtk.cc ('k') | chrome/browser/gtk/find_bar_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/browser_toolbar_gtk.h" 5 #include "chrome/browser/gtk/browser_toolbar_gtk.h"
6 6
7 #include <gdk/gdkkeysyms.h> 7 #include <gdk/gdkkeysyms.h>
8 #include <X11/XF86keysym.h> 8 #include <X11/XF86keysym.h>
9 9
10 #include "app/gtk_dnd_util.h" 10 #include "app/gtk_dnd_util.h"
(...skipping 515 matching lines...) Expand 10 before | Expand all | Expand 10 after
526 old_menu->Cancel(); 526 old_menu->Cancel();
527 gtk_chrome_button_set_paint_state(GTK_CHROME_BUTTON(relevant_button), 527 gtk_chrome_button_set_paint_state(GTK_CHROME_BUTTON(relevant_button),
528 GTK_STATE_ACTIVE); 528 GTK_STATE_ACTIVE);
529 new_menu->Popup(relevant_button, 0, timestamp); 529 new_menu->Popup(relevant_button, 0, timestamp);
530 } 530 }
531 531
532 // static 532 // static
533 gboolean BrowserToolbarGtk::OnAlignmentExpose(GtkWidget* widget, 533 gboolean BrowserToolbarGtk::OnAlignmentExpose(GtkWidget* widget,
534 GdkEventExpose* e, 534 GdkEventExpose* e,
535 BrowserToolbarGtk* toolbar) { 535 BrowserToolbarGtk* toolbar) {
536 // We don't need to render the toolbar image in GTK mode.
537 if (toolbar->theme_provider_->UseGtkTheme())
538 return FALSE;
539
536 cairo_t* cr = gdk_cairo_create(GDK_DRAWABLE(widget->window)); 540 cairo_t* cr = gdk_cairo_create(GDK_DRAWABLE(widget->window));
537 cairo_rectangle(cr, e->area.x, e->area.y, e->area.width, e->area.height); 541 cairo_rectangle(cr, e->area.x, e->area.y, e->area.width, e->area.height);
538 cairo_clip(cr); 542 cairo_clip(cr);
539 // The toolbar is supposed to blend in with the active tab, so we have to pass 543 // The toolbar is supposed to blend in with the active tab, so we have to pass
540 // coordinates for the IDR_THEME_TOOLBAR bitmap relative to the top of the 544 // coordinates for the IDR_THEME_TOOLBAR bitmap relative to the top of the
541 // tab strip. 545 // tab strip.
542 gfx::Point tabstrip_origin = 546 gfx::Point tabstrip_origin =
543 toolbar->window_->tabstrip()->GetTabStripOriginForWidget(widget); 547 toolbar->window_->tabstrip()->GetTabStripOriginForWidget(widget);
544 GtkThemeProvider* theme_provider = toolbar->theme_provider_; 548 GtkThemeProvider* theme_provider = toolbar->theme_provider_;
545 GdkPixbuf* toolbar_background = theme_provider->GetPixbufNamed( 549 GdkPixbuf* toolbar_background = theme_provider->GetPixbufNamed(
(...skipping 166 matching lines...) Expand 10 before | Expand all | Expand 10 after
712 g_signal_stop_emission_by_name(menu, "move-current"); 716 g_signal_stop_emission_by_name(menu, "move-current");
713 default: 717 default:
714 break; 718 break;
715 } 719 }
716 } 720 }
717 721
718 bool BrowserToolbarGtk::ShouldOnlyShowLocation() const { 722 bool BrowserToolbarGtk::ShouldOnlyShowLocation() const {
719 // If we're a popup window, only show the location bar (omnibox). 723 // If we're a popup window, only show the location bar (omnibox).
720 return browser_->type() != Browser::TYPE_NORMAL; 724 return browser_->type() != Browser::TYPE_NORMAL;
721 } 725 }
OLDNEW
« no previous file with comments | « chrome/browser/gtk/bookmark_bar_gtk.cc ('k') | chrome/browser/gtk/find_bar_gtk.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698