| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/touch/tabs/touch_tab.h" | 5 #include "chrome/browser/ui/touch/tabs/touch_tab.h" |
| 6 | 6 |
| 7 #include "chrome/browser/themes/browser_theme_provider.h" | 7 #include "chrome/browser/themes/browser_theme_provider.h" |
| 8 #include "grit/app_resources.h" | 8 #include "grit/app_resources.h" |
| 9 #include "grit/theme_resources.h" | 9 #include "grit/theme_resources.h" |
| 10 #include "ui/base/resource/resource_bundle.h" | 10 #include "ui/base/resource/resource_bundle.h" |
| (...skipping 154 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 165 int x = favicon_bounds_.x(); | 165 int x = favicon_bounds_.x(); |
| 166 int y = favicon_bounds_.y(); | 166 int y = favicon_bounds_.y(); |
| 167 | 167 |
| 168 TouchTabImage* tab_image = &tab_active; | 168 TouchTabImage* tab_image = &tab_active; |
| 169 int x_base = tab_image->image_l->width(); | 169 int x_base = tab_image->image_l->width(); |
| 170 | 170 |
| 171 x += x_base; | 171 x += x_base; |
| 172 | 172 |
| 173 if (base::i18n::IsRTL()) { | 173 if (base::i18n::IsRTL()) { |
| 174 x = width() - x - | 174 x = width() - x - |
| 175 (data().favicon.isNull() ? kFavIconSize : data().favicon.width()); | 175 (data().favicon.isNull() ? kFaviconSize : data().favicon.width()); |
| 176 } | 176 } |
| 177 | 177 |
| 178 int favicon_x = x; | 178 int favicon_x = x; |
| 179 if (!data().favicon.isNull() && data().favicon.width() != kFavIconSize) | 179 if (!data().favicon.isNull() && data().favicon.width() != kFaviconSize) |
| 180 favicon_x += (data().favicon.width() - kFavIconSize) / 2; | 180 favicon_x += (data().favicon.width() - kFaviconSize) / 2; |
| 181 | 181 |
| 182 if (data().network_state != TabRendererData::NETWORK_STATE_NONE) { | 182 if (data().network_state != TabRendererData::NETWORK_STATE_NONE) { |
| 183 ThemeProvider* tp = GetThemeProvider(); | 183 ThemeProvider* tp = GetThemeProvider(); |
| 184 SkBitmap frames(*tp->GetBitmapNamed( | 184 SkBitmap frames(*tp->GetBitmapNamed( |
| 185 (data().network_state == TabRendererData::NETWORK_STATE_WAITING) ? | 185 (data().network_state == TabRendererData::NETWORK_STATE_WAITING) ? |
| 186 IDR_THROBBER_WAITING : IDR_THROBBER)); | 186 IDR_THROBBER_WAITING : IDR_THROBBER)); |
| 187 int image_size = frames.height(); | 187 int image_size = frames.height(); |
| 188 int image_offset = loading_animation_frame() * image_size; | 188 int image_offset = loading_animation_frame() * image_size; |
| 189 canvas->DrawBitmapInt(frames, image_offset, 0, image_size, image_size, x, y, | 189 canvas->DrawBitmapInt(frames, image_offset, 0, image_size, image_size, x, y, |
| 190 kTouchFaviconSize, kTouchFaviconSize, false); | 190 kTouchFaviconSize, kTouchFaviconSize, false); |
| (...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 235 tab_active.image_r = rb.GetBitmapNamed(IDR_TAB_ACTIVE_RIGHT); | 235 tab_active.image_r = rb.GetBitmapNamed(IDR_TAB_ACTIVE_RIGHT); |
| 236 tab_active.l_width = tab_active.image_l->width(); | 236 tab_active.l_width = tab_active.image_l->width(); |
| 237 tab_active.r_width = tab_active.image_r->width(); | 237 tab_active.r_width = tab_active.image_r->width(); |
| 238 | 238 |
| 239 tab_inactive.image_l = rb.GetBitmapNamed(IDR_TAB_INACTIVE_LEFT); | 239 tab_inactive.image_l = rb.GetBitmapNamed(IDR_TAB_INACTIVE_LEFT); |
| 240 tab_inactive.image_c = rb.GetBitmapNamed(IDR_TAB_INACTIVE_CENTER); | 240 tab_inactive.image_c = rb.GetBitmapNamed(IDR_TAB_INACTIVE_CENTER); |
| 241 tab_inactive.image_r = rb.GetBitmapNamed(IDR_TAB_INACTIVE_RIGHT); | 241 tab_inactive.image_r = rb.GetBitmapNamed(IDR_TAB_INACTIVE_RIGHT); |
| 242 tab_inactive.l_width = tab_inactive.image_l->width(); | 242 tab_inactive.l_width = tab_inactive.image_l->width(); |
| 243 tab_inactive.r_width = tab_inactive.image_r->width(); | 243 tab_inactive.r_width = tab_inactive.image_r->width(); |
| 244 } | 244 } |
| OLD | NEW |