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); | |
msw
2013/06/14 21:53:03
This should probably call SizeToContents(). If the
Mr4D (OOO till 08-26)
2013/06/15 02:16:23
Done.
| |
283 } | |
284 | |
280 bool BubbleDelegateView::AcceleratorPressed( | 285 bool BubbleDelegateView::AcceleratorPressed( |
281 const ui::Accelerator& accelerator) { | 286 const ui::Accelerator& accelerator) { |
282 if (!close_on_esc() || accelerator.key_code() != ui::VKEY_ESCAPE) | 287 if (!close_on_esc() || accelerator.key_code() != ui::VKEY_ESCAPE) |
283 return false; | 288 return false; |
284 if (fade_animation_.get()) | 289 if (fade_animation_.get()) |
285 fade_animation_->Reset(); | 290 fade_animation_->Reset(); |
286 GetWidget()->Close(); | 291 GetWidget()->Close(); |
287 return true; | 292 return true; |
288 } | 293 } |
289 | 294 |
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
368 #if defined(OS_WIN) && !defined(USE_AURA) | 373 #if defined(OS_WIN) && !defined(USE_AURA) |
369 gfx::Rect BubbleDelegateView::GetBubbleClientBounds() const { | 374 gfx::Rect BubbleDelegateView::GetBubbleClientBounds() const { |
370 gfx::Rect client_bounds(GetBubbleFrameView()->GetBoundsForClientView()); | 375 gfx::Rect client_bounds(GetBubbleFrameView()->GetBoundsForClientView()); |
371 client_bounds.Offset( | 376 client_bounds.Offset( |
372 border_widget_->GetWindowBoundsInScreen().OffsetFromOrigin()); | 377 border_widget_->GetWindowBoundsInScreen().OffsetFromOrigin()); |
373 return client_bounds; | 378 return client_bounds; |
374 } | 379 } |
375 #endif | 380 #endif |
376 | 381 |
377 } // namespace views | 382 } // namespace views |
OLD | NEW |