| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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/tabs/dragged_tab_gtk.h" | 5 #include "chrome/browser/gtk/tabs/dragged_tab_gtk.h" |
| 6 | 6 |
| 7 #include <gdk/gdk.h> | 7 #include <gdk/gdk.h> |
| 8 | 8 |
| 9 #include <algorithm> | 9 #include <algorithm> |
| 10 | 10 |
| (...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 48 const gfx::Point& mouse_tab_offset, | 48 const gfx::Point& mouse_tab_offset, |
| 49 const gfx::Size& contents_size, | 49 const gfx::Size& contents_size, |
| 50 bool mini) | 50 bool mini) |
| 51 : data_source_(datasource), | 51 : data_source_(datasource), |
| 52 renderer_(new TabRendererGtk(datasource->profile()->GetThemeProvider())), | 52 renderer_(new TabRendererGtk(datasource->profile()->GetThemeProvider())), |
| 53 attached_(false), | 53 attached_(false), |
| 54 mouse_tab_offset_(mouse_tab_offset), | 54 mouse_tab_offset_(mouse_tab_offset), |
| 55 attached_tab_size_(TabRendererGtk::GetMinimumSelectedSize()), | 55 attached_tab_size_(TabRendererGtk::GetMinimumSelectedSize()), |
| 56 contents_size_(contents_size), | 56 contents_size_(contents_size), |
| 57 close_animation_(this) { | 57 close_animation_(this) { |
| 58 renderer_->UpdateData(datasource, false, false); | 58 renderer_->UpdateData(datasource, false); |
| 59 renderer_->set_mini(mini); | 59 renderer_->set_mini(mini); |
| 60 | 60 |
| 61 container_ = gtk_window_new(GTK_WINDOW_POPUP); | 61 container_ = gtk_window_new(GTK_WINDOW_POPUP); |
| 62 SetContainerColorMap(); | 62 SetContainerColorMap(); |
| 63 gtk_widget_set_app_paintable(container_, TRUE); | 63 gtk_widget_set_app_paintable(container_, TRUE); |
| 64 g_signal_connect(container_, "expose-event", | 64 g_signal_connect(container_, "expose-event", |
| 65 G_CALLBACK(OnExposeEvent), this); | 65 G_CALLBACK(OnExposeEvent), this); |
| 66 gtk_widget_add_events(container_, GDK_STRUCTURE_MASK); | 66 gtk_widget_add_events(container_, GDK_STRUCTURE_MASK); |
| 67 | 67 |
| 68 // We contain the tab renderer in a GtkFixed in order to maintain the | 68 // We contain the tab renderer in a GtkFixed in order to maintain the |
| (...skipping 257 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 326 cairo_set_source_surface(cr, surface, 0, 0); | 326 cairo_set_source_surface(cr, surface, 0, 0); |
| 327 cairo_paint(cr); | 327 cairo_paint(cr); |
| 328 | 328 |
| 329 cairo_destroy(cr); | 329 cairo_destroy(cr); |
| 330 | 330 |
| 331 cairo_surface_destroy(surface); | 331 cairo_surface_destroy(surface); |
| 332 | 332 |
| 333 // We've already drawn the tab, so don't propagate the expose-event signal. | 333 // We've already drawn the tab, so don't propagate the expose-event signal. |
| 334 return TRUE; | 334 return TRUE; |
| 335 } | 335 } |
| OLD | NEW |