| OLD | NEW |
| 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/gtk_util.h" | 5 #include "chrome/browser/ui/gtk/gtk_util.h" |
| 6 | 6 |
| 7 #include <cairo/cairo.h> | 7 #include <cairo/cairo.h> |
| 8 | 8 |
| 9 #include <cstdarg> | 9 #include <cstdarg> |
| 10 | 10 |
| (...skipping 783 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 794 GtkThemeService* theme_service) { | 794 GtkThemeService* theme_service) { |
| 795 // Fill the entire region with the toolbar color. | 795 // Fill the entire region with the toolbar color. |
| 796 GdkColor color = theme_service->GetGdkColor( | 796 GdkColor color = theme_service->GetGdkColor( |
| 797 ThemeService::COLOR_TOOLBAR); | 797 ThemeService::COLOR_TOOLBAR); |
| 798 gdk_cairo_set_source_color(cr, &color); | 798 gdk_cairo_set_source_color(cr, &color); |
| 799 cairo_fill(cr); | 799 cairo_fill(cr); |
| 800 | 800 |
| 801 // The toolbar is supposed to blend in with the active tab, so we have to pass | 801 // The toolbar is supposed to blend in with the active tab, so we have to pass |
| 802 // coordinates for the IDR_THEME_TOOLBAR bitmap relative to the top of the | 802 // coordinates for the IDR_THEME_TOOLBAR bitmap relative to the top of the |
| 803 // tab strip. | 803 // tab strip. |
| 804 gfx::CairoCachedSurface* background = theme_service->GetSurfaceNamed( | 804 const gfx::Image* background = |
| 805 IDR_THEME_TOOLBAR, widget); | 805 theme_service->GetImageNamed(IDR_THEME_TOOLBAR); |
| 806 background->SetSource(cr, widget, tabstrip_origin.x(), tabstrip_origin.y()); | 806 background->ToCairo()->SetSource(cr, widget, |
| 807 tabstrip_origin.x(), tabstrip_origin.y()); |
| 807 // We tile the toolbar background in both directions. | 808 // We tile the toolbar background in both directions. |
| 808 cairo_pattern_set_extend(cairo_get_source(cr), CAIRO_EXTEND_REPEAT); | 809 cairo_pattern_set_extend(cairo_get_source(cr), CAIRO_EXTEND_REPEAT); |
| 809 cairo_rectangle(cr, | 810 cairo_rectangle(cr, |
| 810 tabstrip_origin.x(), | 811 tabstrip_origin.x(), |
| 811 tabstrip_origin.y(), | 812 tabstrip_origin.y(), |
| 812 event->area.x + event->area.width - tabstrip_origin.x(), | 813 event->area.x + event->area.width - tabstrip_origin.x(), |
| 813 event->area.y + event->area.height - tabstrip_origin.y()); | 814 event->area.y + event->area.height - tabstrip_origin.y()); |
| 814 cairo_fill(cr); | 815 cairo_fill(cr); |
| 815 } | 816 } |
| 816 | 817 |
| (...skipping 388 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1205 | 1206 |
| 1206 void DoCopy(BrowserWindow* window) { | 1207 void DoCopy(BrowserWindow* window) { |
| 1207 DoCutCopyPaste(window, &RenderViewHost::Copy, "copy-clipboard"); | 1208 DoCutCopyPaste(window, &RenderViewHost::Copy, "copy-clipboard"); |
| 1208 } | 1209 } |
| 1209 | 1210 |
| 1210 void DoPaste(BrowserWindow* window) { | 1211 void DoPaste(BrowserWindow* window) { |
| 1211 DoCutCopyPaste(window, &RenderViewHost::Paste, "paste-clipboard"); | 1212 DoCutCopyPaste(window, &RenderViewHost::Paste, "paste-clipboard"); |
| 1212 } | 1213 } |
| 1213 | 1214 |
| 1214 } // namespace gtk_util | 1215 } // namespace gtk_util |
| OLD | NEW |