| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/tabs/dragged_view_gtk.h" | 5 #include "chrome/browser/ui/gtk/tabs/dragged_view_gtk.h" |
| 6 | 6 |
| 7 #include <gdk/gdk.h> | 7 #include <gdk/gdk.h> |
| 8 | 8 |
| 9 #include <algorithm> | 9 #include <algorithm> |
| 10 | 10 |
| 11 #include "base/debug/trace_event.h" | 11 #include "base/debug/trace_event.h" |
| 12 #include "base/i18n/rtl.h" | 12 #include "base/i18n/rtl.h" |
| 13 #include "base/stl_util.h" | 13 #include "base/stl_util.h" |
| 14 #include "chrome/browser/extensions/extension_tab_helper.h" | 14 #include "chrome/browser/extensions/extension_tab_helper.h" |
| 15 #include "chrome/browser/profiles/profile.h" | 15 #include "chrome/browser/profiles/profile.h" |
| 16 #include "chrome/browser/tabs/tab_strip_model.h" | 16 #include "chrome/browser/tabs/tab_strip_model.h" |
| 17 #include "chrome/browser/themes/theme_service.h" | 17 #include "chrome/browser/themes/theme_service.h" |
| 18 #include "chrome/browser/themes/theme_service_factory.h" | 18 #include "chrome/browser/themes/theme_service_factory.h" |
| 19 #include "chrome/browser/ui/gtk/gtk_theme_service.h" | |
| 20 #include "chrome/browser/ui/gtk/gtk_util.h" | 19 #include "chrome/browser/ui/gtk/gtk_util.h" |
| 21 #include "chrome/browser/ui/gtk/tabs/drag_data.h" | 20 #include "chrome/browser/ui/gtk/tabs/drag_data.h" |
| 22 #include "chrome/browser/ui/gtk/tabs/tab_renderer_gtk.h" | 21 #include "chrome/browser/ui/gtk/tabs/tab_renderer_gtk.h" |
| 22 #include "chrome/browser/ui/gtk/theme_service_gtk.h" |
| 23 #include "chrome/browser/ui/tab_contents/tab_contents_wrapper.h" | 23 #include "chrome/browser/ui/tab_contents/tab_contents_wrapper.h" |
| 24 #include "content/browser/renderer_host/backing_store_gtk.h" | 24 #include "content/browser/renderer_host/backing_store_gtk.h" |
| 25 #include "content/browser/renderer_host/render_view_host.h" | 25 #include "content/browser/renderer_host/render_view_host.h" |
| 26 #include "content/public/browser/web_contents.h" | 26 #include "content/public/browser/web_contents.h" |
| 27 #include "third_party/skia/include/core/SkShader.h" | 27 #include "third_party/skia/include/core/SkShader.h" |
| 28 #include "ui/base/gtk/gtk_screen_utils.h" | 28 #include "ui/base/gtk/gtk_screen_utils.h" |
| 29 #include "ui/base/x/x11_util.h" | 29 #include "ui/base/x/x11_util.h" |
| 30 #include "ui/gfx/gtk_util.h" | 30 #include "ui/gfx/gtk_util.h" |
| 31 | 31 |
| 32 using content::WebContents; | 32 using content::WebContents; |
| (...skipping 27 matching lines...) Expand all Loading... |
| 60 mini_width_(-1), | 60 mini_width_(-1), |
| 61 normal_width_(-1), | 61 normal_width_(-1), |
| 62 attached_(false), | 62 attached_(false), |
| 63 parent_window_width_(-1), | 63 parent_window_width_(-1), |
| 64 mouse_tab_offset_(mouse_tab_offset), | 64 mouse_tab_offset_(mouse_tab_offset), |
| 65 attached_tab_size_(TabRendererGtk::GetMinimumSelectedSize()), | 65 attached_tab_size_(TabRendererGtk::GetMinimumSelectedSize()), |
| 66 contents_size_(contents_size), | 66 contents_size_(contents_size), |
| 67 close_animation_(this) { | 67 close_animation_(this) { |
| 68 std::vector<WebContents*> data_sources(drag_data_->GetDraggedTabsContents()); | 68 std::vector<WebContents*> data_sources(drag_data_->GetDraggedTabsContents()); |
| 69 for (size_t i = 0; i < data_sources.size(); i++) { | 69 for (size_t i = 0; i < data_sources.size(); i++) { |
| 70 renderers_.push_back(new TabRendererGtk(GtkThemeService::GetFrom( | 70 renderers_.push_back(new TabRendererGtk(ThemeServiceGtk::GetFrom( |
| 71 Profile::FromBrowserContext(data_sources[i]->GetBrowserContext())))); | 71 Profile::FromBrowserContext(data_sources[i]->GetBrowserContext())))); |
| 72 } | 72 } |
| 73 | 73 |
| 74 for (size_t i = 0; i < drag_data_->size(); i++) { | 74 for (size_t i = 0; i < drag_data_->size(); i++) { |
| 75 TabContentsWrapper* wrapper = | 75 TabContentsWrapper* wrapper = |
| 76 TabContentsWrapper::GetCurrentWrapperForContents( | 76 TabContentsWrapper::GetCurrentWrapperForContents( |
| 77 drag_data_->get(i)->contents_->web_contents()); | 77 drag_data_->get(i)->contents_->web_contents()); |
| 78 renderers_[i]->UpdateData( | 78 renderers_[i]->UpdateData( |
| 79 drag_data_->get(i)->contents_->web_contents(), | 79 drag_data_->get(i)->contents_->web_contents(), |
| 80 wrapper->extension_tab_helper()->is_app(), | 80 wrapper->extension_tab_helper()->is_app(), |
| (...skipping 386 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 467 if (!attached_) { | 467 if (!attached_) { |
| 468 paint_at = widget_width / kScalingFactor - | 468 paint_at = widget_width / kScalingFactor - |
| 469 GetWidthInTabStripFromTo(0, index + 1); | 469 GetWidthInTabStripFromTo(0, index + 1); |
| 470 } | 470 } |
| 471 } | 471 } |
| 472 | 472 |
| 473 cairo_set_source_surface(cr, surface, paint_at, 0); | 473 cairo_set_source_surface(cr, surface, paint_at, 0); |
| 474 cairo_paint(cr); | 474 cairo_paint(cr); |
| 475 cairo_surface_destroy(surface); | 475 cairo_surface_destroy(surface); |
| 476 } | 476 } |
| OLD | NEW |