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

Unified Diff: ui/views/bubble/bubble_delegate.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 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 0f814888e239d80bff2b4f31a469de431b4c7e46..0eab071ad0c5e2042251b5ff93d6a1c490900b5a 100644
--- a/ui/views/bubble/bubble_delegate.cc
+++ b/ui/views/bubble/bubble_delegate.cc
@@ -5,6 +5,7 @@
#include "ui/views/bubble/bubble_delegate.h"
#include "ui/accessibility/ax_view_state.h"
+#include "ui/base/resource/resource_bundle.h"
#include "ui/gfx/color_utils.h"
#include "ui/gfx/rect.h"
#include "ui/native_theme/native_theme.h"
@@ -131,6 +132,9 @@ View* BubbleDelegateView::GetContentsView() {
NonClientFrameView* BubbleDelegateView::CreateNonClientFrameView(
Widget* widget) {
BubbleFrameView* frame = new BubbleFrameView(margins());
+ // Note: In CreateBubble, the call to SizeToContents() will cause
+ // the relayout that this call requires.
+ frame->SetTitleFontList(GetTitleFontList());
BubbleBorder::Arrow adjusted_arrow = arrow();
if (base::i18n::IsRTL())
adjusted_arrow = BubbleBorder::horizontal_mirror(adjusted_arrow);
@@ -277,6 +281,12 @@ gfx::Rect BubbleDelegateView::GetBubbleBounds() {
GetPreferredSize(), adjust_if_offscreen_ && !anchor_minimized);
}
+const gfx::FontList& BubbleDelegateView::GetTitleFontList() const {
+ ui::ResourceBundle& rb = ui::ResourceBundle::GetSharedInstance();
+ return rb.GetFontList(ui::ResourceBundle::MediumFont);
+}
+
+
void BubbleDelegateView::UpdateColorsFromTheme(const ui::NativeTheme* theme) {
if (!color_explicitly_set_)
color_ = theme->GetSystemColor(ui::NativeTheme::kColorId_DialogBackground);
« 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