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 "grit/ui_resources.h" | 9 #include "grit/ui_resources.h" |
10 #include "ui/base/hit_test.h" | 10 #include "ui/base/hit_test.h" |
(...skipping 195 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
206 | 206 |
207 const char* BubbleFrameView::GetClassName() const { | 207 const char* BubbleFrameView::GetClassName() const { |
208 return kViewClassName; | 208 return kViewClassName; |
209 } | 209 } |
210 | 210 |
211 void BubbleFrameView::ChildPreferredSizeChanged(View* child) { | 211 void BubbleFrameView::ChildPreferredSizeChanged(View* child) { |
212 if (child == titlebar_extra_view_ || child == title_) | 212 if (child == titlebar_extra_view_ || child == title_) |
213 Layout(); | 213 Layout(); |
214 } | 214 } |
215 | 215 |
| 216 void BubbleFrameView::OnThemeChanged() { |
| 217 UpdateWindowTitle(); |
| 218 ResetWindowControls(); |
| 219 UpdateWindowIcon(); |
| 220 } |
| 221 |
216 void BubbleFrameView::ButtonPressed(Button* sender, const ui::Event& event) { | 222 void BubbleFrameView::ButtonPressed(Button* sender, const ui::Event& event) { |
217 if (sender == close_) | 223 if (sender == close_) |
218 GetWidget()->Close(); | 224 GetWidget()->Close(); |
219 } | 225 } |
220 | 226 |
221 void BubbleFrameView::SetBubbleBorder(BubbleBorder* border) { | 227 void BubbleFrameView::SetBubbleBorder(BubbleBorder* border) { |
222 bubble_border_ = border; | 228 bubble_border_ = border; |
223 set_border(bubble_border_); | 229 set_border(bubble_border_); |
224 | 230 |
225 // Update the background, which relies on the border. | 231 // Update the background, which relies on the border. |
(...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
336 title_bar_width += kTitleLeftInset + title_->GetPreferredSize().width(); | 342 title_bar_width += kTitleLeftInset + title_->GetPreferredSize().width(); |
337 if (close_->visible()) | 343 if (close_->visible()) |
338 title_bar_width += close_->width() + 1; | 344 title_bar_width += close_->width() + 1; |
339 if (titlebar_extra_view_ != NULL) | 345 if (titlebar_extra_view_ != NULL) |
340 title_bar_width += titlebar_extra_view_->GetPreferredSize().width(); | 346 title_bar_width += titlebar_extra_view_->GetPreferredSize().width(); |
341 size.SetToMax(gfx::Size(title_bar_width, 0)); | 347 size.SetToMax(gfx::Size(title_bar_width, 0)); |
342 return size; | 348 return size; |
343 } | 349 } |
344 | 350 |
345 } // namespace views | 351 } // namespace views |
OLD | NEW |