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/gfx/color_utils.h" | |
8 #include "ui/views/bubble/bubble_frame_view.h" | 9 #include "ui/views/bubble/bubble_frame_view.h" |
9 #include "ui/views/widget/widget.h" | 10 #include "ui/views/widget/widget.h" |
10 | 11 |
11 // The duration of the fade animation in milliseconds. | 12 // The duration of the fade animation in milliseconds. |
12 static const int kHideFadeDurationMS = 200; | 13 static const int kHideFadeDurationMS = 200; |
13 | 14 |
14 namespace views { | 15 namespace views { |
15 | 16 |
16 namespace { | 17 namespace { |
17 | 18 |
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
64 border_params.parent_widget = parent; | 65 border_params.parent_widget = parent; |
65 if (!border_params.parent_widget) | 66 if (!border_params.parent_widget) |
66 border_params.ownership = Widget::InitParams::WIDGET_OWNS_NATIVE_WIDGET; | 67 border_params.ownership = Widget::InitParams::WIDGET_OWNS_NATIVE_WIDGET; |
67 border_widget->Init(border_params); | 68 border_widget->Init(border_params); |
68 return border_widget; | 69 return border_widget; |
69 } | 70 } |
70 #endif | 71 #endif |
71 | 72 |
72 } // namespace | 73 } // namespace |
73 | 74 |
74 // TODO(msw): Use NativeTheme/color_helper (crbug.com/105023). | 75 #if defined(OS_WIN) && !defined(USE_AURA) |
msw
2011/12/08 05:46:30
The impl seems to run on Aura, any reason you're b
sail
2011/12/08 05:52:07
This was copy paste from the original implementati
| |
75 const SkColor BubbleDelegateView::kBackgroundColor = SK_ColorWHITE; | 76 const SkColor BubbleDelegateView::kBackgroundColor = |
77 color_utils::GetSysSkColor(COLOR_WINDOW); | |
78 #else | |
79 // TODO(beng): source from theme provider. | |
80 const SkColor Bubble::kBackgroundColor = SK_ColorWHITE; | |
81 #endif | |
76 | 82 |
77 BubbleDelegateView::BubbleDelegateView() | 83 BubbleDelegateView::BubbleDelegateView() |
78 : close_on_esc_(true), | 84 : close_on_esc_(true), |
79 close_on_deactivate_(true), | 85 close_on_deactivate_(true), |
80 allow_bubble_offscreen_(false), | 86 allow_bubble_offscreen_(false), |
81 anchor_view_(NULL), | 87 anchor_view_(NULL), |
82 arrow_location_(BubbleBorder::TOP_LEFT), | 88 arrow_location_(BubbleBorder::TOP_LEFT), |
83 color_(kBackgroundColor), | 89 color_(kBackgroundColor), |
84 original_opacity_(255), | 90 original_opacity_(255), |
85 border_widget_(NULL), | 91 border_widget_(NULL), |
(...skipping 192 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
278 | 284 |
279 #if defined(OS_WIN) && !defined(USE_AURA) | 285 #if defined(OS_WIN) && !defined(USE_AURA) |
280 gfx::Rect BubbleDelegateView::GetBubbleClientBounds() const { | 286 gfx::Rect BubbleDelegateView::GetBubbleClientBounds() const { |
281 gfx::Rect client_bounds(GetBubbleFrameView()->GetBoundsForClientView()); | 287 gfx::Rect client_bounds(GetBubbleFrameView()->GetBoundsForClientView()); |
282 client_bounds.Offset(border_widget_->GetWindowScreenBounds().origin()); | 288 client_bounds.Offset(border_widget_->GetWindowScreenBounds().origin()); |
283 return client_bounds; | 289 return client_bounds; |
284 } | 290 } |
285 #endif | 291 #endif |
286 | 292 |
287 } // namespace views | 293 } // namespace views |
OLD | NEW |