OLD | NEW |
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 Loading... |
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 397 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
575 // static | 575 // static |
576 void BaseTab::InitResources() { | 576 void BaseTab::InitResources() { |
577 static bool initialized = false; | 577 static bool initialized = false; |
578 if (!initialized) { | 578 if (!initialized) { |
579 initialized = true; | 579 initialized = true; |
580 ui::ResourceBundle& rb = ui::ResourceBundle::GetSharedInstance(); | 580 ui::ResourceBundle& rb = ui::ResourceBundle::GetSharedInstance(); |
581 font_ = new gfx::Font(rb.GetFont(ui::ResourceBundle::BaseFont)); | 581 font_ = new gfx::Font(rb.GetFont(ui::ResourceBundle::BaseFont)); |
582 font_height_ = font_->GetHeight(); | 582 font_height_ = font_->GetHeight(); |
583 } | 583 } |
584 } | 584 } |
OLD | NEW |