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

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

Issue 9562038: ui/gfx: Make gfx::Canvas inherit from gfx::CanvasSkia. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: more fixes Created 8 years, 9 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/base_tab.h" 5 #include "chrome/browser/ui/views/tabs/base_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/utf_string_conversions.h" 10 #include "base/utf_string_conversions.h"
(...skipping 459 matching lines...) Expand 10 before | Expand all | Expand 10 after
470 470
471 if (title.empty()) { 471 if (title.empty()) {
472 title = data().loading ? 472 title = data().loading ?
473 l10n_util::GetStringUTF16(IDS_TAB_LOADING_TITLE) : 473 l10n_util::GetStringUTF16(IDS_TAB_LOADING_TITLE) :
474 CoreTabHelper::GetDefaultTitle(); 474 CoreTabHelper::GetDefaultTitle();
475 } else { 475 } else {
476 Browser::FormatTitleForDisplay(&title); 476 Browser::FormatTitleForDisplay(&title);
477 } 477 }
478 478
479 #if defined(OS_WIN) 479 #if defined(OS_WIN)
480 canvas->AsCanvasSkia()->DrawFadeTruncatingString(title, 480 canvas->DrawFadeTruncatingString(title,
481 gfx::CanvasSkia::TruncateFadeTail, 0, *font_, title_color, title_bounds); 481 gfx::CanvasSkia::TruncateFadeTail, 0, *font_, title_color, title_bounds);
482 #else 482 #else
483 canvas->DrawStringInt(title, *font_, title_color, 483 canvas->DrawStringInt(title, *font_, title_color,
484 title_bounds.x(), title_bounds.y(), 484 title_bounds.x(), title_bounds.y(),
485 title_bounds.width(), title_bounds.height()); 485 title_bounds.width(), title_bounds.height());
486 #endif 486 #endif
487 } 487 }
488 488
489 void BaseTab::AnimationProgressed(const ui::Animation* animation) { 489 void BaseTab::AnimationProgressed(const ui::Animation* animation) {
490 // Ignore if the pulse animation is being performed on active tab because 490 // Ignore if the pulse animation is being performed on active tab because
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after
572 // static 572 // static
573 void BaseTab::InitResources() { 573 void BaseTab::InitResources() {
574 static bool initialized = false; 574 static bool initialized = false;
575 if (!initialized) { 575 if (!initialized) {
576 initialized = true; 576 initialized = true;
577 font_ = new gfx::Font( 577 font_ = new gfx::Font(
578 ResourceBundle::GetSharedInstance().GetFont(ResourceBundle::BaseFont)); 578 ResourceBundle::GetSharedInstance().GetFont(ResourceBundle::BaseFont));
579 font_height_ = font_->GetHeight(); 579 font_height_ = font_->GetHeight();
580 } 580 }
581 } 581 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698