Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(74)

Side by Side Diff: chrome/browser/ui/views/tabs/tab.cc

Issue 312233003: Add fade eliding for Views Labels; related cleanup. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Refine alignment check; minor additional cleanup. Created 6 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 1382 matching lines...) Expand 10 before | Expand all | Expand 10 after
1393 // Paint the Title. 1393 // Paint the Title.
1394 base::string16 title = data().title; 1394 base::string16 title = data().title;
1395 if (title.empty()) { 1395 if (title.empty()) {
1396 title = data().loading ? 1396 title = data().loading ?
1397 l10n_util::GetStringUTF16(IDS_TAB_LOADING_TITLE) : 1397 l10n_util::GetStringUTF16(IDS_TAB_LOADING_TITLE) :
1398 CoreTabHelper::GetDefaultTitle(); 1398 CoreTabHelper::GetDefaultTitle();
1399 } else { 1399 } else {
1400 Browser::FormatTitleForDisplay(&title); 1400 Browser::FormatTitleForDisplay(&title);
1401 } 1401 }
1402 1402
1403 canvas->DrawFadeTruncatingStringRect(title, gfx::Canvas::TruncateFadeTail, 1403 canvas->DrawFadedString(title, gfx::FontList(*font_), title_color,
1404 gfx::FontList(*font_), title_color, GetTitleBounds()); 1404 GetTitleBounds(), 0);
1405 } 1405 }
1406 1406
1407 void Tab::AdvanceLoadingAnimation(TabRendererData::NetworkState old_state, 1407 void Tab::AdvanceLoadingAnimation(TabRendererData::NetworkState old_state,
1408 TabRendererData::NetworkState state) { 1408 TabRendererData::NetworkState state) {
1409 static bool initialized = false; 1409 static bool initialized = false;
1410 static int loading_animation_frame_count = 0; 1410 static int loading_animation_frame_count = 0;
1411 static int waiting_animation_frame_count = 0; 1411 static int waiting_animation_frame_count = 0;
1412 static int waiting_to_loading_frame_count_ratio = 0; 1412 static int waiting_to_loading_frame_count_ratio = 0;
1413 if (!initialized) { 1413 if (!initialized) {
1414 initialized = true; 1414 initialized = true;
(...skipping 232 matching lines...) Expand 10 before | Expand all | Expand 10 after
1647 const gfx::ImageSkia& image) { 1647 const gfx::ImageSkia& image) {
1648 DCHECK_NE(scale_factor, ui::SCALE_FACTOR_NONE); 1648 DCHECK_NE(scale_factor, ui::SCALE_FACTOR_NONE);
1649 ImageCacheEntry entry; 1649 ImageCacheEntry entry;
1650 entry.resource_id = resource_id; 1650 entry.resource_id = resource_id;
1651 entry.scale_factor = scale_factor; 1651 entry.scale_factor = scale_factor;
1652 entry.image = image; 1652 entry.image = image;
1653 image_cache_->push_front(entry); 1653 image_cache_->push_front(entry);
1654 if (image_cache_->size() > kMaxImageCacheSize) 1654 if (image_cache_->size() > kMaxImageCacheSize)
1655 image_cache_->pop_back(); 1655 image_cache_->pop_back();
1656 } 1656 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/views/screen_capture_notification_ui_views.cc ('k') | ui/base/cocoa/menu_controller.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698