Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(175)

Unified Diff: ui/views/bubble/bubble_delegate.cc

Issue 15329005: Adding new general bubble error message consisting of icon, message and caption. Using this message… (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« ash/system/user/tray_user.cc ('K') | « ui/views/bubble/bubble_delegate.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/views/bubble/bubble_delegate.cc
diff --git a/ui/views/bubble/bubble_delegate.cc b/ui/views/bubble/bubble_delegate.cc
index 706475f652a4d235b3367df0999d8ca05cd458e0..144343700342eee6fd12419f93f9b0ca72746c5c 100644
--- a/ui/views/bubble/bubble_delegate.cc
+++ b/ui/views/bubble/bubble_delegate.cc
@@ -107,6 +107,7 @@ BubbleDelegateView::BubbleDelegateView()
anchor_widget_(NULL),
move_with_anchor_(false),
arrow_(BubbleBorder::TOP_LEFT),
+ arrow_offset_(0),
shadow_(BubbleBorder::SMALL_SHADOW),
color_explicitly_set_(false),
margins_(kDefaultMargin, kDefaultMargin, kDefaultMargin, kDefaultMargin),
@@ -130,6 +131,7 @@ BubbleDelegateView::BubbleDelegateView(
anchor_widget_(NULL),
move_with_anchor_(false),
arrow_(arrow),
+ arrow_offset_(0),
shadow_(BubbleBorder::SMALL_SHADOW),
color_explicitly_set_(false),
margins_(kDefaultMargin, kDefaultMargin, kDefaultMargin, kDefaultMargin),
@@ -190,7 +192,10 @@ NonClientFrameView* BubbleDelegateView::CreateNonClientFrameView(
BubbleFrameView* frame = new BubbleFrameView(margins());
const BubbleBorder::Arrow adjusted_arrow = base::i18n::IsRTL() ?
BubbleBorder::horizontal_mirror(arrow()) : arrow();
- frame->SetBubbleBorder(new BubbleBorder(adjusted_arrow, shadow(), color()));
+ BubbleBorder* border = new BubbleBorder(adjusted_arrow, shadow(), color());
+ if (arrow_offset_)
+ border->set_arrow_offset(arrow_offset_);
+ frame->SetBubbleBorder(border);
return frame;
}
@@ -267,6 +272,12 @@ void BubbleDelegateView::SetAlignment(BubbleBorder::BubbleAlignment alignment) {
SizeToContents();
}
+void BubbleDelegateView::SetArrowOffset(int offset) {
+ arrow_offset_ = offset;
+ if (GetBubbleFrameView() && GetBubbleFrameView()->bubble_border())
msw 2013/05/21 01:41:27 You should be able to do this in the PopupMessage:
Mr4D (OOO till 08-26) 2013/05/21 17:26:40 Well - it appears that you have never tried this b
+ GetBubbleFrameView()->bubble_border()->set_arrow_offset(offset);
+}
+
bool BubbleDelegateView::AcceleratorPressed(
const ui::Accelerator& accelerator) {
if (!close_on_esc() || accelerator.key_code() != ui::VKEY_ESCAPE)
« ash/system/user/tray_user.cc ('K') | « ui/views/bubble/bubble_delegate.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698