| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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/views/tabs/tab_renderer.h" | 5 #include "chrome/browser/views/tabs/tab_renderer.h" |
| 6 | 6 |
| 7 #include <limits> | 7 #include <limits> |
| 8 | 8 |
| 9 #include "app/animation_container.h" | 9 #include "app/animation_container.h" |
| 10 #include "app/l10n_util.h" | 10 #include "app/l10n_util.h" |
| (...skipping 305 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 316 if (data_.phantom != phantom || !loading_only) { | 316 if (data_.phantom != phantom || !loading_only) { |
| 317 data_.title = contents->GetTitle(); | 317 data_.title = contents->GetTitle(); |
| 318 data_.off_the_record = contents->profile()->IsOffTheRecord(); | 318 data_.off_the_record = contents->profile()->IsOffTheRecord(); |
| 319 data_.crashed = contents->is_crashed(); | 319 data_.crashed = contents->is_crashed(); |
| 320 SkBitmap app_icon = contents->app_extension_icon(); | 320 SkBitmap app_icon = contents->app_extension_icon(); |
| 321 if (!app_icon.empty()) | 321 if (!app_icon.empty()) |
| 322 data_.favicon = app_icon; | 322 data_.favicon = app_icon; |
| 323 else | 323 else |
| 324 data_.favicon = contents->GetFavIcon(); | 324 data_.favicon = contents->GetFavIcon(); |
| 325 data_.phantom = phantom; | 325 data_.phantom = phantom; |
| 326 data_.app = contents->is_app(); |
| 326 | 327 |
| 327 // Sets the accessible name for the tab. | 328 // Sets the accessible name for the tab. |
| 328 SetAccessibleName(UTF16ToWide(data_.title)); | 329 SetAccessibleName(UTF16ToWide(data_.title)); |
| 329 } | 330 } |
| 330 | 331 |
| 331 // TODO(glen): Temporary hax. | 332 // TODO(glen): Temporary hax. |
| 332 theme_provider_ = contents->profile()->GetThemeProvider(); | 333 theme_provider_ = contents->profile()->GetThemeProvider(); |
| 333 | 334 |
| 334 // Loading state also involves whether we show the favicon, since that's where | 335 // Loading state also involves whether we show the favicon, since that's where |
| 335 // we display the throbber. | 336 // we display the throbber. |
| (...skipping 635 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 971 | 972 |
| 972 tab_alpha_nano.image_l = rb.GetBitmapNamed(IDR_TAB_ALPHA_NANO_LEFT); | 973 tab_alpha_nano.image_l = rb.GetBitmapNamed(IDR_TAB_ALPHA_NANO_LEFT); |
| 973 tab_alpha_nano.image_r = rb.GetBitmapNamed(IDR_TAB_ALPHA_NANO_RIGHT); | 974 tab_alpha_nano.image_r = rb.GetBitmapNamed(IDR_TAB_ALPHA_NANO_RIGHT); |
| 974 | 975 |
| 975 tab_active.image_l = rb.GetBitmapNamed(IDR_TAB_ACTIVE_LEFT); | 976 tab_active.image_l = rb.GetBitmapNamed(IDR_TAB_ACTIVE_LEFT); |
| 976 tab_active.image_c = rb.GetBitmapNamed(IDR_TAB_ACTIVE_CENTER); | 977 tab_active.image_c = rb.GetBitmapNamed(IDR_TAB_ACTIVE_CENTER); |
| 977 tab_active.image_r = rb.GetBitmapNamed(IDR_TAB_ACTIVE_RIGHT); | 978 tab_active.image_r = rb.GetBitmapNamed(IDR_TAB_ACTIVE_RIGHT); |
| 978 tab_active.l_width = tab_active.image_l->width(); | 979 tab_active.l_width = tab_active.image_l->width(); |
| 979 tab_active.r_width = tab_active.image_r->width(); | 980 tab_active.r_width = tab_active.image_r->width(); |
| 980 | 981 |
| 981 // This is high much taller *visually* the regular tab is compared to the | 982 // The regular tab is high much taller *visually* than the nano tabs. |
| 982 // nano tabs. The images are the same height, this is really just the | 983 // The images are the same height, this is really just the difference |
| 983 // difference in whitespace above the tab image. | 984 // in whitespace above the tab image (regular vs nano). |
| 984 const int kMiniTabDiffHeight = 14; | 985 const int kMiniTabDiffHeight = 14; |
| 985 | 986 |
| 986 tab_active_nano.image_l = rb.GetBitmapNamed(IDR_TAB_ACTIVE_NANO_LEFT); | 987 tab_active_nano.image_l = rb.GetBitmapNamed(IDR_TAB_ACTIVE_NANO_LEFT); |
| 987 tab_active_nano.image_c = rb.GetBitmapNamed(IDR_TAB_ACTIVE_NANO_CENTER); | 988 tab_active_nano.image_c = rb.GetBitmapNamed(IDR_TAB_ACTIVE_NANO_CENTER); |
| 988 tab_active_nano.image_r = rb.GetBitmapNamed(IDR_TAB_ACTIVE_NANO_RIGHT); | 989 tab_active_nano.image_r = rb.GetBitmapNamed(IDR_TAB_ACTIVE_NANO_RIGHT); |
| 989 tab_active_nano.l_width = tab_active_nano.image_l->width(); | 990 tab_active_nano.l_width = tab_active_nano.image_l->width(); |
| 990 tab_active_nano.r_width = tab_active_nano.image_r->width(); | 991 tab_active_nano.r_width = tab_active_nano.image_r->width(); |
| 991 tab_active_nano.y_offset = kMiniTabDiffHeight; | 992 tab_active_nano.y_offset = kMiniTabDiffHeight; |
| 992 | 993 |
| 993 tab_inactive.image_l = rb.GetBitmapNamed(IDR_TAB_INACTIVE_LEFT); | 994 tab_inactive.image_l = rb.GetBitmapNamed(IDR_TAB_INACTIVE_LEFT); |
| (...skipping 11 matching lines...) Expand all Loading... |
| 1005 | 1006 |
| 1006 void TabRenderer::SetBlocked(bool blocked) { | 1007 void TabRenderer::SetBlocked(bool blocked) { |
| 1007 if (data_.blocked == blocked) | 1008 if (data_.blocked == blocked) |
| 1008 return; | 1009 return; |
| 1009 data_.blocked = blocked; | 1010 data_.blocked = blocked; |
| 1010 if (blocked) | 1011 if (blocked) |
| 1011 StartPulse(); | 1012 StartPulse(); |
| 1012 else | 1013 else |
| 1013 StopPulse(); | 1014 StopPulse(); |
| 1014 } | 1015 } |
| OLD | NEW |