diff options
author | tfarina@chromium.org <tfarina@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-08-14 16:33:50 +0000 |
---|---|---|
committer | tfarina@chromium.org <tfarina@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-08-14 16:33:50 +0000 |
commit | 96d1ed0c4184d446832d5b04ed4f02994b79ae03 (patch) | |
tree | 7864552190f6beaec44d46d26a617954a2fc2eb9 /chrome | |
parent | 88dc06904f5ebf68d962ac3e5c7a77ca64ac4ec0 (diff) | |
download | chromium_src-96d1ed0c4184d446832d5b04ed4f02994b79ae03.zip chromium_src-96d1ed0c4184d446832d5b04ed4f02994b79ae03.tar.gz chromium_src-96d1ed0c4184d446832d5b04ed4f02994b79ae03.tar.bz2 |
Get rid of the ERROR_TYPE from InfoBarDelegate.
Reason: This type is not really used and is just adding duplicated code.
We are using the same color scheme for both WARNING_TYPE and ERROR_TYPE, so
there is no really reason to both exists. Staing with WARNING_TYPE because
it used more than ERROR_TYPE and looks like it captures the idea better than
ERROR_TYPE.
BUG=39102
TEST=trybots
Review URL: http://codereview.chromium.org/3128007
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@56142 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome')
-rw-r--r-- | chrome/browser/gtk/infobar_gtk.cc | 7 | ||||
-rw-r--r-- | chrome/browser/gtk/translate/translate_infobar_base_gtk.cc | 8 | ||||
-rw-r--r-- | chrome/browser/gtk/translate/translate_infobar_base_gtk.h | 2 | ||||
-rw-r--r-- | chrome/browser/printing/print_dialog_gtk.cc | 4 | ||||
-rw-r--r-- | chrome/browser/tab_contents/infobar_delegate.h | 3 | ||||
-rw-r--r-- | chrome/browser/views/infobars/infobars.cc | 12 | ||||
-rw-r--r-- | chrome/browser/views/infobars/translate_infobar_base.cc | 2 |
7 files changed, 10 insertions, 28 deletions
diff --git a/chrome/browser/gtk/infobar_gtk.cc b/chrome/browser/gtk/infobar_gtk.cc index 46a1ac4..cef8157 100644 --- a/chrome/browser/gtk/infobar_gtk.cc +++ b/chrome/browser/gtk/infobar_gtk.cc @@ -17,11 +17,6 @@ namespace { -const double kBackgroundColorTop[3] = - {255.0 / 255.0, 242.0 / 255.0, 183.0 / 255.0}; -const double kBackgroundColorBottom[3] = - {250.0 / 255.0, 230.0 / 255.0, 145.0 / 255.0}; - // The total height of the info bar. const int kInfoBarHeight = 37; @@ -215,7 +210,6 @@ void InfoBar::GetTopColor(InfoBarDelegate::Type type, // values for cairo. switch (type) { case InfoBarDelegate::WARNING_TYPE: - case InfoBarDelegate::ERROR_TYPE: *r = 255.0 / 255.0; *g = 242.0 / 255.0; *b = 183.0 / 255.0; @@ -232,7 +226,6 @@ void InfoBar::GetBottomColor(InfoBarDelegate::Type type, double* r, double* g, double *b) { switch (type) { case InfoBarDelegate::WARNING_TYPE: - case InfoBarDelegate::ERROR_TYPE: *r = 250.0 / 255.0; *g = 230.0 / 255.0; *b = 145.0 / 255.0; diff --git a/chrome/browser/gtk/translate/translate_infobar_base_gtk.cc b/chrome/browser/gtk/translate/translate_infobar_base_gtk.cc index 43fa44c..e7a94b8 100644 --- a/chrome/browser/gtk/translate/translate_infobar_base_gtk.cc +++ b/chrome/browser/gtk/translate/translate_infobar_base_gtk.cc @@ -73,14 +73,14 @@ void TranslateInfoBarBase::GetTopColor(InfoBarDelegate::Type type, if (background_error_percent_ <= 0) { InfoBar::GetTopColor(InfoBarDelegate::PAGE_ACTION_TYPE, r, g, b); } else if (background_error_percent_ >= 1) { - InfoBar::GetTopColor(InfoBarDelegate::ERROR_TYPE, r, g, b); + InfoBar::GetTopColor(InfoBarDelegate::WARNING_TYPE, r, g, b); } else { double normal_r, normal_g, normal_b; InfoBar::GetTopColor(InfoBarDelegate::PAGE_ACTION_TYPE, &normal_r, &normal_g, &normal_b); double error_r, error_g, error_b; - InfoBar::GetTopColor(InfoBarDelegate::ERROR_TYPE, + InfoBar::GetTopColor(InfoBarDelegate::WARNING_TYPE, &error_r, &error_g, &error_b); double offset_r = error_r - normal_r; @@ -98,14 +98,14 @@ void TranslateInfoBarBase::GetBottomColor(InfoBarDelegate::Type type, if (background_error_percent_ <= 0) { InfoBar::GetBottomColor(InfoBarDelegate::PAGE_ACTION_TYPE, r, g, b); } else if (background_error_percent_ >= 1) { - InfoBar::GetBottomColor(InfoBarDelegate::ERROR_TYPE, r, g, b); + InfoBar::GetBottomColor(InfoBarDelegate::WARNING_TYPE, r, g, b); } else { double normal_r, normal_g, normal_b; InfoBar::GetBottomColor(InfoBarDelegate::PAGE_ACTION_TYPE, &normal_r, &normal_g, &normal_b); double error_r, error_g, error_b; - InfoBar::GetBottomColor(InfoBarDelegate::ERROR_TYPE, + InfoBar::GetBottomColor(InfoBarDelegate::WARNING_TYPE, &error_r, &error_g, &error_b); double offset_r = error_r - normal_r; diff --git a/chrome/browser/gtk/translate/translate_infobar_base_gtk.h b/chrome/browser/gtk/translate/translate_infobar_base_gtk.h index e7f20ee..ce851f9 100644 --- a/chrome/browser/gtk/translate/translate_infobar_base_gtk.h +++ b/chrome/browser/gtk/translate/translate_infobar_base_gtk.h @@ -76,7 +76,7 @@ class TranslateInfoBarBase : public TranslateInfoBarView, // A percentage to average the normal page action background with the error // background. When 0, the infobar background should be pure PAGE_ACTION_TYPE. - // When 1, the infobar background should be pure ERROR_TYPE. + // When 1, the infobar background should be pure WARNING_TYPE. double background_error_percent_; // Changes the color of the background from normal to error color and back. diff --git a/chrome/browser/printing/print_dialog_gtk.cc b/chrome/browser/printing/print_dialog_gtk.cc index 7bf9a39..003cd7d 100644 --- a/chrome/browser/printing/print_dialog_gtk.cc +++ b/chrome/browser/printing/print_dialog_gtk.cc @@ -51,9 +51,7 @@ class PdfUnsupportedInfoBarDelegate : public LinkInfoBarDelegate { return UTF8ToUTF16("here"); } - virtual Type GetInfoBarType() { - return ERROR_TYPE; - } + virtual Type GetInfoBarType() { return WARNING_TYPE; } virtual bool LinkClicked(WindowOpenDisposition disposition) { browser_->OpenURL( diff --git a/chrome/browser/tab_contents/infobar_delegate.h b/chrome/browser/tab_contents/infobar_delegate.h index 33336b8..869eabe 100644 --- a/chrome/browser/tab_contents/infobar_delegate.h +++ b/chrome/browser/tab_contents/infobar_delegate.h @@ -50,8 +50,7 @@ class InfoBarDelegate { // color. enum Type { WARNING_TYPE, - ERROR_TYPE, - PAGE_ACTION_TYPE + PAGE_ACTION_TYPE, }; // Returns true if the supplied |delegate| is equal to this one. Equality is diff --git a/chrome/browser/views/infobars/infobars.cc b/chrome/browser/views/infobars/infobars.cc index a9e1688..58a4db6 100644 --- a/chrome/browser/views/infobars/infobars.cc +++ b/chrome/browser/views/infobars/infobars.cc @@ -38,10 +38,6 @@ static const SkColor kWarningBackgroundColorTop = SkColorSetRGB(255, 242, 183); static const SkColor kWarningBackgroundColorBottom = SkColorSetRGB(250, 230, 145); -static const SkColor kErrorBackgroundColorTop = kWarningBackgroundColorTop; -static const SkColor kErrorBackgroundColorBottom = - kWarningBackgroundColorBottom; - static const SkColor kPageActionBackgroundColorTop = SkColorSetRGB(218, 231, 249); static const SkColor kPageActionBackgroundColorBottom = @@ -56,9 +52,8 @@ InfoBarBackground::InfoBarBackground(InfoBarDelegate::Type infobar_type) { SkColor bottom_color; switch (infobar_type) { case InfoBarDelegate::WARNING_TYPE: - case InfoBarDelegate::ERROR_TYPE: - top_color = kErrorBackgroundColorTop; - bottom_color = kErrorBackgroundColorBottom; + top_color = kWarningBackgroundColorTop; + bottom_color = kWarningBackgroundColorBottom; break; case InfoBarDelegate::PAGE_ACTION_TYPE: top_color = kPageActionBackgroundColorTop; @@ -102,9 +97,6 @@ InfoBar::InfoBar(InfoBarDelegate* delegate) case InfoBarDelegate::WARNING_TYPE: SetAccessibleName(l10n_util::GetString(IDS_ACCNAME_INFOBAR_WARNING)); break; - case InfoBarDelegate::ERROR_TYPE: - SetAccessibleName(l10n_util::GetString(IDS_ACCNAME_INFOBAR_ERROR)); - break; case InfoBarDelegate::PAGE_ACTION_TYPE: SetAccessibleName(l10n_util::GetString(IDS_ACCNAME_INFOBAR_PAGE_ACTION)); break; diff --git a/chrome/browser/views/infobars/translate_infobar_base.cc b/chrome/browser/views/infobars/translate_infobar_base.cc index 50c7120..4eb0bdd 100644 --- a/chrome/browser/views/infobars/translate_infobar_base.cc +++ b/chrome/browser/views/infobars/translate_infobar_base.cc @@ -21,7 +21,7 @@ TranslateInfoBarBase::TranslateInfoBarBase( TranslateInfoBarDelegate* delegate) : InfoBar(delegate), normal_background_(InfoBarDelegate::PAGE_ACTION_TYPE), - error_background_(InfoBarDelegate::ERROR_TYPE) { + error_background_(InfoBarDelegate::WARNING_TYPE) { icon_ = new views::ImageView; SkBitmap* image = delegate->GetIcon(); if (image) |