Chromium Code Reviews| 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/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 2116 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 2127 hover_tab_selector_.CancelTabTransition(); | 2127 hover_tab_selector_.CancelTabTransition(); |
| 2128 | 2128 |
| 2129 return FALSE; | 2129 return FALSE; |
| 2130 } | 2130 } |
| 2131 | 2131 |
| 2132 gboolean TabStripGtk::OnDragDataReceived(GtkWidget* widget, | 2132 gboolean TabStripGtk::OnDragDataReceived(GtkWidget* widget, |
| 2133 GdkDragContext* context, | 2133 GdkDragContext* context, |
| 2134 gint x, gint y, | 2134 gint x, gint y, |
| 2135 GtkSelectionData* data, | 2135 GtkSelectionData* data, |
| 2136 guint info, guint time) { | 2136 guint info, guint time) { |
| 2137 bool success = false; | 2137 bool success = false; |
|
James Hawkins
2011/11/21 17:33:59
|success| is not unused.
| |
| 2138 | 2138 |
| 2139 if (info == ui::TEXT_URI_LIST || | 2139 if (info == ui::TEXT_URI_LIST || |
| 2140 info == ui::NETSCAPE_URL || | 2140 info == ui::NETSCAPE_URL || |
| 2141 info == ui::TEXT_PLAIN) { | 2141 info == ui::TEXT_PLAIN) { |
| 2142 success = CompleteDrop(data->data, info == ui::TEXT_PLAIN); | 2142 success = CompleteDrop(data->data, info == ui::TEXT_PLAIN); |
| 2143 } | 2143 } |
| 2144 | 2144 |
| 2145 gtk_drag_finish(context, success, success, time); | 2145 gtk_drag_finish(context, success, FALSE, time); |
| 2146 return TRUE; | 2146 return TRUE; |
| 2147 } | 2147 } |
| 2148 | 2148 |
| 2149 void TabStripGtk::OnNewTabClicked(GtkWidget* widget) { | 2149 void TabStripGtk::OnNewTabClicked(GtkWidget* widget) { |
| 2150 GdkEvent* event = gtk_get_current_event(); | 2150 GdkEvent* event = gtk_get_current_event(); |
| 2151 DCHECK_EQ(event->type, GDK_BUTTON_RELEASE); | 2151 DCHECK_EQ(event->type, GDK_BUTTON_RELEASE); |
| 2152 int mouse_button = event->button.button; | 2152 int mouse_button = event->button.button; |
| 2153 gdk_event_free(event); | 2153 gdk_event_free(event); |
| 2154 | 2154 |
| 2155 switch (mouse_button) { | 2155 switch (mouse_button) { |
| (...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 2229 } | 2229 } |
| 2230 | 2230 |
| 2231 void TabStripGtk::SetNewTabButtonBackground() { | 2231 void TabStripGtk::SetNewTabButtonBackground() { |
| 2232 SkColor color = theme_service_->GetColor( | 2232 SkColor color = theme_service_->GetColor( |
| 2233 ThemeService::COLOR_BUTTON_BACKGROUND); | 2233 ThemeService::COLOR_BUTTON_BACKGROUND); |
| 2234 SkBitmap* background = theme_service_->GetBitmapNamed( | 2234 SkBitmap* background = theme_service_->GetBitmapNamed( |
| 2235 IDR_THEME_WINDOW_CONTROL_BACKGROUND); | 2235 IDR_THEME_WINDOW_CONTROL_BACKGROUND); |
| 2236 SkBitmap* mask = theme_service_->GetBitmapNamed(IDR_NEWTAB_BUTTON_MASK); | 2236 SkBitmap* mask = theme_service_->GetBitmapNamed(IDR_NEWTAB_BUTTON_MASK); |
| 2237 newtab_button_->SetBackground(color, background, mask); | 2237 newtab_button_->SetBackground(color, background, mask); |
| 2238 } | 2238 } |
| OLD | NEW |