| OLD | NEW |
| 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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/gtk/tabs/tab_renderer_gtk.h" | 5 #include "chrome/browser/gtk/tabs/tab_renderer_gtk.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <utility> | 8 #include <utility> |
| 9 | 9 |
| 10 #include "app/gfx/canvas_paint.h" | 10 #include "app/gfx/canvas_paint.h" |
| (...skipping 611 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 622 if (text_height > minimum_size.height()) | 622 if (text_height > minimum_size.height()) |
| 623 title_top -= (text_height - minimum_size.height()) / 2; | 623 title_top -= (text_height - minimum_size.height()) / 2; |
| 624 | 624 |
| 625 int title_width; | 625 int title_width; |
| 626 if (close_button_bounds_.width() && close_button_bounds_.height()) { | 626 if (close_button_bounds_.width() && close_button_bounds_.height()) { |
| 627 title_width = std::max(close_button_bounds_.x() - | 627 title_width = std::max(close_button_bounds_.x() - |
| 628 kTitleCloseButtonSpacing - title_left, 0); | 628 kTitleCloseButtonSpacing - title_left, 0); |
| 629 } else { | 629 } else { |
| 630 title_width = std::max(local_bounds.width() - title_left, 0); | 630 title_width = std::max(local_bounds.width() - title_left, 0); |
| 631 } | 631 } |
| 632 title_bounds_.SetRect(title_left, title_top, title_width, | 632 title_bounds_.SetRect(title_left, title_top, title_width, content_height); |
| 633 title_font_height_); | |
| 634 } | 633 } |
| 635 | 634 |
| 636 favicon_bounds_.set_x( | 635 favicon_bounds_.set_x( |
| 637 gtk_util::MirroredLeftPointForRect(tab_.get(), favicon_bounds_)); | 636 gtk_util::MirroredLeftPointForRect(tab_.get(), favicon_bounds_)); |
| 638 close_button_bounds_.set_x( | 637 close_button_bounds_.set_x( |
| 639 gtk_util::MirroredLeftPointForRect(tab_.get(), close_button_bounds_)); | 638 gtk_util::MirroredLeftPointForRect(tab_.get(), close_button_bounds_)); |
| 640 title_bounds_.set_x( | 639 title_bounds_.set_x( |
| 641 gtk_util::MirroredLeftPointForRect(tab_.get(), title_bounds_)); | 640 gtk_util::MirroredLeftPointForRect(tab_.get(), title_bounds_)); |
| 642 | 641 |
| 643 MoveCloseButtonWidget(); | 642 MoveCloseButtonWidget(); |
| (...skipping 344 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 988 // Force the font size to 9pt, which matches Windows' default font size | 987 // Force the font size to 9pt, which matches Windows' default font size |
| 989 // (taken from the system). | 988 // (taken from the system). |
| 990 gfx::Font base_font = rb.GetFont(ResourceBundle::BaseFont); | 989 gfx::Font base_font = rb.GetFont(ResourceBundle::BaseFont); |
| 991 title_font_ = new gfx::Font(gfx::Font::CreateFont(base_font.FontName(), 9)); | 990 title_font_ = new gfx::Font(gfx::Font::CreateFont(base_font.FontName(), 9)); |
| 992 title_font_height_ = title_font_->height(); | 991 title_font_height_ = title_font_->height(); |
| 993 | 992 |
| 994 crashed_fav_icon = rb.GetBitmapNamed(IDR_SAD_FAVICON); | 993 crashed_fav_icon = rb.GetBitmapNamed(IDR_SAD_FAVICON); |
| 995 | 994 |
| 996 initialized_ = true; | 995 initialized_ = true; |
| 997 } | 996 } |
| OLD | NEW |