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

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

Issue 21668003: Implement newly saved card bubble for realz and update generated card bubble to (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 7 years, 4 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
« no previous file with comments | « ui/views/bubble/bubble_delegate.h ('k') | ui/views/bubble/bubble_frame_view.h » ('j') | 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 3987589f3fcb6a66486b20d74f63a5de755ccbd1..da80f3b5b84c95f29163d8a2883f8f54b9f62d77 100644
--- a/ui/views/bubble/bubble_delegate.cc
+++ b/ui/views/bubble/bubble_delegate.cc
@@ -120,6 +120,7 @@ BubbleDelegateView::BubbleDelegateView()
shadow_(BubbleBorder::SMALL_SHADOW),
color_explicitly_set_(false),
margins_(kDefaultMargin, kDefaultMargin, kDefaultMargin, kDefaultMargin),
+ match_title_margins_(false),
original_opacity_(255),
border_widget_(NULL),
use_focusless_(false),
@@ -143,6 +144,7 @@ BubbleDelegateView::BubbleDelegateView(
shadow_(BubbleBorder::SMALL_SHADOW),
color_explicitly_set_(false),
margins_(kDefaultMargin, kDefaultMargin, kDefaultMargin, kDefaultMargin),
+ match_title_margins_(false),
original_opacity_(255),
border_widget_(NULL),
use_focusless_(false),
@@ -208,13 +210,23 @@ View* BubbleDelegateView::GetContentsView() {
NonClientFrameView* BubbleDelegateView::CreateNonClientFrameView(
Widget* widget) {
- BubbleFrameView* frame = new BubbleFrameView(margins());
+ BubbleFrameView* frame = new BubbleFrameView(match_title_margins_ ?
msw 2013/08/08 18:34:26 Could individual bubbles instead call BubbleDelega
Dan Beam 2013/08/08 21:15:59 Done.
+ views::BubbleFrameView::ContentsInsetsToMatchTitle() : margins());
const BubbleBorder::Arrow adjusted_arrow = base::i18n::IsRTL() ?
BubbleBorder::horizontal_mirror(arrow()) : arrow();
frame->SetBubbleBorder(new BubbleBorder(adjusted_arrow, shadow(), color()));
return frame;
}
+gfx::Size BubbleDelegateView::GetPreferredSize() {
+ if (!match_title_margins_)
+ return WidgetDelegateView::GetPreferredSize();
+
+ NonClientFrameView* fv = GetWidget()->non_client_view()->frame_view();
+ int width = fv->GetBoundsForClientView().width() + GetInsets().width();
+ return gfx::Size(width, GetHeightForWidth(width));
+}
+
void BubbleDelegateView::OnWidgetDestroying(Widget* widget) {
if (anchor_widget() == widget) {
anchor_widget_->RemoveObserver(this);
« no previous file with comments | « ui/views/bubble/bubble_delegate.h ('k') | ui/views/bubble/bubble_frame_view.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698