| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/tab.h" | 5 #include "chrome/browser/ui/views/tabs/tab.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 #include <limits> | 8 #include <limits> |
| 9 #include <utility> | 9 #include <utility> |
| 10 | 10 |
| (...skipping 1461 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1472 canvas->DrawImageInt(favicon, 0, 0, bounds.width(), bounds.height(), | 1472 canvas->DrawImageInt(favicon, 0, 0, bounds.width(), bounds.height(), |
| 1473 bounds.x(), bounds.y(), bounds.width(), | 1473 bounds.x(), bounds.y(), bounds.width(), |
| 1474 bounds.height(), false); | 1474 bounds.height(), false); |
| 1475 } | 1475 } |
| 1476 } | 1476 } |
| 1477 } | 1477 } |
| 1478 | 1478 |
| 1479 void Tab::AdvanceLoadingAnimation() { | 1479 void Tab::AdvanceLoadingAnimation() { |
| 1480 const TabRendererData::NetworkState state = data().network_state; | 1480 const TabRendererData::NetworkState state = data().network_state; |
| 1481 if (controller_->IsImmersiveStyle()) { | 1481 if (controller_->IsImmersiveStyle()) { |
| 1482 throbber_->SetVisible(false); |
| 1482 if (state == TabRendererData::NETWORK_STATE_WAITING) { | 1483 if (state == TabRendererData::NETWORK_STATE_WAITING) { |
| 1483 // Waiting steps backwards. | 1484 // Waiting steps backwards. |
| 1484 immersive_loading_step_ = | 1485 immersive_loading_step_ = |
| 1485 (immersive_loading_step_ - 1 + kImmersiveLoadingStepCount) % | 1486 (immersive_loading_step_ - 1 + kImmersiveLoadingStepCount) % |
| 1486 kImmersiveLoadingStepCount; | 1487 kImmersiveLoadingStepCount; |
| 1487 } else if (state == TabRendererData::NETWORK_STATE_LOADING) { | 1488 } else if (state == TabRendererData::NETWORK_STATE_LOADING) { |
| 1488 immersive_loading_step_ = | 1489 immersive_loading_step_ = |
| 1489 (immersive_loading_step_ + 1) % kImmersiveLoadingStepCount; | 1490 (immersive_loading_step_ + 1) % kImmersiveLoadingStepCount; |
| 1490 } else { | 1491 } else { |
| 1491 immersive_loading_step_ = 0; | 1492 immersive_loading_step_ = 0; |
| (...skipping 267 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1759 const gfx::ImageSkia& image) { | 1760 const gfx::ImageSkia& image) { |
| 1760 DCHECK_NE(scale_factor, ui::SCALE_FACTOR_NONE); | 1761 DCHECK_NE(scale_factor, ui::SCALE_FACTOR_NONE); |
| 1761 ImageCacheEntry entry; | 1762 ImageCacheEntry entry; |
| 1762 entry.resource_id = resource_id; | 1763 entry.resource_id = resource_id; |
| 1763 entry.scale_factor = scale_factor; | 1764 entry.scale_factor = scale_factor; |
| 1764 entry.image = image; | 1765 entry.image = image; |
| 1765 image_cache_->push_front(entry); | 1766 image_cache_->push_front(entry); |
| 1766 if (image_cache_->size() > kMaxImageCacheSize) | 1767 if (image_cache_->size() > kMaxImageCacheSize) |
| 1767 image_cache_->pop_back(); | 1768 image_cache_->pop_back(); |
| 1768 } | 1769 } |
| OLD | NEW |