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

Unified Diff: ui/views/bubble/bubble_frame_view.cc

Issue 12096084: Cleanup BubbleFrameView and BubbleBorder construction. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Additional refactoring and cleanup. Created 7 years, 11 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: ui/views/bubble/bubble_frame_view.cc
diff --git a/ui/views/bubble/bubble_frame_view.cc b/ui/views/bubble/bubble_frame_view.cc
index d3f608a286b01d9631b5c0d1161934f4e04e2a48..2718d44d5a82ac59ebf74fd4b9b64bb7792116ab 100644
--- a/ui/views/bubble/bubble_frame_view.cc
+++ b/ui/views/bubble/bubble_frame_view.cc
@@ -39,11 +39,9 @@ int GetOffScreenLength(const gfx::Rect& monitor_bounds,
namespace views {
-BubbleFrameView::BubbleFrameView(const gfx::Insets& margins,
- BubbleBorder* border)
- : bubble_border_(border),
- content_margins_(margins) {
- set_border(bubble_border_);
+BubbleFrameView::BubbleFrameView(const gfx::Insets& content_margins)
+ : bubble_border_(NULL),
+ content_margins_(content_margins) {
}
BubbleFrameView::~BubbleFrameView() {}
@@ -70,6 +68,14 @@ gfx::Size BubbleFrameView::GetPreferredSize() {
return GetUpdatedWindowBounds(gfx::Rect(), client_size, false).size();
}
+void BubbleFrameView::SetBubbleBorder(BubbleBorder* border) {
+ bubble_border_ = border;
+ set_border(bubble_border_);
+
+ // Update the background, which relies on the border.
+ set_background(new views::BubbleBackground(border));
+}
+
gfx::Rect BubbleFrameView::GetUpdatedWindowBounds(const gfx::Rect& anchor_rect,
gfx::Size client_size,
bool adjust_if_offscreen) {
@@ -91,14 +97,6 @@ gfx::Rect BubbleFrameView::GetUpdatedWindowBounds(const gfx::Rect& anchor_rect,
return bubble_border_->GetBounds(anchor_rect, client_size);
}
-void BubbleFrameView::SetBubbleBorder(BubbleBorder* border) {
- bubble_border_ = border;
- set_border(bubble_border_);
-
- // Update the background, which relies on the border.
- set_background(new views::BubbleBackground(border));
-}
-
gfx::Rect BubbleFrameView::GetMonitorBounds(const gfx::Rect& rect) {
// TODO(scottmg): Native is wrong. http://crbug.com/133312
return gfx::Screen::GetNativeScreen()->GetDisplayNearestPoint(

Powered by Google App Engine
This is Rietveld 408576698