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

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

Issue 20871003: Fix BubbleFrameView title and close button patterns. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Sync and merge; add OVERRIDE mark. Created 7 years, 5 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_frame_view.h ('k') | ui/views/window/dialog_delegate.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/views/bubble/bubble_frame_view.cc
diff --git a/ui/views/bubble/bubble_frame_view.cc b/ui/views/bubble/bubble_frame_view.cc
index 8f6340533e96d024cfe280ebf2b05856f2bd0745..97b128fc458fd1b9a64a6dba9ec57476ab8d7e25 100644
--- a/ui/views/bubble/bubble_frame_view.cc
+++ b/ui/views/bubble/bubble_frame_view.cc
@@ -129,11 +129,18 @@ void BubbleFrameView::GetWindowMask(const gfx::Size& size,
window_mask->addRoundRect(rect, kCornerRadius, kCornerRadius);
}
-void BubbleFrameView::ResetWindowControls() {}
+void BubbleFrameView::ResetWindowControls() {
+ close_->SetVisible(GetWidget()->widget_delegate()->ShouldShowCloseButton());
+}
void BubbleFrameView::UpdateWindowIcon() {}
-void BubbleFrameView::UpdateWindowTitle() {}
+void BubbleFrameView::UpdateWindowTitle() {
+ title_->SetText(GetWidget()->widget_delegate()->ShouldShowWindowTitle() ?
+ GetWidget()->widget_delegate()->GetWindowTitle() : string16());
+ // Update the close button visibility too, otherwise it's not intialized.
+ ResetWindowControls();
+}
gfx::Insets BubbleFrameView::GetInsets() const {
gfx::Insets insets = content_margins_;
@@ -210,14 +217,6 @@ void BubbleFrameView::SetBubbleBorder(BubbleBorder* border) {
set_background(new views::BubbleBackground(border));
}
-void BubbleFrameView::SetTitle(const string16& title) {
- title_->SetText(title);
-}
-
-void BubbleFrameView::SetShowCloseButton(bool show) {
- close_->SetVisible(show);
-}
-
void BubbleFrameView::SetTitlebarExtraView(View* view) {
DCHECK(view);
DCHECK(!titlebar_extra_view_);
« no previous file with comments | « ui/views/bubble/bubble_frame_view.h ('k') | ui/views/window/dialog_delegate.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698