OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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_delegate.h" | 5 #include "ui/views/bubble/bubble_delegate.h" |
6 | 6 |
7 #include "ui/base/animation/slide_animation.h" | 7 #include "ui/base/animation/slide_animation.h" |
8 #include "ui/views/bubble/bubble_frame_view.h" | 8 #include "ui/views/bubble/bubble_frame_view.h" |
9 #include "ui/views/widget/widget.h" | 9 #include "ui/views/widget/widget.h" |
10 | 10 |
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
64 border_params.parent_widget = parent; | 64 border_params.parent_widget = parent; |
65 if (!border_params.parent_widget) | 65 if (!border_params.parent_widget) |
66 border_params.ownership = Widget::InitParams::WIDGET_OWNS_NATIVE_WIDGET; | 66 border_params.ownership = Widget::InitParams::WIDGET_OWNS_NATIVE_WIDGET; |
67 border_widget->Init(border_params); | 67 border_widget->Init(border_params); |
68 return border_widget; | 68 return border_widget; |
69 } | 69 } |
70 #endif | 70 #endif |
71 | 71 |
72 } // namespace | 72 } // namespace |
73 | 73 |
| 74 // TODO(msw): Use NativeTheme/color_helper (crbug.com/105023). |
| 75 const SkColor BubbleDelegateView::kBackgroundColor = SK_ColorWHITE; |
| 76 |
74 BubbleDelegateView::BubbleDelegateView() | 77 BubbleDelegateView::BubbleDelegateView() |
75 : close_on_esc_(true), | 78 : close_on_esc_(true), |
76 close_on_deactivate_(true), | 79 close_on_deactivate_(true), |
77 allow_bubble_offscreen_(false), | 80 allow_bubble_offscreen_(false), |
78 anchor_view_(NULL), | 81 anchor_view_(NULL), |
79 arrow_location_(BubbleBorder::TOP_LEFT), | 82 arrow_location_(BubbleBorder::TOP_LEFT), |
80 color_(SK_ColorWHITE), | 83 color_(SK_ColorWHITE), |
81 border_widget_(NULL), | 84 border_widget_(NULL), |
82 use_focusless_(false) { | 85 use_focusless_(false) { |
83 set_background(views::Background::CreateSolidBackground(color_)); | 86 set_background(views::Background::CreateSolidBackground(color_)); |
(...skipping 194 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
278 | 281 |
279 #if defined(OS_WIN) && !defined(USE_AURA) | 282 #if defined(OS_WIN) && !defined(USE_AURA) |
280 gfx::Rect BubbleDelegateView::GetBubbleClientBounds() const { | 283 gfx::Rect BubbleDelegateView::GetBubbleClientBounds() const { |
281 gfx::Rect client_bounds(GetBubbleFrameView()->GetBoundsForClientView()); | 284 gfx::Rect client_bounds(GetBubbleFrameView()->GetBoundsForClientView()); |
282 client_bounds.Offset(border_widget_->GetWindowScreenBounds().origin()); | 285 client_bounds.Offset(border_widget_->GetWindowScreenBounds().origin()); |
283 return client_bounds; | 286 return client_bounds; |
284 } | 287 } |
285 #endif | 288 #endif |
286 | 289 |
287 } // namespace views | 290 } // namespace views |
OLD | NEW |