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

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

Issue 7227027: GTK: More 2.18 goodness. Move from macros to real accessor functions. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Remove views/ 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 340 matching lines...) Expand 10 before | Expand all | Expand 10 after
351 351
352 bool TabRendererGtk::IsActive() const { 352 bool TabRendererGtk::IsActive() const {
353 return true; 353 return true;
354 } 354 }
355 355
356 bool TabRendererGtk::IsSelected() const { 356 bool TabRendererGtk::IsSelected() const {
357 return true; 357 return true;
358 } 358 }
359 359
360 bool TabRendererGtk::IsVisible() const { 360 bool TabRendererGtk::IsVisible() const {
361 return GTK_WIDGET_FLAGS(tab_.get()) & GTK_VISIBLE; 361 return gtk_widget_get_visible(tab_.get());
362 } 362 }
363 363
364 void TabRendererGtk::SetVisible(bool visible) const { 364 void TabRendererGtk::SetVisible(bool visible) const {
365 if (visible) { 365 if (visible) {
366 gtk_widget_show(tab_.get()); 366 gtk_widget_show(tab_.get());
367 if (data_.mini) 367 if (data_.mini)
368 gtk_widget_show(close_button_->widget()); 368 gtk_widget_show(close_button_->widget());
369 } else { 369 } else {
370 gtk_widget_hide_all(tab_.get()); 370 gtk_widget_hide_all(tab_.get());
371 } 371 }
(...skipping 637 matching lines...) Expand 10 before | Expand all | Expand 10 after
1009 l10n_util::GetStringUTF8(IDS_TOOLTIP_CLOSE_TAB).c_str()); 1009 l10n_util::GetStringUTF8(IDS_TOOLTIP_CLOSE_TAB).c_str());
1010 1010
1011 g_signal_connect(button->widget(), "clicked", 1011 g_signal_connect(button->widget(), "clicked",
1012 G_CALLBACK(OnCloseButtonClickedThunk), this); 1012 G_CALLBACK(OnCloseButtonClickedThunk), this);
1013 g_signal_connect(button->widget(), "button-release-event", 1013 g_signal_connect(button->widget(), "button-release-event",
1014 G_CALLBACK(OnCloseButtonMouseReleaseThunk), this); 1014 G_CALLBACK(OnCloseButtonMouseReleaseThunk), this);
1015 g_signal_connect(button->widget(), "enter-notify-event", 1015 g_signal_connect(button->widget(), "enter-notify-event",
1016 G_CALLBACK(OnEnterNotifyEventThunk), this); 1016 G_CALLBACK(OnEnterNotifyEventThunk), this);
1017 g_signal_connect(button->widget(), "leave-notify-event", 1017 g_signal_connect(button->widget(), "leave-notify-event",
1018 G_CALLBACK(OnLeaveNotifyEventThunk), this); 1018 G_CALLBACK(OnLeaveNotifyEventThunk), this);
1019 GTK_WIDGET_UNSET_FLAGS(button->widget(), GTK_CAN_FOCUS); 1019 gtk_widget_set_can_focus(button->widget(), FALSE);
1020 gtk_fixed_put(GTK_FIXED(tab_.get()), button->widget(), 0, 0); 1020 gtk_fixed_put(GTK_FIXED(tab_.get()), button->widget(), 0, 0);
1021 1021
1022 return button; 1022 return button;
1023 } 1023 }
1024 1024
1025 double TabRendererGtk::GetThrobValue() { 1025 double TabRendererGtk::GetThrobValue() {
1026 if (mini_title_animation_.get() && mini_title_animation_->is_animating()) { 1026 if (mini_title_animation_.get() && mini_title_animation_->is_animating()) {
1027 return mini_title_animation_->GetCurrentValue() * 1027 return mini_title_animation_->GetCurrentValue() *
1028 kMiniTitleChangeThrobOpacity; 1028 kMiniTitleChangeThrobOpacity;
1029 } 1029 }
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after
1094 1094
1095 ResourceBundle& rb = ResourceBundle::GetSharedInstance(); 1095 ResourceBundle& rb = ResourceBundle::GetSharedInstance();
1096 const gfx::Font& base_font = rb.GetFont(ResourceBundle::BaseFont); 1096 const gfx::Font& base_font = rb.GetFont(ResourceBundle::BaseFont);
1097 title_font_ = new gfx::Font(base_font.GetFontName(), kFontPixelSize); 1097 title_font_ = new gfx::Font(base_font.GetFontName(), kFontPixelSize);
1098 title_font_height_ = title_font_->GetHeight(); 1098 title_font_height_ = title_font_->GetHeight();
1099 1099
1100 crashed_favicon = rb.GetBitmapNamed(IDR_SAD_FAVICON); 1100 crashed_favicon = rb.GetBitmapNamed(IDR_SAD_FAVICON);
1101 1101
1102 initialized_ = true; 1102 initialized_ = true;
1103 } 1103 }
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