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 <limits> | 7 #include <limits> |
8 | 8 |
9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
10 #include "base/debug/alias.h" | 10 #include "base/debug/alias.h" |
(...skipping 1408 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1419 resized_icon.height(), | 1419 resized_icon.height(), |
1420 resized_bounds, true, SkPaint()); | 1420 resized_bounds, true, SkPaint()); |
1421 | 1421 |
1422 ui::ThemeProvider* tp = GetThemeProvider(); | 1422 ui::ThemeProvider* tp = GetThemeProvider(); |
1423 gfx::ImageSkia projection_screen( | 1423 gfx::ImageSkia projection_screen( |
1424 *tp->GetImageSkiaNamed(IDR_TAB_CAPTURE)); | 1424 *tp->GetImageSkiaNamed(IDR_TAB_CAPTURE)); |
1425 DrawIconCenter(canvas, projection_screen, 0, | 1425 DrawIconCenter(canvas, projection_screen, 0, |
1426 data().favicon.width(), | 1426 data().favicon.width(), |
1427 data().favicon.height(), | 1427 data().favicon.height(), |
1428 bounds, true, SkPaint()); | 1428 bounds, true, SkPaint()); |
| 1429 } else if (!icon_animation_ && tab_audio_indicator_->IsAnimating()) { |
| 1430 // Draw the audio indicator UI only if no other icon animation is |
| 1431 // active. |
| 1432 if (!icon_animation_ && tab_audio_indicator_->IsAnimating()) { |
| 1433 tab_audio_indicator_->set_favicon(data().favicon); |
| 1434 tab_audio_indicator_->Paint(canvas, bounds); |
| 1435 } |
1429 } else { | 1436 } else { |
1430 DrawIconCenter(canvas, data().favicon, 0, | 1437 DrawIconCenter(canvas, data().favicon, 0, |
1431 data().favicon.width(), | 1438 data().favicon.width(), |
1432 data().favicon.height(), | 1439 data().favicon.height(), |
1433 bounds, true, SkPaint()); | 1440 bounds, true, SkPaint()); |
1434 | |
1435 // Draw the audio indicator UI only if no other icon animation is | |
1436 // active. | |
1437 if (!icon_animation_ && tab_audio_indicator_->IsAnimating()) | |
1438 tab_audio_indicator_->Paint(canvas, bounds); | |
1439 } | 1441 } |
1440 } | 1442 } |
1441 } | 1443 } |
1442 canvas->Restore(); | 1444 canvas->Restore(); |
1443 | 1445 |
1444 // Paint recording or projecting animation overlay. | 1446 // Paint recording or projecting animation overlay. |
1445 if (data().capture_state != TabRendererData::CAPTURE_STATE_NONE) | 1447 if (data().capture_state != TabRendererData::CAPTURE_STATE_NONE) |
1446 PaintCaptureState(canvas, bounds); | 1448 PaintCaptureState(canvas, bounds); |
1447 } | 1449 } |
1448 | 1450 |
(...skipping 352 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1801 const gfx::ImageSkia& image) { | 1803 const gfx::ImageSkia& image) { |
1802 DCHECK_NE(scale_factor, ui::SCALE_FACTOR_NONE); | 1804 DCHECK_NE(scale_factor, ui::SCALE_FACTOR_NONE); |
1803 ImageCacheEntry entry; | 1805 ImageCacheEntry entry; |
1804 entry.resource_id = resource_id; | 1806 entry.resource_id = resource_id; |
1805 entry.scale_factor = scale_factor; | 1807 entry.scale_factor = scale_factor; |
1806 entry.image = image; | 1808 entry.image = image; |
1807 image_cache_->push_front(entry); | 1809 image_cache_->push_front(entry); |
1808 if (image_cache_->size() > kMaxImageCacheSize) | 1810 if (image_cache_->size() > kMaxImageCacheSize) |
1809 image_cache_->pop_back(); | 1811 image_cache_->pop_back(); |
1810 } | 1812 } |
OLD | NEW |