| 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/i18n/rtl.h" | 9 #include "base/i18n/rtl.h" |
| 10 #include "base/string_util.h" | 10 #include "base/string_util.h" |
| (...skipping 689 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 700 available_width_for_tabs_(-1), | 700 available_width_for_tabs_(-1), |
| 701 needs_resize_layout_(false), | 701 needs_resize_layout_(false), |
| 702 tab_vertical_offset_(0), | 702 tab_vertical_offset_(0), |
| 703 model_(model), | 703 model_(model), |
| 704 window_(window), | 704 window_(window), |
| 705 theme_service_(GtkThemeService::GetFrom(model->profile())), | 705 theme_service_(GtkThemeService::GetFrom(model->profile())), |
| 706 resize_layout_factory_(this), | 706 resize_layout_factory_(this), |
| 707 added_as_message_loop_observer_(false), | 707 added_as_message_loop_observer_(false), |
| 708 hover_tab_selector_(model) { | 708 hover_tab_selector_(model) { |
| 709 theme_service_->InitThemesFor(this); | 709 theme_service_->InitThemesFor(this); |
| 710 registrar_.Add(this, NotificationType::BROWSER_THEME_CHANGED, | 710 registrar_.Add(this, chrome::BROWSER_THEME_CHANGED, |
| 711 Source<ThemeService>(theme_service_)); | 711 Source<ThemeService>(theme_service_)); |
| 712 } | 712 } |
| 713 | 713 |
| 714 TabStripGtk::~TabStripGtk() { | 714 TabStripGtk::~TabStripGtk() { |
| 715 model_->RemoveObserver(this); | 715 model_->RemoveObserver(this); |
| 716 tabstrip_.Destroy(); | 716 tabstrip_.Destroy(); |
| 717 | 717 |
| 718 // Free any remaining tabs. This is needed to free the very last tab, | 718 // Free any remaining tabs. This is needed to free the very last tab, |
| 719 // because it is not animated on close. This also happens when all of the | 719 // because it is not animated on close. This also happens when all of the |
| 720 // tabs are closed at once. | 720 // tabs are closed at once. |
| (...skipping 560 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1281 break; | 1281 break; |
| 1282 } | 1282 } |
| 1283 } | 1283 } |
| 1284 | 1284 |
| 1285 /////////////////////////////////////////////////////////////////////////////// | 1285 /////////////////////////////////////////////////////////////////////////////// |
| 1286 // TabStripGtk, NotificationObserver implementation: | 1286 // TabStripGtk, NotificationObserver implementation: |
| 1287 | 1287 |
| 1288 void TabStripGtk::Observe(NotificationType type, | 1288 void TabStripGtk::Observe(NotificationType type, |
| 1289 const NotificationSource& source, | 1289 const NotificationSource& source, |
| 1290 const NotificationDetails& details) { | 1290 const NotificationDetails& details) { |
| 1291 if (type == NotificationType::BROWSER_THEME_CHANGED) { | 1291 if (type == chrome::BROWSER_THEME_CHANGED) { |
| 1292 TabRendererGtk::SetSelectedTitleColor(theme_service_->GetColor( | 1292 TabRendererGtk::SetSelectedTitleColor(theme_service_->GetColor( |
| 1293 ThemeService::COLOR_TAB_TEXT)); | 1293 ThemeService::COLOR_TAB_TEXT)); |
| 1294 TabRendererGtk::SetUnselectedTitleColor(theme_service_->GetColor( | 1294 TabRendererGtk::SetUnselectedTitleColor(theme_service_->GetColor( |
| 1295 ThemeService::COLOR_BACKGROUND_TAB_TEXT)); | 1295 ThemeService::COLOR_BACKGROUND_TAB_TEXT)); |
| 1296 } | 1296 } |
| 1297 } | 1297 } |
| 1298 | 1298 |
| 1299 //////////////////////////////////////////////////////////////////////////////// | 1299 //////////////////////////////////////////////////////////////////////////////// |
| 1300 // TabStripGtk, private: | 1300 // TabStripGtk, private: |
| 1301 | 1301 |
| (...skipping 823 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2125 | 2125 |
| 2126 // Let the middle mouse button initiate clicks as well. | 2126 // Let the middle mouse button initiate clicks as well. |
| 2127 gtk_util::SetButtonTriggersNavigation(button->widget()); | 2127 gtk_util::SetButtonTriggersNavigation(button->widget()); |
| 2128 g_signal_connect(button->widget(), "clicked", | 2128 g_signal_connect(button->widget(), "clicked", |
| 2129 G_CALLBACK(OnNewTabClickedThunk), this); | 2129 G_CALLBACK(OnNewTabClickedThunk), this); |
| 2130 gtk_widget_set_can_focus(button->widget(), FALSE); | 2130 gtk_widget_set_can_focus(button->widget(), FALSE); |
| 2131 gtk_fixed_put(GTK_FIXED(tabstrip_.get()), button->widget(), 0, 0); | 2131 gtk_fixed_put(GTK_FIXED(tabstrip_.get()), button->widget(), 0, 0); |
| 2132 | 2132 |
| 2133 return button; | 2133 return button; |
| 2134 } | 2134 } |
| OLD | NEW |