| 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/gtk/tabs/tab_renderer_gtk.h" | 5 #include "chrome/browser/ui/gtk/tabs/tab_renderer_gtk.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <utility> | 8 #include <utility> |
| 9 | 9 |
| 10 #include "base/utf_string_conversions.h" | 10 #include "base/utf_string_conversions.h" |
| 11 #include "chrome/browser/defaults.h" | 11 #include "chrome/browser/defaults.h" |
| 12 #include "chrome/browser/extensions/extension_tab_helper.h" |
| 12 #include "chrome/browser/profiles/profile.h" | 13 #include "chrome/browser/profiles/profile.h" |
| 13 #include "chrome/browser/ui/browser.h" | 14 #include "chrome/browser/ui/browser.h" |
| 14 #include "chrome/browser/ui/gtk/bookmarks/bookmark_utils_gtk.h" | 15 #include "chrome/browser/ui/gtk/bookmarks/bookmark_utils_gtk.h" |
| 15 #include "chrome/browser/ui/gtk/custom_button.h" | 16 #include "chrome/browser/ui/gtk/custom_button.h" |
| 16 #include "chrome/browser/ui/gtk/gtk_theme_service.h" | 17 #include "chrome/browser/ui/gtk/gtk_theme_service.h" |
| 17 #include "chrome/browser/ui/gtk/gtk_util.h" | 18 #include "chrome/browser/ui/gtk/gtk_util.h" |
| 18 #include "chrome/browser/ui/tab_contents/tab_contents_wrapper.h" | 19 #include "chrome/browser/ui/tab_contents/tab_contents_wrapper.h" |
| 19 #include "content/browser/tab_contents/tab_contents.h" | 20 #include "content/browser/tab_contents/tab_contents.h" |
| 20 #include "content/common/notification_service.h" | 21 #include "content/common/notification_service.h" |
| 21 #include "grit/app_resources.h" | 22 #include "grit/app_resources.h" |
| (...skipping 263 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 285 bool app, | 286 bool app, |
| 286 bool loading_only) { | 287 bool loading_only) { |
| 287 DCHECK(contents); | 288 DCHECK(contents); |
| 288 theme_service_ = GtkThemeService::GetFrom(contents->profile()); | 289 theme_service_ = GtkThemeService::GetFrom(contents->profile()); |
| 289 | 290 |
| 290 if (!loading_only) { | 291 if (!loading_only) { |
| 291 data_.title = contents->GetTitle(); | 292 data_.title = contents->GetTitle(); |
| 292 data_.incognito = contents->profile()->IsOffTheRecord(); | 293 data_.incognito = contents->profile()->IsOffTheRecord(); |
| 293 data_.crashed = contents->is_crashed(); | 294 data_.crashed = contents->is_crashed(); |
| 294 | 295 |
| 295 SkBitmap* app_icon = contents->GetExtensionAppIcon(); | 296 SkBitmap* app_icon = |
| 297 TabContentsWrapper::GetCurrentWrapperForContents(contents)-> |
| 298 extension_tab_helper()->GetExtensionAppIcon(); |
| 296 if (app_icon) | 299 if (app_icon) |
| 297 data_.favicon = *app_icon; | 300 data_.favicon = *app_icon; |
| 298 else | 301 else |
| 299 data_.favicon = contents->GetFavicon(); | 302 data_.favicon = contents->GetFavicon(); |
| 300 | 303 |
| 301 data_.app = app; | 304 data_.app = app; |
| 302 // This is kind of a hacky way to determine whether our icon is the default | 305 // This is kind of a hacky way to determine whether our icon is the default |
| 303 // favicon. But the plumbing that would be necessary to do it right would | 306 // favicon. But the plumbing that would be necessary to do it right would |
| 304 // be a good bit of work and would sully code for other platforms which | 307 // be a good bit of work and would sully code for other platforms which |
| 305 // don't care to custom-theme the favicon. Hopefully the default favicon | 308 // don't care to custom-theme the favicon. Hopefully the default favicon |
| (...skipping 774 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1080 | 1083 |
| 1081 ResourceBundle& rb = ResourceBundle::GetSharedInstance(); | 1084 ResourceBundle& rb = ResourceBundle::GetSharedInstance(); |
| 1082 const gfx::Font& base_font = rb.GetFont(ResourceBundle::BaseFont); | 1085 const gfx::Font& base_font = rb.GetFont(ResourceBundle::BaseFont); |
| 1083 title_font_ = new gfx::Font(base_font.GetFontName(), kFontPixelSize); | 1086 title_font_ = new gfx::Font(base_font.GetFontName(), kFontPixelSize); |
| 1084 title_font_height_ = title_font_->GetHeight(); | 1087 title_font_height_ = title_font_->GetHeight(); |
| 1085 | 1088 |
| 1086 crashed_favicon = rb.GetBitmapNamed(IDR_SAD_FAVICON); | 1089 crashed_favicon = rb.GetBitmapNamed(IDR_SAD_FAVICON); |
| 1087 | 1090 |
| 1088 initialized_ = true; | 1091 initialized_ = true; |
| 1089 } | 1092 } |
| OLD | NEW |