summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorderat@chromium.org <derat@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-09-30 22:04:00 +0000
committerderat@chromium.org <derat@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-09-30 22:04:00 +0000
commita238914adf9fdf42982012bff44513fa5494d4f4 (patch)
tree20a9b4332ed840c0336f27a4b7d1361a99dc0ca0
parent699fe7e6a2d195269c1ac58180f79a975b366a6e (diff)
downloadchromium_src-a238914adf9fdf42982012bff44513fa5494d4f4.zip
chromium_src-a238914adf9fdf42982012bff44513fa5494d4f4.tar.gz
chromium_src-a238914adf9fdf42982012bff44513fa5494d4f4.tar.bz2
chromeos: Remove border around dialogs and use RGB.
This gets rid of the one-pixel-wide, dark gray border around the not-really-a-bubble-anymore BubbleWindow frame used for Chrome OS dialogs. It also makes the windows be RGB instead of RGBA to let the window manager know that it's safe to draw a shadow around them. BUG=chromium-os:20997 TEST=manual: checked that dialogs get shadows (in conjunction with http://gerrit.chromium.org/gerrit/8538) Review URL: http://codereview.chromium.org/8085019 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@103557 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r--chrome/browser/chromeos/frame/bubble_frame_view.cc27
-rw-r--r--chrome/browser/chromeos/frame/bubble_window.cc2
2 files changed, 6 insertions, 23 deletions
diff --git a/chrome/browser/chromeos/frame/bubble_frame_view.cc b/chrome/browser/chromeos/frame/bubble_frame_view.cc
index fd5f0ed..e864b80 100644
--- a/chrome/browser/chromeos/frame/bubble_frame_view.cc
+++ b/chrome/browser/chromeos/frame/bubble_frame_view.cc
@@ -15,7 +15,6 @@
#include "ui/gfx/insets.h"
#include "ui/gfx/path.h"
#include "ui/gfx/rect.h"
-#include "views/border.h"
#include "views/controls/button/image_button.h"
#include "views/controls/label.h"
#include "views/controls/throbber.h"
@@ -31,9 +30,6 @@ static const int kTitleTopPadding = 10;
static const int kTitleContentPadding = 10;
static const int kHorizontalPadding = 10;
-const int kBorderThickness = 1;
-const SkColor kBorderColor = SK_ColorDKGRAY;
-
// Title font size correction.
#if defined(CROS_FONTS_USING_BCI)
static const int kTitleFontSizeDelta = 0;
@@ -53,8 +49,6 @@ BubbleFrameView::BubbleFrameView(views::Widget* frame,
title_(NULL),
close_button_(NULL),
throbber_(NULL) {
- set_border(views::Border::CreateSolidBorder(kBorderThickness, kBorderColor));
-
if (widget_delegate->ShouldShowWindowTitle()) {
title_ = new views::Label(
UTF16ToWideHack(widget_delegate->GetWindowTitle()));
@@ -150,17 +144,12 @@ void BubbleFrameView::UpdateWindowIcon() {
}
gfx::Insets BubbleFrameView::GetInsets() const {
- gfx::Insets insets;
- border()->GetInsets(&insets);
-
- if (!(style_ & STYLE_FLUSH)) {
- gfx::Insets padding(kTitleTopPadding,
- kHorizontalPadding,
- 0,
- kHorizontalPadding);
- insets += padding;
- }
- return insets;
+ return (style_ & STYLE_FLUSH) ?
+ gfx::Insets() :
+ gfx::Insets(kTitleTopPadding,
+ kHorizontalPadding,
+ 0,
+ kHorizontalPadding);
}
gfx::Size BubbleFrameView::GetPreferredSize() {
@@ -217,8 +206,6 @@ void BubbleFrameView::Layout() {
}
void BubbleFrameView::OnPaint(gfx::Canvas* canvas) {
- // The border of this view creates a rectangular region for the
- // contents, which we need to fill with the background color.
SkPaint paint;
paint.setStyle(SkPaint::kFill_Style);
paint.setColor(kBubbleWindowBackgroundColor);
@@ -229,8 +216,6 @@ void BubbleFrameView::OnPaint(gfx::Canvas* canvas) {
SkIntToScalar(bounds.right()), SkIntToScalar(bounds.bottom()));
path.addRect(rect);
canvas->AsCanvasSkia()->drawPath(path, paint);
-
- OnPaintBorder(canvas);
}
void BubbleFrameView::ButtonPressed(views::Button* sender,
diff --git a/chrome/browser/chromeos/frame/bubble_window.cc b/chrome/browser/chromeos/frame/bubble_window.cc
index 070a7b9..a7dce37 100644
--- a/chrome/browser/chromeos/frame/bubble_window.cc
+++ b/chrome/browser/chromeos/frame/bubble_window.cc
@@ -69,7 +69,6 @@ views::Widget* BubbleWindow::Create(
params.delegate = widget_delegate;
params.parent = GTK_WIDGET(parent);
params.bounds = gfx::Rect();
- params.transparent = true;
window->Init(params);
window->SetBackgroundColor();
return window;
@@ -82,7 +81,6 @@ views::Widget* BubbleWindow::Create(
params.native_widget = bubble_window;
params.parent = GTK_WIDGET(parent);
params.bounds = gfx::Rect();
- params.transparent = true;
window->Init(params);
return window;