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/tab_strip_gtk.h" | 5 #include "chrome/browser/ui/gtk/tabs/tab_strip_gtk.h" |
6 | 6 |
7 #include <gtk/gtk.h> | 7 #include <gtk/gtk.h> |
8 | 8 |
9 #include <algorithm> | 9 #include <algorithm> |
10 #include <string> | 10 #include <string> |
(...skipping 1388 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1399 } | 1399 } |
1400 return GetTabAt(index); | 1400 return GetTabAt(index); |
1401 } | 1401 } |
1402 | 1402 |
1403 void TabStripGtk::RemoveTabAt(int index) { | 1403 void TabStripGtk::RemoveTabAt(int index) { |
1404 TabGtk* removed = tab_data_.at(index).tab; | 1404 TabGtk* removed = tab_data_.at(index).tab; |
1405 | 1405 |
1406 // Remove the Tab from the TabStrip's list. | 1406 // Remove the Tab from the TabStrip's list. |
1407 tab_data_.erase(tab_data_.begin() + index); | 1407 tab_data_.erase(tab_data_.begin() + index); |
1408 | 1408 |
1409 if (!IsDragSessionActive() || !drag_controller_->IsDraggingTab(removed)) { | 1409 if (!removed->dragging()) { |
1410 gtk_container_remove(GTK_CONTAINER(tabstrip_.get()), removed->widget()); | 1410 gtk_container_remove(GTK_CONTAINER(tabstrip_.get()), removed->widget()); |
1411 delete removed; | 1411 delete removed; |
1412 } | 1412 } |
1413 } | 1413 } |
1414 | 1414 |
1415 void TabStripGtk::HandleGlobalMouseMoveEvent() { | 1415 void TabStripGtk::HandleGlobalMouseMoveEvent() { |
1416 if (!IsCursorInTabStripZone()) { | 1416 if (!IsCursorInTabStripZone()) { |
1417 // Mouse moved outside the tab slop zone, start a timer to do a resize | 1417 // Mouse moved outside the tab slop zone, start a timer to do a resize |
1418 // layout after a short while... | 1418 // layout after a short while... |
1419 if (!weak_factory_.HasWeakPtrs()) { | 1419 if (!weak_factory_.HasWeakPtrs()) { |
(...skipping 852 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2272 | 2272 |
2273 void TabStripGtk::SetNewTabButtonBackground() { | 2273 void TabStripGtk::SetNewTabButtonBackground() { |
2274 SkColor color = theme_service_->GetColor( | 2274 SkColor color = theme_service_->GetColor( |
2275 ThemeProperties::COLOR_BUTTON_BACKGROUND); | 2275 ThemeProperties::COLOR_BUTTON_BACKGROUND); |
2276 SkBitmap background = theme_service_->GetImageNamed( | 2276 SkBitmap background = theme_service_->GetImageNamed( |
2277 IDR_THEME_WINDOW_CONTROL_BACKGROUND).AsBitmap(); | 2277 IDR_THEME_WINDOW_CONTROL_BACKGROUND).AsBitmap(); |
2278 SkBitmap mask = theme_service_->GetImageNamed( | 2278 SkBitmap mask = theme_service_->GetImageNamed( |
2279 IDR_NEWTAB_BUTTON_MASK).AsBitmap(); | 2279 IDR_NEWTAB_BUTTON_MASK).AsBitmap(); |
2280 newtab_button_->SetBackground(color, background, mask); | 2280 newtab_button_->SetBackground(color, background, mask); |
2281 } | 2281 } |
OLD | NEW |