| 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 | 8 |
| 9 #include "app/gfx/canvas_paint.h" | 9 #include "app/gfx/canvas_paint.h" |
| 10 #include "app/gfx/favicon_size.h" | 10 #include "app/gfx/favicon_size.h" |
| (...skipping 375 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 386 | 386 |
| 387 gfx::Rect TabRendererGtk::GetNonMirroredBounds(GtkWidget* parent) const { | 387 gfx::Rect TabRendererGtk::GetNonMirroredBounds(GtkWidget* parent) const { |
| 388 // The tabstrip widget is a windowless widget so the tab widget's allocation | 388 // The tabstrip widget is a windowless widget so the tab widget's allocation |
| 389 // is relative to the browser titlebar. We need the bounds relative to the | 389 // is relative to the browser titlebar. We need the bounds relative to the |
| 390 // tabstrip. | 390 // tabstrip. |
| 391 gfx::Rect bounds = GetWidgetBoundsRelativeToParent(parent, widget()); | 391 gfx::Rect bounds = GetWidgetBoundsRelativeToParent(parent, widget()); |
| 392 bounds.set_x(gtk_util::MirroredLeftPointForRect(parent, bounds)); | 392 bounds.set_x(gtk_util::MirroredLeftPointForRect(parent, bounds)); |
| 393 return bounds; | 393 return bounds; |
| 394 } | 394 } |
| 395 | 395 |
| 396 gfx::Rect TabRendererGtk::GetRequisition() const { |
| 397 return gfx::Rect(requisition_.x(), requisition_.y(), |
| 398 requisition_.width(), requisition_.height()); |
| 399 } |
| 400 |
| 396 void TabRendererGtk::SetBounds(const gfx::Rect& bounds) { | 401 void TabRendererGtk::SetBounds(const gfx::Rect& bounds) { |
| 402 requisition_ = bounds; |
| 397 gtk_widget_set_size_request(tab_.get(), bounds.width(), bounds.height()); | 403 gtk_widget_set_size_request(tab_.get(), bounds.width(), bounds.height()); |
| 398 } | 404 } |
| 399 | 405 |
| 400 //////////////////////////////////////////////////////////////////////////////// | 406 //////////////////////////////////////////////////////////////////////////////// |
| 401 // TabRendererGtk, protected: | 407 // TabRendererGtk, protected: |
| 402 | 408 |
| 403 std::wstring TabRendererGtk::GetTitle() const { | 409 std::wstring TabRendererGtk::GetTitle() const { |
| 404 return UTF16ToWideHack(data_.title); | 410 return UTF16ToWideHack(data_.title); |
| 405 } | 411 } |
| 406 | 412 |
| (...skipping 465 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 872 ResourceBundle& rb = ResourceBundle::GetSharedInstance(); | 878 ResourceBundle& rb = ResourceBundle::GetSharedInstance(); |
| 873 // Force the font size to 8pt. | 879 // Force the font size to 8pt. |
| 874 gfx::Font base_font = rb.GetFont(ResourceBundle::BaseFont); | 880 gfx::Font base_font = rb.GetFont(ResourceBundle::BaseFont); |
| 875 title_font_ = new gfx::Font(gfx::Font::CreateFont(base_font.FontName(), 8)); | 881 title_font_ = new gfx::Font(gfx::Font::CreateFont(base_font.FontName(), 8)); |
| 876 title_font_height_ = title_font_->height(); | 882 title_font_height_ = title_font_->height(); |
| 877 | 883 |
| 878 crashed_fav_icon = rb.GetBitmapNamed(IDR_SAD_FAVICON); | 884 crashed_fav_icon = rb.GetBitmapNamed(IDR_SAD_FAVICON); |
| 879 | 885 |
| 880 initialized_ = true; | 886 initialized_ = true; |
| 881 } | 887 } |
| OLD | NEW |