| 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 "views/widget/widget.h" | 9 #include "views/widget/widget.h" |
| 10 | 10 |
| (...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 72 } // namespace | 72 } // namespace |
| 73 | 73 |
| 74 BubbleDelegateView::BubbleDelegateView() | 74 BubbleDelegateView::BubbleDelegateView() |
| 75 : close_on_esc_(true), | 75 : close_on_esc_(true), |
| 76 close_on_deactivate_(true), | 76 close_on_deactivate_(true), |
| 77 allow_bubble_offscreen_(false), | 77 allow_bubble_offscreen_(false), |
| 78 anchor_view_(NULL), | 78 anchor_view_(NULL), |
| 79 arrow_location_(BubbleBorder::TOP_LEFT), | 79 arrow_location_(BubbleBorder::TOP_LEFT), |
| 80 color_(SK_ColorWHITE), | 80 color_(SK_ColorWHITE), |
| 81 border_widget_(NULL), | 81 border_widget_(NULL), |
| 82 use_focusless_(false) { | 82 use_focusless_(false), |
| 83 show_while_screen_is_locked_(false) { |
| 83 set_background(views::Background::CreateSolidBackground(color_)); | 84 set_background(views::Background::CreateSolidBackground(color_)); |
| 84 AddAccelerator(ui::Accelerator(ui::VKEY_ESCAPE, 0)); | 85 AddAccelerator(ui::Accelerator(ui::VKEY_ESCAPE, 0)); |
| 85 } | 86 } |
| 86 | 87 |
| 87 BubbleDelegateView::BubbleDelegateView( | 88 BubbleDelegateView::BubbleDelegateView( |
| 88 View* anchor_view, | 89 View* anchor_view, |
| 89 BubbleBorder::ArrowLocation arrow_location, | 90 BubbleBorder::ArrowLocation arrow_location, |
| 90 const SkColor& color) | 91 const SkColor& color) |
| 91 : close_on_esc_(true), | 92 : close_on_esc_(true), |
| 92 close_on_deactivate_(true), | 93 close_on_deactivate_(true), |
| 93 allow_bubble_offscreen_(false), | 94 allow_bubble_offscreen_(false), |
| 94 anchor_view_(anchor_view), | 95 anchor_view_(anchor_view), |
| 95 arrow_location_(arrow_location), | 96 arrow_location_(arrow_location), |
| 96 color_(color), | 97 color_(color), |
| 97 original_opacity_(255), | 98 original_opacity_(255), |
| 98 border_widget_(NULL), | 99 border_widget_(NULL), |
| 99 use_focusless_(false) { | 100 use_focusless_(false), |
| 101 show_while_screen_is_locked_(false) { |
| 100 set_background(views::Background::CreateSolidBackground(color_)); | 102 set_background(views::Background::CreateSolidBackground(color_)); |
| 101 AddAccelerator(ui::Accelerator(ui::VKEY_ESCAPE, 0)); | 103 AddAccelerator(ui::Accelerator(ui::VKEY_ESCAPE, 0)); |
| 102 } | 104 } |
| 103 | 105 |
| 104 BubbleDelegateView::~BubbleDelegateView() { | 106 BubbleDelegateView::~BubbleDelegateView() { |
| 105 if (border_widget_) | 107 if (border_widget_) |
| 106 border_widget_->Close(); | 108 border_widget_->Close(); |
| 107 } | 109 } |
| 108 | 110 |
| 109 // static | 111 // static |
| (...skipping 168 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 278 | 280 |
| 279 #if defined(OS_WIN) && !defined(USE_AURA) | 281 #if defined(OS_WIN) && !defined(USE_AURA) |
| 280 gfx::Rect BubbleDelegateView::GetBubbleClientBounds() const { | 282 gfx::Rect BubbleDelegateView::GetBubbleClientBounds() const { |
| 281 gfx::Rect client_bounds(GetBubbleFrameView()->GetBoundsForClientView()); | 283 gfx::Rect client_bounds(GetBubbleFrameView()->GetBoundsForClientView()); |
| 282 client_bounds.Offset(border_widget_->GetWindowScreenBounds().origin()); | 284 client_bounds.Offset(border_widget_->GetWindowScreenBounds().origin()); |
| 283 return client_bounds; | 285 return client_bounds; |
| 284 } | 286 } |
| 285 #endif | 287 #endif |
| 286 | 288 |
| 287 } // namespace views | 289 } // namespace views |
| OLD | NEW |