| Index: chrome/browser/ui/gtk/infobars/infobar_gtk.cc
|
| ===================================================================
|
| --- chrome/browser/ui/gtk/infobars/infobar_gtk.cc (revision 238220)
|
| +++ chrome/browser/ui/gtk/infobars/infobar_gtk.cc (working copy)
|
| @@ -52,8 +52,8 @@
|
| // static
|
| const int InfoBarGtk::kEndOfLabelSpacing = 6;
|
|
|
| -InfoBarGtk::InfoBarGtk(InfoBarService* owner, InfoBarDelegate* delegate)
|
| - : InfoBar(owner, delegate),
|
| +InfoBarGtk::InfoBarGtk(scoped_ptr<InfoBarDelegate> delegate)
|
| + : InfoBar(delegate.Pass()),
|
| bg_box_(NULL),
|
| hbox_(NULL),
|
| theme_service_(NULL),
|
| @@ -63,7 +63,32 @@
|
| InfoBarGtk::~InfoBarGtk() {
|
| }
|
|
|
| -void InfoBarGtk::InitWidgets() {
|
| +GdkColor InfoBarGtk::GetBorderColor() const {
|
| + DCHECK(theme_service_);
|
| + return theme_service_->GetBorderColor();
|
| +}
|
| +
|
| +int InfoBarGtk::AnimatingHeight() const {
|
| + return animation().is_animating() ? bar_target_height() : 0;
|
| +}
|
| +
|
| +SkColor InfoBarGtk::ConvertGetColor(ColorGetter getter) {
|
| + double r, g, b;
|
| + (this->*getter)(delegate()->GetInfoBarType(), &r, &g, &b);
|
| + return SkColorSetARGB(255, 255 * r, 255 * g, 255 * b);
|
| +}
|
| +
|
| +void InfoBarGtk::GetTopColor(InfoBarDelegate::Type type,
|
| + double* r, double* g, double* b) {
|
| + GetBackgroundColor(InfoBar::GetTopColor(type), r, g, b);
|
| +}
|
| +
|
| +void InfoBarGtk::GetBottomColor(InfoBarDelegate::Type type,
|
| + double* r, double* g, double* b) {
|
| + GetBackgroundColor(InfoBar::GetBottomColor(type), r, g, b);
|
| +}
|
| +
|
| +void InfoBarGtk::PlatformSpecificSetOwner() {
|
| DCHECK(owner());
|
| DCHECK(!theme_service_);
|
| theme_service_ = GtkThemeService::GetFrom(Profile::FromBrowserContext(
|
| @@ -114,31 +139,6 @@
|
| UpdateBorderColor();
|
| }
|
|
|
| -GdkColor InfoBarGtk::GetBorderColor() const {
|
| - DCHECK(theme_service_);
|
| - return theme_service_->GetBorderColor();
|
| -}
|
| -
|
| -int InfoBarGtk::AnimatingHeight() const {
|
| - return animation().is_animating() ? bar_target_height() : 0;
|
| -}
|
| -
|
| -SkColor InfoBarGtk::ConvertGetColor(ColorGetter getter) {
|
| - double r, g, b;
|
| - (this->*getter)(delegate()->GetInfoBarType(), &r, &g, &b);
|
| - return SkColorSetARGB(255, 255 * r, 255 * g, 255 * b);
|
| -}
|
| -
|
| -void InfoBarGtk::GetTopColor(InfoBarDelegate::Type type,
|
| - double* r, double* g, double* b) {
|
| - GetBackgroundColor(InfoBar::GetTopColor(type), r, g, b);
|
| -}
|
| -
|
| -void InfoBarGtk::GetBottomColor(InfoBarDelegate::Type type,
|
| - double* r, double* g, double* b) {
|
| - GetBackgroundColor(InfoBar::GetBottomColor(type), r, g, b);
|
| -}
|
| -
|
| void InfoBarGtk::PlatformSpecificShow(bool animate) {
|
| DCHECK(bg_box_);
|
|
|
| @@ -274,7 +274,7 @@
|
| void InfoBarGtk::OnCloseButton(GtkWidget* button) {
|
| // If we're not owned, we're already closing, so don't call
|
| // InfoBarDismissed(), since this can lead to us double-recording dismissals.
|
| - if (delegate() && owner())
|
| + if (owner())
|
| delegate()->InfoBarDismissed();
|
| RemoveSelf();
|
| }
|
|
|