| 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/views/tabs/base_tab.h" | 5 #include "chrome/browser/ui/views/tabs/base_tab.h" |
| 6 | 6 |
| 7 #include <limits> | 7 #include <limits> |
| 8 | 8 |
| 9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
| 10 #include "base/utf_string_conversions.h" | 10 #include "base/utf_string_conversions.h" |
| (...skipping 400 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 411 loading_animation_frame_ = 0; | 411 loading_animation_frame_ = 0; |
| 412 } | 412 } |
| 413 ScheduleIconPaint(); | 413 ScheduleIconPaint(); |
| 414 } | 414 } |
| 415 | 415 |
| 416 void BaseTab::PaintIcon(gfx::Canvas* canvas) { | 416 void BaseTab::PaintIcon(gfx::Canvas* canvas) { |
| 417 gfx::Rect bounds = GetIconBounds(); | 417 gfx::Rect bounds = GetIconBounds(); |
| 418 if (bounds.IsEmpty()) | 418 if (bounds.IsEmpty()) |
| 419 return; | 419 return; |
| 420 | 420 |
| 421 // The size of bounds has to be kFavIconSize x kFavIconSize. | 421 // The size of bounds has to be kFaviconSize x kFaviconSize. |
| 422 DCHECK_EQ(kFavIconSize, bounds.width()); | 422 DCHECK_EQ(kFaviconSize, bounds.width()); |
| 423 DCHECK_EQ(kFavIconSize, bounds.height()); | 423 DCHECK_EQ(kFaviconSize, bounds.height()); |
| 424 | 424 |
| 425 bounds.set_x(GetMirroredXForRect(bounds)); | 425 bounds.set_x(GetMirroredXForRect(bounds)); |
| 426 | 426 |
| 427 if (data().network_state != TabRendererData::NETWORK_STATE_NONE) { | 427 if (data().network_state != TabRendererData::NETWORK_STATE_NONE) { |
| 428 ui::ThemeProvider* tp = GetThemeProvider(); | 428 ui::ThemeProvider* tp = GetThemeProvider(); |
| 429 SkBitmap frames(*tp->GetBitmapNamed( | 429 SkBitmap frames(*tp->GetBitmapNamed( |
| 430 (data().network_state == TabRendererData::NETWORK_STATE_WAITING) ? | 430 (data().network_state == TabRendererData::NETWORK_STATE_WAITING) ? |
| 431 IDR_THROBBER_WAITING : IDR_THROBBER)); | 431 IDR_THROBBER_WAITING : IDR_THROBBER)); |
| 432 | 432 |
| 433 int icon_size = frames.height(); | 433 int icon_size = frames.height(); |
| (...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 564 // static | 564 // static |
| 565 void BaseTab::InitResources() { | 565 void BaseTab::InitResources() { |
| 566 static bool initialized = false; | 566 static bool initialized = false; |
| 567 if (!initialized) { | 567 if (!initialized) { |
| 568 initialized = true; | 568 initialized = true; |
| 569 font_ = new gfx::Font( | 569 font_ = new gfx::Font( |
| 570 ResourceBundle::GetSharedInstance().GetFont(ResourceBundle::BaseFont)); | 570 ResourceBundle::GetSharedInstance().GetFont(ResourceBundle::BaseFont)); |
| 571 font_height_ = font_->GetHeight(); | 571 font_height_ = font_->GetHeight(); |
| 572 } | 572 } |
| 573 } | 573 } |
| OLD | NEW |