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" | |
9 #include "ui/views/bubble/bubble_frame_view.h" | 8 #include "ui/views/bubble/bubble_frame_view.h" |
10 #include "ui/views/widget/widget.h" | 9 #include "ui/views/widget/widget.h" |
11 | 10 |
12 // The duration of the fade animation in milliseconds. | 11 // The duration of the fade animation in milliseconds. |
13 static const int kHideFadeDurationMS = 200; | 12 static const int kHideFadeDurationMS = 200; |
14 | 13 |
15 namespace views { | 14 namespace views { |
16 | 15 |
17 namespace { | 16 namespace { |
18 | 17 |
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
65 border_params.parent_widget = parent; | 64 border_params.parent_widget = parent; |
66 if (!border_params.parent_widget) | 65 if (!border_params.parent_widget) |
67 border_params.ownership = Widget::InitParams::WIDGET_OWNS_NATIVE_WIDGET; | 66 border_params.ownership = Widget::InitParams::WIDGET_OWNS_NATIVE_WIDGET; |
68 border_widget->Init(border_params); | 67 border_widget->Init(border_params); |
69 return border_widget; | 68 return border_widget; |
70 } | 69 } |
71 #endif | 70 #endif |
72 | 71 |
73 } // namespace | 72 } // namespace |
74 | 73 |
75 #if defined(OS_WIN) && !defined(USE_AURA) | 74 // TODO(msw): Use NativeTheme/color_helper (crbug.com/105023). |
76 const SkColor BubbleDelegateView::kBackgroundColor = | 75 const SkColor BubbleDelegateView::kBackgroundColor = SK_ColorWHITE; |
77 color_utils::GetSysSkColor(COLOR_WINDOW); | |
78 #else | |
79 // TODO(beng): source from theme provider. | |
80 const SkColor Bubble::kBackgroundColor = SK_ColorWHITE; | |
81 #endif | |
82 | 76 |
83 BubbleDelegateView::BubbleDelegateView() | 77 BubbleDelegateView::BubbleDelegateView() |
84 : close_on_esc_(true), | 78 : close_on_esc_(true), |
85 close_on_deactivate_(true), | 79 close_on_deactivate_(true), |
86 allow_bubble_offscreen_(false), | 80 allow_bubble_offscreen_(false), |
87 anchor_view_(NULL), | 81 anchor_view_(NULL), |
88 arrow_location_(BubbleBorder::TOP_LEFT), | 82 arrow_location_(BubbleBorder::TOP_LEFT), |
89 color_(kBackgroundColor), | 83 color_(kBackgroundColor), |
90 original_opacity_(255), | 84 original_opacity_(255), |
91 border_widget_(NULL), | 85 border_widget_(NULL), |
(...skipping 199 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
291 | 285 |
292 #if defined(OS_WIN) && !defined(USE_AURA) | 286 #if defined(OS_WIN) && !defined(USE_AURA) |
293 gfx::Rect BubbleDelegateView::GetBubbleClientBounds() const { | 287 gfx::Rect BubbleDelegateView::GetBubbleClientBounds() const { |
294 gfx::Rect client_bounds(GetBubbleFrameView()->GetBoundsForClientView()); | 288 gfx::Rect client_bounds(GetBubbleFrameView()->GetBoundsForClientView()); |
295 client_bounds.Offset(border_widget_->GetWindowScreenBounds().origin()); | 289 client_bounds.Offset(border_widget_->GetWindowScreenBounds().origin()); |
296 return client_bounds; | 290 return client_bounds; |
297 } | 291 } |
298 #endif | 292 #endif |
299 | 293 |
300 } // namespace views | 294 } // namespace views |
OLD | NEW |