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_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/gfx/color_utils.h" |
9 #include "ui/gfx/rect.h" | 9 #include "ui/gfx/rect.h" |
10 #include "ui/native_theme/native_theme.h" | 10 #include "ui/native_theme/native_theme.h" |
(...skipping 259 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
270 if (border_widget_) | 270 if (border_widget_) |
271 border_widget_->SetOpacity(original_opacity_); | 271 border_widget_->SetOpacity(original_opacity_); |
272 GetWidget()->SetOpacity(original_opacity_); | 272 GetWidget()->SetOpacity(original_opacity_); |
273 } | 273 } |
274 | 274 |
275 void BubbleDelegateView::SetAlignment(BubbleBorder::BubbleAlignment alignment) { | 275 void BubbleDelegateView::SetAlignment(BubbleBorder::BubbleAlignment alignment) { |
276 GetBubbleFrameView()->bubble_border()->set_alignment(alignment); | 276 GetBubbleFrameView()->bubble_border()->set_alignment(alignment); |
277 SizeToContents(); | 277 SizeToContents(); |
278 } | 278 } |
279 | 279 |
| 280 void BubbleDelegateView::SetArrowPaintType( |
| 281 BubbleBorder::ArrowPaintType paint_type) { |
| 282 GetBubbleFrameView()->bubble_border()->set_paint_arrow(paint_type); |
| 283 SizeToContents(); |
| 284 } |
| 285 |
280 bool BubbleDelegateView::AcceleratorPressed( | 286 bool BubbleDelegateView::AcceleratorPressed( |
281 const ui::Accelerator& accelerator) { | 287 const ui::Accelerator& accelerator) { |
282 if (!close_on_esc() || accelerator.key_code() != ui::VKEY_ESCAPE) | 288 if (!close_on_esc() || accelerator.key_code() != ui::VKEY_ESCAPE) |
283 return false; | 289 return false; |
284 if (fade_animation_.get()) | 290 if (fade_animation_.get()) |
285 fade_animation_->Reset(); | 291 fade_animation_->Reset(); |
286 GetWidget()->Close(); | 292 GetWidget()->Close(); |
287 return true; | 293 return true; |
288 } | 294 } |
289 | 295 |
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
368 #if defined(OS_WIN) && !defined(USE_AURA) | 374 #if defined(OS_WIN) && !defined(USE_AURA) |
369 gfx::Rect BubbleDelegateView::GetBubbleClientBounds() const { | 375 gfx::Rect BubbleDelegateView::GetBubbleClientBounds() const { |
370 gfx::Rect client_bounds(GetBubbleFrameView()->GetBoundsForClientView()); | 376 gfx::Rect client_bounds(GetBubbleFrameView()->GetBoundsForClientView()); |
371 client_bounds.Offset( | 377 client_bounds.Offset( |
372 border_widget_->GetWindowBoundsInScreen().OffsetFromOrigin()); | 378 border_widget_->GetWindowBoundsInScreen().OffsetFromOrigin()); |
373 return client_bounds; | 379 return client_bounds; |
374 } | 380 } |
375 #endif | 381 #endif |
376 | 382 |
377 } // namespace views | 383 } // namespace views |
OLD | NEW |