| 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 "views/bubble/bubble_delegate.h" | 5 #include "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 "views/bubble/bubble_frame_view.h" | 8 #include "views/bubble/bubble_frame_view.h" |
| 9 #include "views/widget/widget.h" | 9 #include "views/widget/widget.h" |
| 10 | 10 |
| (...skipping 179 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 190 } | 190 } |
| 191 } | 191 } |
| 192 | 192 |
| 193 void BubbleDelegateView::ResetFade() { | 193 void BubbleDelegateView::ResetFade() { |
| 194 fade_animation_.reset(); | 194 fade_animation_.reset(); |
| 195 if (border_widget_) | 195 if (border_widget_) |
| 196 border_widget_->SetOpacity(original_opacity_); | 196 border_widget_->SetOpacity(original_opacity_); |
| 197 GetWidget()->SetOpacity(original_opacity_); | 197 GetWidget()->SetOpacity(original_opacity_); |
| 198 } | 198 } |
| 199 | 199 |
| 200 bool BubbleDelegateView::AcceleratorPressed(const Accelerator& accelerator) { | 200 bool BubbleDelegateView::AcceleratorPressed( |
| 201 const ui::Accelerator& accelerator) { |
| 201 if (!close_on_esc() || accelerator.key_code() != ui::VKEY_ESCAPE) | 202 if (!close_on_esc() || accelerator.key_code() != ui::VKEY_ESCAPE) |
| 202 return false; | 203 return false; |
| 203 if (fade_animation_.get()) | 204 if (fade_animation_.get()) |
| 204 fade_animation_->Reset(); | 205 fade_animation_->Reset(); |
| 205 GetWidget()->Close(); | 206 GetWidget()->Close(); |
| 206 return true; | 207 return true; |
| 207 } | 208 } |
| 208 | 209 |
| 209 void BubbleDelegateView::Init() {} | 210 void BubbleDelegateView::Init() {} |
| 210 | 211 |
| (...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 257 } | 258 } |
| 258 | 259 |
| 259 gfx::Rect BubbleDelegateView::GetBubbleClientBounds() const { | 260 gfx::Rect BubbleDelegateView::GetBubbleClientBounds() const { |
| 260 gfx::Rect client_bounds(GetBubbleFrameView()->GetBoundsForClientView()); | 261 gfx::Rect client_bounds(GetBubbleFrameView()->GetBoundsForClientView()); |
| 261 client_bounds.Offset(border_widget_->GetWindowScreenBounds().origin()); | 262 client_bounds.Offset(border_widget_->GetWindowScreenBounds().origin()); |
| 262 return client_bounds; | 263 return client_bounds; |
| 263 } | 264 } |
| 264 #endif | 265 #endif |
| 265 | 266 |
| 266 } // namespace views | 267 } // namespace views |
| OLD | NEW |