| 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 | 8 |
| 9 #include "ui/base/hit_test.h" | 9 #include "ui/base/hit_test.h" |
| 10 #include "ui/base/resource/resource_bundle.h" | 10 #include "ui/base/resource/resource_bundle.h" |
| (...skipping 145 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 156 | 156 |
| 157 void BubbleFrameView::UpdateWindowIcon() {} | 157 void BubbleFrameView::UpdateWindowIcon() {} |
| 158 | 158 |
| 159 void BubbleFrameView::UpdateWindowTitle() { | 159 void BubbleFrameView::UpdateWindowTitle() { |
| 160 title_->SetText(GetWidget()->widget_delegate()->ShouldShowWindowTitle() ? | 160 title_->SetText(GetWidget()->widget_delegate()->ShouldShowWindowTitle() ? |
| 161 GetWidget()->widget_delegate()->GetWindowTitle() : base::string16()); | 161 GetWidget()->widget_delegate()->GetWindowTitle() : base::string16()); |
| 162 // Update the close button visibility too, otherwise it's not intialized. | 162 // Update the close button visibility too, otherwise it's not intialized. |
| 163 ResetWindowControls(); | 163 ResetWindowControls(); |
| 164 } | 164 } |
| 165 | 165 |
| 166 void BubbleFrameView::SizeConstraintsChanged() {} |
| 167 |
| 166 void BubbleFrameView::SetTitleFontList(const gfx::FontList& font_list) { | 168 void BubbleFrameView::SetTitleFontList(const gfx::FontList& font_list) { |
| 167 title_->SetFontList(font_list); | 169 title_->SetFontList(font_list); |
| 168 } | 170 } |
| 169 | 171 |
| 170 gfx::Insets BubbleFrameView::GetInsets() const { | 172 gfx::Insets BubbleFrameView::GetInsets() const { |
| 171 gfx::Insets insets = content_margins_; | 173 gfx::Insets insets = content_margins_; |
| 172 const int title_height = title_->text().empty() ? 0 : | 174 const int title_height = title_->text().empty() ? 0 : |
| 173 title_->GetPreferredSize().height() + kTitleTopInset + kTitleBottomInset; | 175 title_->GetPreferredSize().height() + kTitleTopInset + kTitleBottomInset; |
| 174 const int close_height = close_->visible() ? close_->height() : 0; | 176 const int close_height = close_->visible() ? close_->height() : 0; |
| 175 insets += gfx::Insets(std::max(title_height, close_height), 0, 0, 0); | 177 insets += gfx::Insets(std::max(title_height, close_height), 0, 0, 0); |
| (...skipping 185 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 361 if (titlebar_extra_view_ != NULL) | 363 if (titlebar_extra_view_ != NULL) |
| 362 title_bar_width += titlebar_extra_view_->GetPreferredSize().width(); | 364 title_bar_width += titlebar_extra_view_->GetPreferredSize().width(); |
| 363 gfx::Size size(client_size); | 365 gfx::Size size(client_size); |
| 364 size.SetToMax(gfx::Size(title_bar_width, 0)); | 366 size.SetToMax(gfx::Size(title_bar_width, 0)); |
| 365 const gfx::Insets insets(GetInsets()); | 367 const gfx::Insets insets(GetInsets()); |
| 366 size.Enlarge(insets.width(), insets.height()); | 368 size.Enlarge(insets.width(), insets.height()); |
| 367 return size; | 369 return size; |
| 368 } | 370 } |
| 369 | 371 |
| 370 } // namespace views | 372 } // namespace views |
| OLD | NEW |