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 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
98 //////////////////////////////////////////////////////////////////////////////// | 98 //////////////////////////////////////////////////////////////////////////////// |
99 // TouchTab, private: | 99 // TouchTab, private: |
100 | 100 |
101 void TouchTab::PaintTabBackground(gfx::Canvas* canvas) { | 101 void TouchTab::PaintTabBackground(gfx::Canvas* canvas) { |
102 if (IsSelected()) { | 102 if (IsSelected()) { |
103 PaintActiveTabBackground(canvas); | 103 PaintActiveTabBackground(canvas); |
104 } | 104 } |
105 } | 105 } |
106 | 106 |
107 void TouchTab::PaintActiveTabBackground(gfx::Canvas* canvas) { | 107 void TouchTab::PaintActiveTabBackground(gfx::Canvas* canvas) { |
108 int offset = GetX(views::View::APPLY_MIRRORING_TRANSFORMATION) + | 108 int offset = GetMirroredX() + background_offset_.x(); |
109 background_offset_.x(); | |
110 ThemeProvider* tp = GetThemeProvider(); | 109 ThemeProvider* tp = GetThemeProvider(); |
111 if (!tp) | 110 if (!tp) |
112 NOTREACHED() << "Unable to get theme provider"; | 111 NOTREACHED() << "Unable to get theme provider"; |
113 | 112 |
114 SkBitmap* tab_bg = GetThemeProvider()->GetBitmapNamed(IDR_THEME_TOOLBAR); | 113 SkBitmap* tab_bg = GetThemeProvider()->GetBitmapNamed(IDR_THEME_TOOLBAR); |
115 | 114 |
116 TouchTabImage* tab_image = &tab_active; | 115 TouchTabImage* tab_image = &tab_active; |
117 TouchTabImage* alpha = &tab_alpha; | 116 TouchTabImage* alpha = &tab_alpha; |
118 | 117 |
119 // Draw left edge. | 118 // Draw left edge. |
(...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
226 tab_active.image_r = rb.GetBitmapNamed(IDR_TAB_ACTIVE_RIGHT); | 225 tab_active.image_r = rb.GetBitmapNamed(IDR_TAB_ACTIVE_RIGHT); |
227 tab_active.l_width = tab_active.image_l->width(); | 226 tab_active.l_width = tab_active.image_l->width(); |
228 tab_active.r_width = tab_active.image_r->width(); | 227 tab_active.r_width = tab_active.image_r->width(); |
229 | 228 |
230 tab_inactive.image_l = rb.GetBitmapNamed(IDR_TAB_INACTIVE_LEFT); | 229 tab_inactive.image_l = rb.GetBitmapNamed(IDR_TAB_INACTIVE_LEFT); |
231 tab_inactive.image_c = rb.GetBitmapNamed(IDR_TAB_INACTIVE_CENTER); | 230 tab_inactive.image_c = rb.GetBitmapNamed(IDR_TAB_INACTIVE_CENTER); |
232 tab_inactive.image_r = rb.GetBitmapNamed(IDR_TAB_INACTIVE_RIGHT); | 231 tab_inactive.image_r = rb.GetBitmapNamed(IDR_TAB_INACTIVE_RIGHT); |
233 tab_inactive.l_width = tab_inactive.image_l->width(); | 232 tab_inactive.l_width = tab_inactive.image_l->width(); |
234 tab_inactive.r_width = tab_inactive.image_r->width(); | 233 tab_inactive.r_width = tab_inactive.image_r->width(); |
235 } | 234 } |
OLD | NEW |