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

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

Issue 10382144: Change SetImage, SetBackground, and SetToggledImage to take in a gfx::ImageSkia (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebased Created 8 years, 7 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/ui/views/tabs/base_tab.cc ('k') | chrome/browser/ui/views/tabs/tab_strip.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) 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/utf_string_conversions.h" 9 #include "base/utf_string_conversions.h"
10 #include "chrome/browser/defaults.h" 10 #include "chrome/browser/defaults.h"
(...skipping 308 matching lines...) Expand 10 before | Expand all | Expand 10 after
319 PaintTitle(canvas, title_color); 319 PaintTitle(canvas, title_color);
320 320
321 if (show_icon) 321 if (show_icon)
322 PaintIcon(canvas); 322 PaintIcon(canvas);
323 323
324 // If the close button color has changed, generate a new one. 324 // If the close button color has changed, generate a new one.
325 if (!close_button_color_ || title_color != close_button_color_) { 325 if (!close_button_color_ || title_color != close_button_color_) {
326 close_button_color_ = title_color; 326 close_button_color_ = title_color;
327 ui::ResourceBundle& rb = ui::ResourceBundle::GetSharedInstance(); 327 ui::ResourceBundle& rb = ui::ResourceBundle::GetSharedInstance();
328 close_button()->SetBackground(close_button_color_, 328 close_button()->SetBackground(close_button_color_,
329 rb.GetBitmapNamed(IDR_TAB_CLOSE), 329 rb.GetImageSkiaNamed(IDR_TAB_CLOSE),
330 rb.GetBitmapNamed(IDR_TAB_CLOSE_MASK)); 330 rb.GetImageSkiaNamed(IDR_TAB_CLOSE_MASK));
331 } 331 }
332 } 332 }
333 333
334 void Tab::Layout() { 334 void Tab::Layout() {
335 gfx::Rect lb = GetContentsBounds(); 335 gfx::Rect lb = GetContentsBounds();
336 if (lb.IsEmpty()) 336 if (lb.IsEmpty())
337 return; 337 return;
338 lb.Inset( 338 lb.Inset(
339 left_padding(), top_padding(), right_padding(), bottom_padding()); 339 left_padding(), top_padding(), right_padding(), bottom_padding());
340 340
(...skipping 373 matching lines...) Expand 10 before | Expand all | Expand 10 after
714 tab_active_.image_r = rb.GetBitmapNamed(IDR_TAB_ACTIVE_RIGHT); 714 tab_active_.image_r = rb.GetBitmapNamed(IDR_TAB_ACTIVE_RIGHT);
715 tab_active_.l_width = tab_active_.image_l->width(); 715 tab_active_.l_width = tab_active_.image_l->width();
716 tab_active_.r_width = tab_active_.image_r->width(); 716 tab_active_.r_width = tab_active_.image_r->width();
717 717
718 tab_inactive_.image_l = rb.GetBitmapNamed(IDR_TAB_INACTIVE_LEFT); 718 tab_inactive_.image_l = rb.GetBitmapNamed(IDR_TAB_INACTIVE_LEFT);
719 tab_inactive_.image_c = rb.GetBitmapNamed(IDR_TAB_INACTIVE_CENTER); 719 tab_inactive_.image_c = rb.GetBitmapNamed(IDR_TAB_INACTIVE_CENTER);
720 tab_inactive_.image_r = rb.GetBitmapNamed(IDR_TAB_INACTIVE_RIGHT); 720 tab_inactive_.image_r = rb.GetBitmapNamed(IDR_TAB_INACTIVE_RIGHT);
721 tab_inactive_.l_width = tab_inactive_.image_l->width(); 721 tab_inactive_.l_width = tab_inactive_.image_l->width();
722 tab_inactive_.r_width = tab_inactive_.image_r->width(); 722 tab_inactive_.r_width = tab_inactive_.image_r->width();
723 } 723 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/views/tabs/base_tab.cc ('k') | chrome/browser/ui/views/tabs/tab_strip.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698