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

Side by Side Diff: chrome/browser/views/tabs/tab_2.cc

Issue 155334: Convert some stuff to string16 so the toolkit_views build can build again (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 11 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
« no previous file with comments | « chrome/browser/views/frame/browser_view.cc ('k') | chrome/browser/views/tabs/tab_renderer.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. Use of this 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. Use of this
2 // source code is governed by a BSD-style license that can be found in the 2 // source code is governed by a BSD-style license that can be found in the
3 // LICENSE file. 3 // LICENSE file.
4 4
5 #include "chrome/browser/views/tabs/tab_2.h" 5 #include "chrome/browser/views/tabs/tab_2.h"
6 6
7 #include "app/gfx/canvas.h" 7 #include "app/gfx/canvas.h"
8 #include "app/gfx/font.h" 8 #include "app/gfx/font.h"
9 #include "app/gfx/path.h" 9 #include "app/gfx/path.h"
10 #include "app/l10n_util.h" 10 #include "app/l10n_util.h"
(...skipping 442 matching lines...) Expand 10 before | Expand all | Expand 10 after
453 } 453 }
454 canvas->restore(); 454 canvas->restore();
455 } 455 }
456 } 456 }
457 457
458 void Tab2::PaintTitle(gfx::Canvas* canvas) { 458 void Tab2::PaintTitle(gfx::Canvas* canvas) {
459 // Paint the Title. 459 // Paint the Title.
460 string16 title = model_->GetTitle(this); 460 string16 title = model_->GetTitle(this);
461 if (title.empty()) { 461 if (title.empty()) {
462 if (model_->IsLoading(this)) 462 if (model_->IsLoading(this))
463 title = l10n_util::GetString(IDS_TAB_LOADING_TITLE); 463 title = l10n_util::GetStringUTF16(IDS_TAB_LOADING_TITLE);
464 else 464 else
465 title = l10n_util::GetString(IDS_TAB_UNTITLED_TITLE); 465 title = l10n_util::GetStringUTF16(IDS_TAB_UNTITLED_TITLE);
466 } else { 466 } else {
467 Browser::FormatTitleForDisplay(&title); 467 Browser::FormatTitleForDisplay(&title);
468 } 468 }
469 469
470 SkColor title_color = GetThemeProvider()-> 470 SkColor title_color = GetThemeProvider()->
471 GetColor(model_->IsSelected(this) ? 471 GetColor(model_->IsSelected(this) ?
472 BrowserThemeProvider::COLOR_TAB_TEXT : 472 BrowserThemeProvider::COLOR_TAB_TEXT :
473 BrowserThemeProvider::COLOR_BACKGROUND_TAB_TEXT); 473 BrowserThemeProvider::COLOR_BACKGROUND_TAB_TEXT);
474 474
475 canvas->DrawStringInt(title, *title_font, title_color, title_bounds_.x(), 475 canvas->DrawStringInt(UTF16ToWideHack(title), *title_font, title_color,
476 title_bounds_.y(), title_bounds_.width(), 476 title_bounds_.x(), title_bounds_.y(),
477 title_bounds_.height()); 477 title_bounds_.width(), title_bounds_.height());
478 } 478 }
479 479
480 void Tab2::PaintTabBackground(gfx::Canvas* canvas) { 480 void Tab2::PaintTabBackground(gfx::Canvas* canvas) {
481 if (model_->IsSelected(this)) { 481 if (model_->IsSelected(this)) {
482 // Sometimes detaching a tab quickly can result in the model reporting it 482 // Sometimes detaching a tab quickly can result in the model reporting it
483 // as not being selected, so is_drag_clone_ ensures that we always paint 483 // as not being selected, so is_drag_clone_ ensures that we always paint
484 // the active representation for the dragged tab. 484 // the active representation for the dragged tab.
485 PaintActiveTabBackground(canvas); 485 PaintActiveTabBackground(canvas);
486 } else { 486 } else {
487 // Draw our hover state. 487 // Draw our hover state.
(...skipping 192 matching lines...) Expand 10 before | Expand all | Expand 10 after
680 tab_inactive_.image_l = rb.GetBitmapNamed(IDR_TAB_INACTIVE_LEFT); 680 tab_inactive_.image_l = rb.GetBitmapNamed(IDR_TAB_INACTIVE_LEFT);
681 tab_inactive_.image_c = rb.GetBitmapNamed(IDR_TAB_INACTIVE_CENTER); 681 tab_inactive_.image_c = rb.GetBitmapNamed(IDR_TAB_INACTIVE_CENTER);
682 tab_inactive_.image_r = rb.GetBitmapNamed(IDR_TAB_INACTIVE_RIGHT); 682 tab_inactive_.image_r = rb.GetBitmapNamed(IDR_TAB_INACTIVE_RIGHT);
683 683
684 tab_inactive_.l_width = tab_inactive_.image_l->width(); 684 tab_inactive_.l_width = tab_inactive_.image_l->width();
685 tab_inactive_.r_width = tab_inactive_.image_r->width(); 685 tab_inactive_.r_width = tab_inactive_.image_r->width();
686 686
687 loading_animation_frames = rb.GetBitmapNamed(IDR_THROBBER); 687 loading_animation_frames = rb.GetBitmapNamed(IDR_THROBBER);
688 waiting_animation_frames = rb.GetBitmapNamed(IDR_THROBBER_WAITING); 688 waiting_animation_frames = rb.GetBitmapNamed(IDR_THROBBER_WAITING);
689 } 689 }
OLDNEW
« no previous file with comments | « chrome/browser/views/frame/browser_view.cc ('k') | chrome/browser/views/tabs/tab_renderer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698