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

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

Issue 23228004: Prepare to use gfx::RenderText in views::Label. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Revert Label implementation changes. Created 6 years, 5 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 417 matching lines...) Expand 10 before | Expand all | Expand 10 after
428 close_button_color_(0) { 428 close_button_color_(0) {
429 DCHECK(controller); 429 DCHECK(controller);
430 InitTabResources(); 430 InitTabResources();
431 431
432 // So we get don't get enter/exit on children and don't prematurely stop the 432 // So we get don't get enter/exit on children and don't prematurely stop the
433 // hover. 433 // hover.
434 set_notify_enter_exit_on_child(true); 434 set_notify_enter_exit_on_child(true);
435 435
436 set_id(VIEW_ID_TAB); 436 set_id(VIEW_ID_TAB);
437 437
438 title_->set_directionality_mode(gfx::DIRECTIONALITY_FROM_TEXT);
439 title_->SetHorizontalAlignment(gfx::ALIGN_TO_HEAD); 438 title_->SetHorizontalAlignment(gfx::ALIGN_TO_HEAD);
440 title_->SetElideBehavior(gfx::FADE_TAIL); 439 title_->SetElideBehavior(gfx::FADE_TAIL);
441 title_->SetAutoColorReadabilityEnabled(false); 440 title_->SetAutoColorReadabilityEnabled(false);
442 title_->SetText(CoreTabHelper::GetDefaultTitle()); 441 title_->SetText(CoreTabHelper::GetDefaultTitle());
443 AddChildView(title_); 442 AddChildView(title_);
444 443
445 SetEventTargeter( 444 SetEventTargeter(
446 scoped_ptr<views::ViewTargeter>(new views::ViewTargeter(this))); 445 scoped_ptr<views::ViewTargeter>(new views::ViewTargeter(this)));
447 446
448 // Add the Close Button. 447 // Add the Close Button.
(...skipping 1200 matching lines...) Expand 10 before | Expand all | Expand 10 after
1649 const gfx::ImageSkia& image) { 1648 const gfx::ImageSkia& image) {
1650 DCHECK_NE(scale_factor, ui::SCALE_FACTOR_NONE); 1649 DCHECK_NE(scale_factor, ui::SCALE_FACTOR_NONE);
1651 ImageCacheEntry entry; 1650 ImageCacheEntry entry;
1652 entry.resource_id = resource_id; 1651 entry.resource_id = resource_id;
1653 entry.scale_factor = scale_factor; 1652 entry.scale_factor = scale_factor;
1654 entry.image = image; 1653 entry.image = image;
1655 image_cache_->push_front(entry); 1654 image_cache_->push_front(entry);
1656 if (image_cache_->size() > kMaxImageCacheSize) 1655 if (image_cache_->size() > kMaxImageCacheSize)
1657 image_cache_->pop_back(); 1656 image_cache_->pop_back();
1658 } 1657 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698