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

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: merge 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 633de3cfbff781be81d8eed9b7e941d62982149d..5054dfc273e091cb4fa67e17c6278a89c76b1f98 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"
@@ -541,6 +542,15 @@ base::string16 PageInfoBubbleView::GetWindowTitle() const {
return summary_text_;
}
+void PageInfoBubbleView::AddedToWidget() {
+ std::unique_ptr<views::Label> title =
+ views::BubbleFrameView::CreateDefaultTitleLabel(GetWindowTitle());
+ title->SetFontList(
+ ui::ResourceBundle::GetSharedInstance().GetFontListWithDelta(
+ kSummaryFontSizeDelta));
+ GetBubbleFrameView()->SetTitleView(std::move(title));
+}
+
bool PageInfoBubbleView::ShouldShowCloseButton() const {
return true;
}
@@ -555,11 +565,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());
@@ -696,7 +701,8 @@ void PageInfoBubbleView::SetIdentityInfo(const IdentityInfo& identity_info) {
identity_info.GetSecurityDescription();
summary_text_ = security_description->summary;
- GetWidget()->UpdateWindowTitle();
+ static_cast<views::Label*>(GetBubbleFrameView()->title())
+ ->SetText(GetWindowTitle());
if (identity_info.certificate) {
certificate_ = identity_info.certificate;

Powered by Google App Engine
This is Rietveld 408576698