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 346 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
357 OnPaintBorder(recorder.canvas()); | 357 OnPaintBorder(recorder.canvas()); |
358 } | 358 } |
359 | 359 |
360 void BubbleFrameView::ButtonPressed(Button* sender, const ui::Event& event) { | 360 void BubbleFrameView::ButtonPressed(Button* sender, const ui::Event& event) { |
361 if (sender == close_) { | 361 if (sender == close_) { |
362 close_button_clicked_ = true; | 362 close_button_clicked_ = true; |
363 GetWidget()->Close(); | 363 GetWidget()->Close(); |
364 } | 364 } |
365 } | 365 } |
366 | 366 |
367 void BubbleFrameView::SetBubbleBorder(scoped_ptr<BubbleBorder> border) { | 367 void BubbleFrameView::SetBubbleBorder(std::unique_ptr<BubbleBorder> border) { |
368 bubble_border_ = border.get(); | 368 bubble_border_ = border.get(); |
369 SetBorder(std::move(border)); | 369 SetBorder(std::move(border)); |
370 | 370 |
371 // Update the background, which relies on the border. | 371 // Update the background, which relies on the border. |
372 set_background(new views::BubbleBackground(bubble_border_)); | 372 set_background(new views::BubbleBackground(bubble_border_)); |
373 } | 373 } |
374 | 374 |
375 void BubbleFrameView::SetFootnoteView(View* view) { | 375 void BubbleFrameView::SetFootnoteView(View* view) { |
376 if (!view) | 376 if (!view) |
377 return; | 377 return; |
(...skipping 133 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
511 size.Enlarge(client_insets.width(), client_insets.height()); | 511 size.Enlarge(client_insets.width(), client_insets.height()); |
512 size.SetToMax(gfx::Size(title_bar_width, 0)); | 512 size.SetToMax(gfx::Size(title_bar_width, 0)); |
513 | 513 |
514 if (footnote_container_) | 514 if (footnote_container_) |
515 size.Enlarge(0, footnote_container_->GetHeightForWidth(size.width())); | 515 size.Enlarge(0, footnote_container_->GetHeightForWidth(size.width())); |
516 | 516 |
517 return size; | 517 return size; |
518 } | 518 } |
519 | 519 |
520 } // namespace views | 520 } // namespace views |
OLD | NEW |