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

Side by Side Diff: chrome/browser/ui/gtk/tabs/tab_strip_gtk.cc

Issue 8392011: GTK: Step 1 of tab strip refresh. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Rebase to ToT again. Created 9 years, 1 month 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 unified diff | Download patch
OLDNEW
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/tabs/tab_strip_gtk.h" 5 #include "chrome/browser/ui/gtk/tabs/tab_strip_gtk.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/i18n/rtl.h" 10 #include "base/i18n/rtl.h"
(...skipping 1261 matching lines...) Expand 10 before | Expand all | Expand 10 after
1272 } 1272 }
1273 1273
1274 bool TabStripGtk::EndDrag(bool canceled) { 1274 bool TabStripGtk::EndDrag(bool canceled) {
1275 return drag_controller_.get() ? drag_controller_->EndDrag(canceled) : false; 1275 return drag_controller_.get() ? drag_controller_->EndDrag(canceled) : false;
1276 } 1276 }
1277 1277
1278 bool TabStripGtk::HasAvailableDragActions() const { 1278 bool TabStripGtk::HasAvailableDragActions() const {
1279 return model_->delegate()->GetDragActions() != 0; 1279 return model_->delegate()->GetDragActions() != 0;
1280 } 1280 }
1281 1281
1282 ThemeService* TabStripGtk::GetThemeProvider() { 1282 GtkThemeService* TabStripGtk::GetThemeProvider() {
1283 return theme_service_; 1283 return theme_service_;
1284 } 1284 }
1285 1285
1286 TabStripMenuController* TabStripGtk::GetTabStripMenuControllerForTab( 1286 TabStripMenuController* TabStripGtk::GetTabStripMenuControllerForTab(
1287 TabGtk* tab) { 1287 TabGtk* tab) {
1288 return new TabStripMenuController(tab, model(), GetIndexOfTab(tab)); 1288 return new TabStripMenuController(tab, model(), GetIndexOfTab(tab));
1289 } 1289 }
1290 1290
1291 /////////////////////////////////////////////////////////////////////////////// 1291 ///////////////////////////////////////////////////////////////////////////////
1292 // TabStripGtk, MessageLoop::Observer implementation: 1292 // TabStripGtk, MessageLoop::Observer implementation:
(...skipping 877 matching lines...) Expand 10 before | Expand all | Expand 10 after
2170 break; 2170 break;
2171 } 2171 }
2172 ++t; 2172 ++t;
2173 } 2173 }
2174 } 2174 }
2175 return static_cast<int>(tabs_to_paint->size()) == num_rects; 2175 return static_cast<int>(tabs_to_paint->size()) == num_rects;
2176 } 2176 }
2177 2177
2178 void TabStripGtk::PaintOnlyFavicons(GdkEventExpose* event, 2178 void TabStripGtk::PaintOnlyFavicons(GdkEventExpose* event,
2179 const std::vector<int>& tabs_to_paint) { 2179 const std::vector<int>& tabs_to_paint) {
2180 for (size_t i = 0; i < tabs_to_paint.size(); ++i) 2180 cairo_t* cr = gdk_cairo_create(GDK_DRAWABLE(event->window));
2181 GetTabAt(tabs_to_paint[i])->PaintFaviconArea(event); 2181 for (size_t i = 0; i < tabs_to_paint.size(); ++i) {
2182 cairo_save(cr);
2183 GetTabAt(tabs_to_paint[i])->PaintFaviconArea(tabstrip_.get(), cr);
2184 cairo_restore(cr);
2185 }
2186
2187 cairo_destroy(cr);
2182 } 2188 }
2183 2189
2184 CustomDrawButton* TabStripGtk::MakeNewTabButton() { 2190 CustomDrawButton* TabStripGtk::MakeNewTabButton() {
2185 CustomDrawButton* button = new CustomDrawButton(IDR_NEWTAB_BUTTON, 2191 CustomDrawButton* button = new CustomDrawButton(IDR_NEWTAB_BUTTON,
2186 IDR_NEWTAB_BUTTON_P, IDR_NEWTAB_BUTTON_H, 0); 2192 IDR_NEWTAB_BUTTON_P, IDR_NEWTAB_BUTTON_H, 0);
2187 2193
2188 // Let the middle mouse button initiate clicks as well. 2194 // Let the middle mouse button initiate clicks as well.
2189 gtk_util::SetButtonTriggersNavigation(button->widget()); 2195 gtk_util::SetButtonTriggersNavigation(button->widget());
2190 g_signal_connect(button->widget(), "clicked", 2196 g_signal_connect(button->widget(), "clicked",
2191 G_CALLBACK(OnNewTabClickedThunk), this); 2197 G_CALLBACK(OnNewTabClickedThunk), this);
2192 gtk_widget_set_can_focus(button->widget(), FALSE); 2198 gtk_widget_set_can_focus(button->widget(), FALSE);
2193 gtk_fixed_put(GTK_FIXED(tabstrip_.get()), button->widget(), 0, 0); 2199 gtk_fixed_put(GTK_FIXED(tabstrip_.get()), button->widget(), 0, 0);
2194 2200
2195 return button; 2201 return button;
2196 } 2202 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698