OLD | NEW |
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_window_gtk.h" | 5 #include "chrome/browser/gtk/browser_window_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 <string> | 10 #include <string> |
(...skipping 638 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
649 int image_name; | 649 int image_name; |
650 if (window->IsActive()) { | 650 if (window->IsActive()) { |
651 image_name = window->browser()->profile()->IsOffTheRecord() ? | 651 image_name = window->browser()->profile()->IsOffTheRecord() ? |
652 IDR_THEME_FRAME_INCOGNITO : IDR_THEME_FRAME; | 652 IDR_THEME_FRAME_INCOGNITO : IDR_THEME_FRAME; |
653 } else { | 653 } else { |
654 image_name = window->browser()->profile()->IsOffTheRecord() ? | 654 image_name = window->browser()->profile()->IsOffTheRecord() ? |
655 IDR_THEME_FRAME_INCOGNITO_INACTIVE : IDR_THEME_FRAME_INACTIVE; | 655 IDR_THEME_FRAME_INCOGNITO_INACTIVE : IDR_THEME_FRAME_INACTIVE; |
656 } | 656 } |
657 CairoCachedSurface* surface = theme_provider->GetSurfaceNamed( | 657 CairoCachedSurface* surface = theme_provider->GetSurfaceNamed( |
658 image_name, widget); | 658 image_name, widget); |
659 surface->SetSource(cr, | 659 if (event->area.y < surface->Height()) { |
660 0, | 660 surface->SetSource(cr, |
661 window->UseCustomFrame() ? 0 : -kCustomFrameBackgroundVerticalOffset); | 661 0, |
662 cairo_pattern_set_extend(cairo_get_source(cr), CAIRO_EXTEND_REPEAT); | 662 window->UseCustomFrame() ? 0 : -kCustomFrameBackgroundVerticalOffset); |
663 cairo_rectangle(cr, event->area.x, event->area.y, | 663 // The frame background isn't tiled vertically. |
664 event->area.width, event->area.height); | 664 cairo_pattern_set_extend(cairo_get_source(cr), CAIRO_EXTEND_REPEAT); |
665 cairo_fill(cr); | 665 cairo_rectangle(cr, event->area.x, event->area.y, |
| 666 event->area.width, surface->Height() - event->area.y); |
| 667 cairo_fill(cr); |
| 668 } |
666 | 669 |
667 if (theme_provider->HasCustomImage(IDR_THEME_FRAME_OVERLAY)) { | 670 if (theme_provider->HasCustomImage(IDR_THEME_FRAME_OVERLAY)) { |
668 CairoCachedSurface* theme_overlay = theme_provider->GetSurfaceNamed( | 671 CairoCachedSurface* theme_overlay = theme_provider->GetSurfaceNamed( |
669 window->IsActive() ? IDR_THEME_FRAME_OVERLAY | 672 window->IsActive() ? IDR_THEME_FRAME_OVERLAY |
670 : IDR_THEME_FRAME_OVERLAY_INACTIVE, widget); | 673 : IDR_THEME_FRAME_OVERLAY_INACTIVE, widget); |
671 theme_overlay->SetSource(cr, 0, 0); | 674 theme_overlay->SetSource(cr, 0, 0); |
672 cairo_paint(cr); | 675 cairo_paint(cr); |
673 } | 676 } |
674 | 677 |
675 DrawContentShadow(cr, window); | 678 DrawContentShadow(cr, window); |
(...skipping 1523 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2199 // special-case the ones where the custom frame should be used. These names | 2202 // special-case the ones where the custom frame should be used. These names |
2200 // are taken from the WMs' source code. | 2203 // are taken from the WMs' source code. |
2201 return (wm_name == "Blackbox" || | 2204 return (wm_name == "Blackbox" || |
2202 wm_name == "compiz" || | 2205 wm_name == "compiz" || |
2203 wm_name == "e16" || // Enlightenment DR16 | 2206 wm_name == "e16" || // Enlightenment DR16 |
2204 wm_name == "KWin" || | 2207 wm_name == "KWin" || |
2205 wm_name == "Metacity" || | 2208 wm_name == "Metacity" || |
2206 wm_name == "Openbox" || | 2209 wm_name == "Openbox" || |
2207 wm_name == "Xfwm4"); | 2210 wm_name == "Xfwm4"); |
2208 } | 2211 } |
OLD | NEW |