Minor fixes to BubbleBorder2 and LauncherTooltipManager:

1. Reset the background of the tooltip frame view or it paints behind the
BubbleBorder2 and makes it look blurry.
2. LauncherTooltip bubbles should not consume mouse hovers.
3. BubbleBorder2::GetBorderThickness should return the actual thickness.

BUG=none
TEST=none


Review URL: https://chromiumcodereview.appspot.com/10828266

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@151161 0039d316-1c4b-4281-b951-d872f2087c98
parent 3aa8a682
...@@ -96,6 +96,7 @@ LauncherTooltipManager::LauncherTooltipBubble::LauncherTooltipBubble( ...@@ -96,6 +96,7 @@ LauncherTooltipManager::LauncherTooltipBubble::LauncherTooltipBubble(
set_close_on_esc(false); set_close_on_esc(false);
set_close_on_deactivate(false); set_close_on_deactivate(false);
set_use_focusless(true); set_use_focusless(true);
set_accept_events(false);
set_margins(gfx::Insets(kTooltipTopBottomMargin, kTooltipLeftRightMargin, set_margins(gfx::Insets(kTooltipTopBottomMargin, kTooltipLeftRightMargin,
kTooltipTopBottomMargin, kTooltipLeftRightMargin)); kTooltipTopBottomMargin, kTooltipLeftRightMargin));
SetLayoutManager(new views::FillLayout()); SetLayoutManager(new views::FillLayout());
...@@ -120,6 +121,9 @@ LauncherTooltipManager::LauncherTooltipBubble::LauncherTooltipBubble( ...@@ -120,6 +121,9 @@ LauncherTooltipManager::LauncherTooltipBubble::LauncherTooltipBubble(
set_anchor_insets(gfx::Insets(kArrowOffset, kArrowOffset, kArrowOffset, set_anchor_insets(gfx::Insets(kArrowOffset, kArrowOffset, kArrowOffset,
kArrowOffset)); kArrowOffset));
GetBubbleFrameView()->SetBubbleBorder(bubble_border_); GetBubbleFrameView()->SetBubbleBorder(bubble_border_);
// BubbleBorder2 paints its own background.
GetBubbleFrameView()->set_background(NULL);
} }
void LauncherTooltipManager::LauncherTooltipBubble::SetText( void LauncherTooltipManager::LauncherTooltipBubble::SetText(
......
...@@ -192,7 +192,7 @@ void BubbleBorder2::SetShadow(gfx::ShadowValue shadow) { ...@@ -192,7 +192,7 @@ void BubbleBorder2::SetShadow(gfx::ShadowValue shadow) {
} }
int BubbleBorder2::GetBorderThickness() const { int BubbleBorder2::GetBorderThickness() const {
return 0; return border_size_;
} }
void BubbleBorder2::PaintBackground(gfx::Canvas* canvas, void BubbleBorder2::PaintBackground(gfx::Canvas* canvas,
......
...@@ -26,6 +26,7 @@ Widget* CreateBubbleWidget(BubbleDelegateView* bubble) { ...@@ -26,6 +26,7 @@ Widget* CreateBubbleWidget(BubbleDelegateView* bubble) {
Widget::InitParams bubble_params(Widget::InitParams::TYPE_BUBBLE); Widget::InitParams bubble_params(Widget::InitParams::TYPE_BUBBLE);
bubble_params.delegate = bubble; bubble_params.delegate = bubble;
bubble_params.transparent = true; bubble_params.transparent = true;
bubble_params.accept_events = bubble->accept_events();
if (bubble->parent_window()) if (bubble->parent_window())
bubble_params.parent = bubble->parent_window(); bubble_params.parent = bubble->parent_window();
else else
...@@ -115,6 +116,7 @@ BubbleDelegateView::BubbleDelegateView() ...@@ -115,6 +116,7 @@ BubbleDelegateView::BubbleDelegateView()
original_opacity_(255), original_opacity_(255),
border_widget_(NULL), border_widget_(NULL),
use_focusless_(false), use_focusless_(false),
accept_events_(true),
try_mirroring_arrow_(true), try_mirroring_arrow_(true),
parent_window_(NULL) { parent_window_(NULL) {
set_background(Background::CreateSolidBackground(color_)); set_background(Background::CreateSolidBackground(color_));
...@@ -135,6 +137,7 @@ BubbleDelegateView::BubbleDelegateView( ...@@ -135,6 +137,7 @@ BubbleDelegateView::BubbleDelegateView(
original_opacity_(255), original_opacity_(255),
border_widget_(NULL), border_widget_(NULL),
use_focusless_(false), use_focusless_(false),
accept_events_(true),
try_mirroring_arrow_(true), try_mirroring_arrow_(true),
parent_window_(NULL) { parent_window_(NULL) {
set_background(Background::CreateSolidBackground(color_)); set_background(Background::CreateSolidBackground(color_));
......
...@@ -83,6 +83,9 @@ class VIEWS_EXPORT BubbleDelegateView : public WidgetDelegateView, ...@@ -83,6 +83,9 @@ class VIEWS_EXPORT BubbleDelegateView : public WidgetDelegateView,
use_focusless_ = use_focusless; use_focusless_ = use_focusless;
} }
bool accept_events() const { return accept_events_; }
void set_accept_events(bool accept_events) { accept_events_ = accept_events; }
bool try_mirroring_arrow() const { return try_mirroring_arrow_; } bool try_mirroring_arrow() const { return try_mirroring_arrow_; }
void set_try_mirroring_arrow(bool try_mirroring_arrow) { void set_try_mirroring_arrow(bool try_mirroring_arrow) {
try_mirroring_arrow_ = try_mirroring_arrow; try_mirroring_arrow_ = try_mirroring_arrow;
...@@ -178,6 +181,9 @@ class VIEWS_EXPORT BubbleDelegateView : public WidgetDelegateView, ...@@ -178,6 +181,9 @@ class VIEWS_EXPORT BubbleDelegateView : public WidgetDelegateView,
// These bubbles are not interactive and should not gain focus. // These bubbles are not interactive and should not gain focus.
bool use_focusless_; bool use_focusless_;
// Specifies whether the popup accepts events or lets them pass through.
bool accept_events_;
// If true (defaults to true), the arrow may be mirrored to fit the // If true (defaults to true), the arrow may be mirrored to fit the
// bubble on screen better. // bubble on screen better.
bool try_mirroring_arrow_; bool try_mirroring_arrow_;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment