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

Side by Side Diff: chrome/browser/ui/views/tabs/base_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: 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
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 142 matching lines...) Expand 10 before | Expand all | Expand 10 after
153 theme_provider_(NULL), 153 theme_provider_(NULL),
154 ALLOW_THIS_IN_INITIALIZER_LIST(hover_controller_(this)) { 154 ALLOW_THIS_IN_INITIALIZER_LIST(hover_controller_(this)) {
155 BaseTab::InitResources(); 155 BaseTab::InitResources();
156 156
157 set_id(VIEW_ID_TAB); 157 set_id(VIEW_ID_TAB);
158 158
159 // Add the Close Button. 159 // Add the Close Button.
160 close_button_ = new TabCloseButton(this); 160 close_button_ = new TabCloseButton(this);
161 ui::ResourceBundle& rb = ui::ResourceBundle::GetSharedInstance(); 161 ui::ResourceBundle& rb = ui::ResourceBundle::GetSharedInstance();
162 close_button_->SetImage(views::CustomButton::BS_NORMAL, 162 close_button_->SetImage(views::CustomButton::BS_NORMAL,
163 rb.GetBitmapNamed(IDR_TAB_CLOSE)); 163 rb.GetImageSkiaNamed(IDR_TAB_CLOSE));
164 close_button_->SetImage(views::CustomButton::BS_HOT, 164 close_button_->SetImage(views::CustomButton::BS_HOT,
165 rb.GetBitmapNamed(IDR_TAB_CLOSE_H)); 165 rb.GetImageSkiaNamed(IDR_TAB_CLOSE_H));
166 close_button_->SetImage(views::CustomButton::BS_PUSHED, 166 close_button_->SetImage(views::CustomButton::BS_PUSHED,
167 rb.GetBitmapNamed(IDR_TAB_CLOSE_P)); 167 rb.GetImageSkiaNamed(IDR_TAB_CLOSE_P));
168 close_button_->SetAccessibleName( 168 close_button_->SetAccessibleName(
169 l10n_util::GetStringUTF16(IDS_ACCNAME_CLOSE)); 169 l10n_util::GetStringUTF16(IDS_ACCNAME_CLOSE));
170 // Disable animation so that the red danger sign shows up immediately 170 // Disable animation so that the red danger sign shows up immediately
171 // to help avoid mis-clicks. 171 // to help avoid mis-clicks.
172 close_button_->SetAnimationDuration(0); 172 close_button_->SetAnimationDuration(0);
173 AddChildView(close_button_); 173 AddChildView(close_button_);
174 174
175 set_context_menu_controller(this); 175 set_context_menu_controller(this);
176 } 176 }
177 177
(...skipping 395 matching lines...) Expand 10 before | Expand all | Expand 10 after
573 // static 573 // static
574 void BaseTab::InitResources() { 574 void BaseTab::InitResources() {
575 static bool initialized = false; 575 static bool initialized = false;
576 if (!initialized) { 576 if (!initialized) {
577 initialized = true; 577 initialized = true;
578 ui::ResourceBundle& rb = ui::ResourceBundle::GetSharedInstance(); 578 ui::ResourceBundle& rb = ui::ResourceBundle::GetSharedInstance();
579 font_ = new gfx::Font(rb.GetFont(ui::ResourceBundle::BaseFont)); 579 font_ = new gfx::Font(rb.GetFont(ui::ResourceBundle::BaseFont));
580 font_height_ = font_->GetHeight(); 580 font_height_ = font_->GetHeight();
581 } 581 }
582 } 582 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698