summaryrefslogtreecommitdiffstats
path: root/ui/views/bubble
diff options
context:
space:
mode:
authordbeam@chromium.org <dbeam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-10-08 04:15:17 +0000
committerdbeam@chromium.org <dbeam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-10-08 04:15:17 +0000
commitc173b700599efaf156af096eaed1a60f2fada627 (patch)
tree882ac171b09fa48203b9b1453b43759080d2f533 /ui/views/bubble
parent3559adcec30b42492691ef4b91100c28449ace61 (diff)
downloadchromium_src-c173b700599efaf156af096eaed1a60f2fada627.zip
chromium_src-c173b700599efaf156af096eaed1a60f2fada627.tar.gz
chromium_src-c173b700599efaf156af096eaed1a60f2fada627.tar.bz2
rAc: error validation UI updates
Make error validation bubbles look more like all other Chrome bubbles (less custom, e.g. red and pointy). R=estade@chromium.org BUG=299300 Review URL: https://codereview.chromium.org/25804003 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@227458 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ui/views/bubble')
-rw-r--r--ui/views/bubble/bubble_delegate.cc9
-rw-r--r--ui/views/bubble/bubble_delegate.h3
2 files changed, 10 insertions, 2 deletions
diff --git a/ui/views/bubble/bubble_delegate.cc b/ui/views/bubble/bubble_delegate.cc
index 426ea12..0ab575d 100644
--- a/ui/views/bubble/bubble_delegate.cc
+++ b/ui/views/bubble/bubble_delegate.cc
@@ -219,8 +219,9 @@ View* BubbleDelegateView::GetContentsView() {
NonClientFrameView* BubbleDelegateView::CreateNonClientFrameView(
Widget* widget) {
BubbleFrameView* frame = new BubbleFrameView(margins());
- const BubbleBorder::Arrow adjusted_arrow = base::i18n::IsRTL() ?
- BubbleBorder::horizontal_mirror(arrow()) : arrow();
+ BubbleBorder::Arrow adjusted_arrow = arrow();
+ if (ShouldFlipArrowForRtl() && base::i18n::IsRTL())
+ adjusted_arrow = BubbleBorder::horizontal_mirror(adjusted_arrow);
frame->SetBubbleBorder(new BubbleBorder(adjusted_arrow, shadow(), color()));
return frame;
}
@@ -367,6 +368,10 @@ void BubbleDelegateView::AnimationProgressed(const gfx::Animation* animation) {
void BubbleDelegateView::Init() {}
+bool BubbleDelegateView::ShouldFlipArrowForRtl() const {
+ return true;
+}
+
void BubbleDelegateView::SetAnchorView(View* anchor_view) {
// When the anchor view gets set the associated anchor widget might
// change as well.
diff --git a/ui/views/bubble/bubble_delegate.h b/ui/views/bubble/bubble_delegate.h
index 2cb7749..c6ac3eb 100644
--- a/ui/views/bubble/bubble_delegate.h
+++ b/ui/views/bubble/bubble_delegate.h
@@ -141,6 +141,9 @@ class VIEWS_EXPORT BubbleDelegateView : public WidgetDelegateView,
// Perform view initialization on the contents for bubble sizing.
virtual void Init();
+ // Whether |arrow()| should automatically flip while in RTL.
+ virtual bool ShouldFlipArrowForRtl() const;
+
// Set the anchor view or rect; set these before CreateBubble or Show. Note
// that if a valid view gets passed, the anchor rect will get ignored. If the
// view gets deleted, but no new view gets set, the last known anchor postion