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

Unified Diff: chrome/browser/gtk/browser_window_gtk.cc

Issue 140078: Move the titlebar background drawing from the titlebar to the (Closed)
Patch Set: rebase Created 11 years, 6 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/gtk/browser_titlebar.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/gtk/browser_window_gtk.cc
diff --git a/chrome/browser/gtk/browser_window_gtk.cc b/chrome/browser/gtk/browser_window_gtk.cc
index 4342ff6f19c879225a91c14591f31bc663cc7e77..7bf99323cfefc81d69bb0e4b36fa77ade4100658 100644
--- a/chrome/browser/gtk/browser_window_gtk.cc
+++ b/chrome/browser/gtk/browser_window_gtk.cc
@@ -360,6 +360,8 @@ gboolean BrowserWindowGtk::OnCustomFrameExpose(GtkWidget* widget,
// TODO(tc): This will have to be dynamic once themes are supported. Maybe
// detect the theme install and delete the pointer?
static NineBox* custom_frame_border = NULL;
+ static NineBox* default_background = NULL;
+ static NineBox* default_background_otr = NULL;
if (window->use_custom_frame_.GetValue()) {
ThemeProvider* theme_provider =
@@ -376,9 +378,22 @@ gboolean BrowserWindowGtk::OnCustomFrameExpose(GtkWidget* widget,
IDR_WINDOW_BOTTOM_LEFT_CORNER,
IDR_WINDOW_BOTTOM_CENTER,
IDR_WINDOW_BOTTOM_RIGHT_CORNER);
+ default_background = new NineBox(theme_provider,
+ 0, IDR_THEME_FRAME, 0, 0, 0, 0, 0, 0, 0);
+ default_background_otr = new NineBox(theme_provider,
+ 0, IDR_THEME_FRAME_INCOGNITO, 0, 0, 0, 0, 0, 0, 0);
}
+ // Draw the default background.
// TODO(tc): Handle maximized windows.
+ cairo_t* cr = gdk_cairo_create(GDK_DRAWABLE(widget->window));
+ cairo_rectangle(cr, event->area.x, event->area.y, event->area.width,
+ event->area.height);
+ cairo_clip(cr);
+ NineBox* image = window->browser()->profile()->IsOffTheRecord()
+ ? default_background_otr : default_background;
+ image->RenderTopCenterStrip(cr, event->area.x, 0, event->area.width);
+ cairo_destroy(cr);
// TODO(tc): Draw the theme overlay. The windows code is below.
// if (theme_provider->HasCustomImage(IDR_THEME_FRAME_OVERLAY)) {
« no previous file with comments | « chrome/browser/gtk/browser_titlebar.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698