summaryrefslogtreecommitdiffstats
path: root/chrome/browser/tab_contents
diff options
context:
space:
mode:
authorsail@chromium.org <sail@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-06-07 21:14:03 +0000
committersail@chromium.org <sail@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-06-07 21:14:03 +0000
commitc3217be503d6aeb920dc55f7c9a3f731ac63e3bd (patch)
treee5bbb3bad6e7abb6e14f98322f38c712ec4dbb1b /chrome/browser/tab_contents
parentcd2920af211d2ba926381c80b853a2e1d3eef3bc (diff)
downloadchromium_src-c3217be503d6aeb920dc55f7c9a3f731ac63e3bd.zip
chromium_src-c3217be503d6aeb920dc55f7c9a3f731ac63e3bd.tar.gz
chromium_src-c3217be503d6aeb920dc55f7c9a3f731ac63e3bd.tar.bz2
Make infobar background gray
Currently page action infobars are blue on Windows and Linux and yellow on Mac. This change makes it gray on all platforms. Screenshots: http://www.dropmocks.com/mVNOW Also see this CL: http://codereview.chromium.org/7031069/ BUG=80432 TEST=Ran on Mac and Linux. Windows pending. Review URL: http://codereview.chromium.org/7130001 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@88205 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/tab_contents')
-rw-r--r--chrome/browser/tab_contents/infobar.cc29
-rw-r--r--chrome/browser/tab_contents/infobar.h16
2 files changed, 37 insertions, 8 deletions
diff --git a/chrome/browser/tab_contents/infobar.cc b/chrome/browser/tab_contents/infobar.cc
index 540fffd..0a55bc5 100644
--- a/chrome/browser/tab_contents/infobar.cc
+++ b/chrome/browser/tab_contents/infobar.cc
@@ -2,17 +2,40 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#if defined(TOOLKIT_VIEWS) // TODO(pkasting): Port non-views to use this.
-
#include "chrome/browser/tab_contents/infobar.h"
#include <cmath>
#include "base/logging.h"
#include "chrome/browser/tab_contents/infobar_container.h"
-#include "chrome/browser/tab_contents/infobar_delegate.h"
#include "ui/base/animation/slide_animation.h"
+SkColor GetInfoBarTopColor(InfoBarDelegate::Type infobar_type) {
+ // Yellow
+ static const SkColor kWarningBackgroundColorTop =
+ SkColorSetRGB(255, 242, 183);
+ // Gray
+ static const SkColor kPageActionBackgroundColorTop =
+ SkColorSetRGB(237, 237, 237);
+
+ return (infobar_type == InfoBarDelegate::WARNING_TYPE) ?
+ kWarningBackgroundColorTop : kPageActionBackgroundColorTop;
+}
+
+SkColor GetInfoBarBottomColor(InfoBarDelegate::Type infobar_type) {
+ // Yellow
+ static const SkColor kWarningBackgroundColorBottom =
+ SkColorSetRGB(250, 230, 145);
+ // Gray
+ static const SkColor kPageActionBackgroundColorBottom =
+ SkColorSetRGB(217, 217, 217);
+
+ return (infobar_type == InfoBarDelegate::WARNING_TYPE) ?
+ kWarningBackgroundColorBottom : kPageActionBackgroundColorBottom;
+}
+
+#if defined(TOOLKIT_VIEWS) // TODO(pkasting): Port non-views to use this.
+
InfoBar::InfoBar(TabContentsWrapper* owner, InfoBarDelegate* delegate)
: owner_(owner),
delegate_(delegate),
diff --git a/chrome/browser/tab_contents/infobar.h b/chrome/browser/tab_contents/infobar.h
index 874da69..53d270c9 100644
--- a/chrome/browser/tab_contents/infobar.h
+++ b/chrome/browser/tab_contents/infobar.h
@@ -2,19 +2,25 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#if defined(TOOLKIT_VIEWS) // TODO(pkasting): Port non-views to use this.
-
#ifndef CHROME_BROWSER_TAB_CONTENTS_INFOBAR_H_
#define CHROME_BROWSER_TAB_CONTENTS_INFOBAR_H_
#pragma once
#include "base/basictypes.h"
#include "base/scoped_ptr.h"
+#include "chrome/browser/tab_contents/infobar_delegate.h"
+#include "third_party/skia/include/core/SkColor.h"
#include "ui/base/animation/animation_delegate.h"
#include "ui/gfx/size.h"
+// TODO(sail): These functions should be static methods in the InfoBar class
+// below once all platforms use that class.
+SkColor GetInfoBarTopColor(InfoBarDelegate::Type infobar_type);
+SkColor GetInfoBarBottomColor(InfoBarDelegate::Type infobar_type);
+
+#if defined(TOOLKIT_VIEWS) // TODO(pkasting): Port non-views to use this.
+
class InfoBarContainer;
-class InfoBarDelegate;
class TabContentsWrapper;
namespace ui {
@@ -116,10 +122,10 @@ class InfoBar : public ui::AnimationDelegate {
DISALLOW_COPY_AND_ASSIGN(InfoBar);
};
-#endif // CHROME_BROWSER_TAB_CONTENTS_INFOBAR_H_
-
#elif defined(TOOLKIT_USES_GTK)
#include "chrome/browser/ui/gtk/infobars/infobar_gtk.h"
#elif defined(OS_MACOSX)
#include "chrome/browser/ui/cocoa/infobars/infobar.h"
#endif
+
+#endif // CHROME_BROWSER_TAB_CONTENTS_INFOBAR_H_