OLD | NEW |
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 #include <utility> | 8 #include <utility> |
9 | 9 |
10 #include "build/build_config.h" | 10 #include "build/build_config.h" |
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
79 : bubble_border_(nullptr), | 79 : bubble_border_(nullptr), |
80 title_margins_(title_margins), | 80 title_margins_(title_margins), |
81 content_margins_(content_margins), | 81 content_margins_(content_margins), |
82 title_icon_(new views::ImageView()), | 82 title_icon_(new views::ImageView()), |
83 title_(nullptr), | 83 title_(nullptr), |
84 close_(nullptr), | 84 close_(nullptr), |
85 footnote_container_(nullptr), | 85 footnote_container_(nullptr), |
86 close_button_clicked_(false) { | 86 close_button_clicked_(false) { |
87 AddChildView(title_icon_); | 87 AddChildView(title_icon_); |
88 | 88 |
89 ui::ResourceBundle& rb = ui::ResourceBundle::GetSharedInstance(); | 89 title_ = new Label(base::string16(), style::CONTEXT_DIALOG_TITLE); |
90 title_ = new Label(base::string16(), | |
91 rb.GetFontListWithDelta(ui::kTitleFontSizeDelta)); | |
92 title_->SetHorizontalAlignment(gfx::ALIGN_LEFT); | 90 title_->SetHorizontalAlignment(gfx::ALIGN_LEFT); |
93 title_->set_collapse_when_hidden(true); | 91 title_->set_collapse_when_hidden(true); |
94 title_->SetVisible(false); | 92 title_->SetVisible(false); |
95 title_->SetMultiLine(true); | 93 title_->SetMultiLine(true); |
96 AddChildView(title_); | 94 AddChildView(title_); |
97 | 95 |
98 close_ = CreateCloseButton(this); | 96 close_ = CreateCloseButton(this); |
99 close_->SetVisible(false); | 97 close_->SetVisible(false); |
100 #if defined(OS_WIN) | 98 #if defined(OS_WIN) |
101 // Windows will automatically create a tooltip for the close button based on | 99 // Windows will automatically create a tooltip for the close button based on |
(...skipping 428 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
530 size.Enlarge(client_insets.width(), client_insets.height()); | 528 size.Enlarge(client_insets.width(), client_insets.height()); |
531 size.SetToMax(gfx::Size(title_bar_width, 0)); | 529 size.SetToMax(gfx::Size(title_bar_width, 0)); |
532 | 530 |
533 if (footnote_container_) | 531 if (footnote_container_) |
534 size.Enlarge(0, footnote_container_->GetHeightForWidth(size.width())); | 532 size.Enlarge(0, footnote_container_->GetHeightForWidth(size.width())); |
535 | 533 |
536 return size; | 534 return size; |
537 } | 535 } |
538 | 536 |
539 } // namespace views | 537 } // namespace views |
OLD | NEW |