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

Unified Diff: chrome/browser/ui/views/page_info/page_info_bubble_view.cc

Issue 2907983002: Allow dialogs to use a custom View as their title. (Closed)
Patch Set: pass strings by reference Created 3 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
Index: chrome/browser/ui/views/page_info/page_info_bubble_view.cc
diff --git a/chrome/browser/ui/views/page_info/page_info_bubble_view.cc b/chrome/browser/ui/views/page_info/page_info_bubble_view.cc
index 38641812dd460948ca3d63a7feea85fa4a287b93..3dc2a2bffd9098a399c6c963b5ab812e606411fb 100644
--- a/chrome/browser/ui/views/page_info/page_info_bubble_view.cc
+++ b/chrome/browser/ui/views/page_info/page_info_bubble_view.cc
@@ -45,6 +45,7 @@
#include "ui/gfx/geometry/insets.h"
#include "ui/gfx/image/image.h"
#include "ui/views/border.h"
+#include "ui/views/bubble/bubble_frame_view.h"
#include "ui/views/controls/button/image_button.h"
#include "ui/views/controls/button/md_text_button.h"
#include "ui/views/controls/image_view.h"
@@ -533,6 +534,16 @@ base::string16 PageInfoBubbleView::GetWindowTitle() const {
return summary_text_;
}
+views::View* PageInfoBubbleView::CreateTitleView(
+ const base::string16& title_text) {
+ views::Label* title =
+ views::BubbleFrameView::CreateDefaultTitleLabel(title_text);
+ title->SetFontList(
+ ui::ResourceBundle::GetSharedInstance().GetFontListWithDelta(
+ kSummaryFontSizeDelta));
+ return title;
+}
+
bool PageInfoBubbleView::ShouldShowCloseButton() const {
return true;
}
@@ -547,11 +558,6 @@ int PageInfoBubbleView::GetDialogButtons() const {
return ui::DIALOG_BUTTON_NONE;
}
-const gfx::FontList& PageInfoBubbleView::GetTitleFontList() const {
- return ui::ResourceBundle::GetSharedInstance().GetFontListWithDelta(
- kSummaryFontSizeDelta);
-}
-
void PageInfoBubbleView::ButtonPressed(views::Button* button,
const ui::Event& event) {
DCHECK_EQ(VIEW_ID_PAGE_INFO_BUTTON_CLOSE, button->id());
@@ -681,7 +687,7 @@ void PageInfoBubbleView::SetIdentityInfo(const IdentityInfo& identity_info) {
identity_info.GetSecurityDescription();
summary_text_ = security_description->summary;
- GetWidget()->UpdateWindowTitle();
+ SetupTitleView();
if (identity_info.certificate) {
certificate_ = identity_info.certificate;

Powered by Google App Engine
This is Rietveld 408576698