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" |
11 #include "base/strings/utf_string_conversions.h" | 11 #include "base/strings/utf_string_conversions.h" |
12 #include "chrome/browser/defaults.h" | 12 #include "chrome/browser/defaults.h" |
13 #include "chrome/browser/themes/theme_properties.h" | 13 #include "chrome/browser/themes/theme_properties.h" |
14 #include "chrome/browser/ui/browser.h" | 14 #include "chrome/browser/ui/browser.h" |
| 15 #include "chrome/browser/ui/browser_util.h" |
15 #include "chrome/browser/ui/tab_contents/core_tab_helper.h" | 16 #include "chrome/browser/ui/tab_contents/core_tab_helper.h" |
16 #include "chrome/browser/ui/tabs/tab_resources.h" | 17 #include "chrome/browser/ui/tabs/tab_resources.h" |
17 #include "chrome/browser/ui/tabs/tab_utils.h" | 18 #include "chrome/browser/ui/tabs/tab_utils.h" |
18 #include "chrome/browser/ui/view_ids.h" | 19 #include "chrome/browser/ui/view_ids.h" |
19 #include "chrome/browser/ui/views/tabs/tab_controller.h" | 20 #include "chrome/browser/ui/views/tabs/tab_controller.h" |
20 #include "chrome/browser/ui/views/theme_image_mapper.h" | 21 #include "chrome/browser/ui/views/theme_image_mapper.h" |
21 #include "chrome/browser/ui/views/touch_uma/touch_uma.h" | 22 #include "chrome/browser/ui/views/touch_uma/touch_uma.h" |
22 #include "chrome/common/chrome_switches.h" | 23 #include "chrome/common/chrome_switches.h" |
23 #include "chrome/grit/generated_resources.h" | 24 #include "chrome/grit/generated_resources.h" |
24 #include "grit/theme_resources.h" | 25 #include "grit/theme_resources.h" |
(...skipping 452 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
477 | 478 |
478 TabRendererData old(data_); | 479 TabRendererData old(data_); |
479 data_ = data; | 480 data_ = data; |
480 | 481 |
481 base::string16 title = data_.title; | 482 base::string16 title = data_.title; |
482 if (title.empty()) { | 483 if (title.empty()) { |
483 title = data_.loading ? | 484 title = data_.loading ? |
484 l10n_util::GetStringUTF16(IDS_TAB_LOADING_TITLE) : | 485 l10n_util::GetStringUTF16(IDS_TAB_LOADING_TITLE) : |
485 CoreTabHelper::GetDefaultTitle(); | 486 CoreTabHelper::GetDefaultTitle(); |
486 } else { | 487 } else { |
487 Browser::FormatTitleForDisplay(&title); | 488 BrowserUtil::FormatTitleForDisplay(&title); |
488 } | 489 } |
489 title_->SetText(title); | 490 title_->SetText(title); |
490 | 491 |
491 if (data_.IsCrashed()) { | 492 if (data_.IsCrashed()) { |
492 if (!should_display_crashed_favicon_ && !IsPerformingCrashAnimation()) { | 493 if (!should_display_crashed_favicon_ && !IsPerformingCrashAnimation()) { |
493 data_.media_state = TAB_MEDIA_STATE_NONE; | 494 data_.media_state = TAB_MEDIA_STATE_NONE; |
494 #if defined(OS_CHROMEOS) | 495 #if defined(OS_CHROMEOS) |
495 // On Chrome OS, we reload killed tabs automatically when the user | 496 // On Chrome OS, we reload killed tabs automatically when the user |
496 // switches to them. Don't display animations for these unless they're | 497 // switches to them. Don't display animations for these unless they're |
497 // selected (i.e. in the foreground) -- we won't reload these | 498 // selected (i.e. in the foreground) -- we won't reload these |
(...skipping 1105 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1603 const gfx::ImageSkia& image) { | 1604 const gfx::ImageSkia& image) { |
1604 DCHECK_NE(scale_factor, ui::SCALE_FACTOR_NONE); | 1605 DCHECK_NE(scale_factor, ui::SCALE_FACTOR_NONE); |
1605 ImageCacheEntry entry; | 1606 ImageCacheEntry entry; |
1606 entry.resource_id = resource_id; | 1607 entry.resource_id = resource_id; |
1607 entry.scale_factor = scale_factor; | 1608 entry.scale_factor = scale_factor; |
1608 entry.image = image; | 1609 entry.image = image; |
1609 image_cache_->push_front(entry); | 1610 image_cache_->push_front(entry); |
1610 if (image_cache_->size() > kMaxImageCacheSize) | 1611 if (image_cache_->size() > kMaxImageCacheSize) |
1611 image_cache_->pop_back(); | 1612 image_cache_->pop_back(); |
1612 } | 1613 } |
OLD | NEW |