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

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

Issue 7484035: Reapplies r91761. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 years, 5 months 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 | Annotate | Revision Log
« no previous file with comments | « chrome/browser/ui/gtk/tabs/tab_gtk.cc ('k') | chrome/browser/ui/gtk/tabs/tab_strip_gtk.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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_renderer_gtk.h" 5 #include "chrome/browser/ui/gtk/tabs/tab_renderer_gtk.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <utility> 8 #include <utility>
9 9
10 #include "base/utf_string_conversions.h" 10 #include "base/utf_string_conversions.h"
(...skipping 341 matching lines...) Expand 10 before | Expand all | Expand 10 after
352 352
353 bool TabRendererGtk::IsActive() const { 353 bool TabRendererGtk::IsActive() const {
354 return true; 354 return true;
355 } 355 }
356 356
357 bool TabRendererGtk::IsSelected() const { 357 bool TabRendererGtk::IsSelected() const {
358 return true; 358 return true;
359 } 359 }
360 360
361 bool TabRendererGtk::IsVisible() const { 361 bool TabRendererGtk::IsVisible() const {
362 return GTK_WIDGET_FLAGS(tab_.get()) & GTK_VISIBLE; 362 return gtk_widget_get_visible(tab_.get());
363 } 363 }
364 364
365 void TabRendererGtk::SetVisible(bool visible) const { 365 void TabRendererGtk::SetVisible(bool visible) const {
366 if (visible) { 366 if (visible) {
367 gtk_widget_show(tab_.get()); 367 gtk_widget_show(tab_.get());
368 if (data_.mini) 368 if (data_.mini)
369 gtk_widget_show(close_button_->widget()); 369 gtk_widget_show(close_button_->widget());
370 } else { 370 } else {
371 gtk_widget_hide_all(tab_.get()); 371 gtk_widget_hide_all(tab_.get());
372 } 372 }
(...skipping 631 matching lines...) Expand 10 before | Expand all | Expand 10 after
1004 l10n_util::GetStringUTF8(IDS_TOOLTIP_CLOSE_TAB).c_str()); 1004 l10n_util::GetStringUTF8(IDS_TOOLTIP_CLOSE_TAB).c_str());
1005 1005
1006 g_signal_connect(button->widget(), "clicked", 1006 g_signal_connect(button->widget(), "clicked",
1007 G_CALLBACK(OnCloseButtonClickedThunk), this); 1007 G_CALLBACK(OnCloseButtonClickedThunk), this);
1008 g_signal_connect(button->widget(), "button-release-event", 1008 g_signal_connect(button->widget(), "button-release-event",
1009 G_CALLBACK(OnCloseButtonMouseReleaseThunk), this); 1009 G_CALLBACK(OnCloseButtonMouseReleaseThunk), this);
1010 g_signal_connect(button->widget(), "enter-notify-event", 1010 g_signal_connect(button->widget(), "enter-notify-event",
1011 G_CALLBACK(OnEnterNotifyEventThunk), this); 1011 G_CALLBACK(OnEnterNotifyEventThunk), this);
1012 g_signal_connect(button->widget(), "leave-notify-event", 1012 g_signal_connect(button->widget(), "leave-notify-event",
1013 G_CALLBACK(OnLeaveNotifyEventThunk), this); 1013 G_CALLBACK(OnLeaveNotifyEventThunk), this);
1014 GTK_WIDGET_UNSET_FLAGS(button->widget(), GTK_CAN_FOCUS); 1014 gtk_widget_set_can_focus(button->widget(), FALSE);
1015 gtk_fixed_put(GTK_FIXED(tab_.get()), button->widget(), 0, 0); 1015 gtk_fixed_put(GTK_FIXED(tab_.get()), button->widget(), 0, 0);
1016 1016
1017 return button; 1017 return button;
1018 } 1018 }
1019 1019
1020 double TabRendererGtk::GetThrobValue() { 1020 double TabRendererGtk::GetThrobValue() {
1021 if (mini_title_animation_.get() && mini_title_animation_->is_animating()) { 1021 if (mini_title_animation_.get() && mini_title_animation_->is_animating()) {
1022 return mini_title_animation_->GetCurrentValue() * 1022 return mini_title_animation_->GetCurrentValue() *
1023 kMiniTitleChangeThrobOpacity; 1023 kMiniTitleChangeThrobOpacity;
1024 } 1024 }
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after
1089 1089
1090 ResourceBundle& rb = ResourceBundle::GetSharedInstance(); 1090 ResourceBundle& rb = ResourceBundle::GetSharedInstance();
1091 const gfx::Font& base_font = rb.GetFont(ResourceBundle::BaseFont); 1091 const gfx::Font& base_font = rb.GetFont(ResourceBundle::BaseFont);
1092 title_font_ = new gfx::Font(base_font.GetFontName(), kFontPixelSize); 1092 title_font_ = new gfx::Font(base_font.GetFontName(), kFontPixelSize);
1093 title_font_height_ = title_font_->GetHeight(); 1093 title_font_height_ = title_font_->GetHeight();
1094 1094
1095 crashed_favicon = rb.GetBitmapNamed(IDR_SAD_FAVICON); 1095 crashed_favicon = rb.GetBitmapNamed(IDR_SAD_FAVICON);
1096 1096
1097 initialized_ = true; 1097 initialized_ = true;
1098 } 1098 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/gtk/tabs/tab_gtk.cc ('k') | chrome/browser/ui/gtk/tabs/tab_strip_gtk.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698