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

Side by Side Diff: ui/views/bubble/bubble_frame_view.cc

Issue 326963002: [Views] Add a capability to the bubble delegate to be able to show the title in BaseFont. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 6 years, 6 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « ui/views/bubble/bubble_frame_view.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "ui/views/bubble/bubble_frame_view.h" 5 #include "ui/views/bubble/bubble_frame_view.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 8
9 #include "grit/ui_resources.h" 9 #include "grit/ui_resources.h"
10 #include "ui/base/hit_test.h" 10 #include "ui/base/hit_test.h"
(...skipping 143 matching lines...) Expand 10 before | Expand all | Expand 10 after
154 154
155 void BubbleFrameView::UpdateWindowIcon() {} 155 void BubbleFrameView::UpdateWindowIcon() {}
156 156
157 void BubbleFrameView::UpdateWindowTitle() { 157 void BubbleFrameView::UpdateWindowTitle() {
158 title_->SetText(GetWidget()->widget_delegate()->ShouldShowWindowTitle() ? 158 title_->SetText(GetWidget()->widget_delegate()->ShouldShowWindowTitle() ?
159 GetWidget()->widget_delegate()->GetWindowTitle() : base::string16()); 159 GetWidget()->widget_delegate()->GetWindowTitle() : base::string16());
160 // Update the close button visibility too, otherwise it's not intialized. 160 // Update the close button visibility too, otherwise it's not intialized.
161 ResetWindowControls(); 161 ResetWindowControls();
162 } 162 }
163 163
164 void BubbleFrameView::SetTitleFontList(const gfx::FontList& font_list) {
165 title_->SetFontList(font_list);
166 }
167
164 gfx::Insets BubbleFrameView::GetInsets() const { 168 gfx::Insets BubbleFrameView::GetInsets() const {
165 gfx::Insets insets = content_margins_; 169 gfx::Insets insets = content_margins_;
166 const int title_height = title_->text().empty() ? 0 : 170 const int title_height = title_->text().empty() ? 0 :
167 title_->GetPreferredSize().height() + kTitleTopInset + kTitleBottomInset; 171 title_->GetPreferredSize().height() + kTitleTopInset + kTitleBottomInset;
168 const int close_height = close_->visible() ? close_->height() : 0; 172 const int close_height = close_->visible() ? close_->height() : 0;
169 insets += gfx::Insets(std::max(title_height, close_height), 0, 0, 0); 173 insets += gfx::Insets(std::max(title_height, close_height), 0, 0, 0);
170 return insets; 174 return insets;
171 } 175 }
172 176
173 gfx::Size BubbleFrameView::GetPreferredSize() const { 177 gfx::Size BubbleFrameView::GetPreferredSize() const {
(...skipping 182 matching lines...) Expand 10 before | Expand all | Expand 10 after
356 if (titlebar_extra_view_ != NULL) 360 if (titlebar_extra_view_ != NULL)
357 title_bar_width += titlebar_extra_view_->GetPreferredSize().width(); 361 title_bar_width += titlebar_extra_view_->GetPreferredSize().width();
358 gfx::Size size(client_size); 362 gfx::Size size(client_size);
359 size.SetToMax(gfx::Size(title_bar_width, 0)); 363 size.SetToMax(gfx::Size(title_bar_width, 0));
360 const gfx::Insets insets(GetInsets()); 364 const gfx::Insets insets(GetInsets());
361 size.Enlarge(insets.width(), insets.height()); 365 size.Enlarge(insets.width(), insets.height());
362 return size; 366 return size;
363 } 367 }
364 368
365 } // namespace views 369 } // namespace views
OLDNEW
« no previous file with comments | « ui/views/bubble/bubble_frame_view.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698