| 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 #ifndef VIEWS_BUBBLE_BUBBLE_DELEGATE_H_ | 5 #ifndef VIEWS_BUBBLE_BUBBLE_DELEGATE_H_ |
| 6 #define VIEWS_BUBBLE_BUBBLE_DELEGATE_H_ | 6 #define VIEWS_BUBBLE_BUBBLE_DELEGATE_H_ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include "ui/base/animation/animation_delegate.h" | 9 #include "ui/base/animation/animation_delegate.h" |
| 10 #include "views/bubble/bubble_border.h" | 10 #include "views/bubble/bubble_border.h" |
| (...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 51 // Get the arrow's location on the bubble. | 51 // Get the arrow's location on the bubble. |
| 52 virtual BubbleBorder::ArrowLocation GetArrowLocation() const; | 52 virtual BubbleBorder::ArrowLocation GetArrowLocation() const; |
| 53 | 53 |
| 54 // Get the color used for the background and border. | 54 // Get the color used for the background and border. |
| 55 virtual SkColor GetColor() const; | 55 virtual SkColor GetColor() const; |
| 56 | 56 |
| 57 // Fade the bubble in or out via Widget transparency. | 57 // Fade the bubble in or out via Widget transparency. |
| 58 // Fade in calls Widget::Show; fade out calls Widget::Close upon completion. | 58 // Fade in calls Widget::Show; fade out calls Widget::Close upon completion. |
| 59 void StartFade(bool fade_in); | 59 void StartFade(bool fade_in); |
| 60 | 60 |
| 61 // Reset fade and opacity of bubble. Restore the opacity of the |
| 62 // bubble to the setting before StartFade() was called. |
| 63 void ResetFade(); |
| 64 |
| 61 protected: | 65 protected: |
| 62 // View overrides: | 66 // View overrides: |
| 63 virtual bool AcceleratorPressed(const Accelerator& accelerator) OVERRIDE; | 67 virtual bool AcceleratorPressed(const Accelerator& accelerator) OVERRIDE; |
| 64 | 68 |
| 65 // Perform view initialization on the contents for bubble sizing. | 69 // Perform view initialization on the contents for bubble sizing. |
| 66 virtual void Init(); | 70 virtual void Init(); |
| 67 | 71 |
| 68 private: | 72 private: |
| 69 // ui::AnimationDelegate overrides: | 73 // ui::AnimationDelegate overrides: |
| 70 virtual void AnimationEnded(const ui::Animation* animation); | 74 virtual void AnimationEnded(const ui::Animation* animation); |
| (...skipping 12 matching lines...) Expand all Loading... |
| 83 bool close_on_esc_; | 87 bool close_on_esc_; |
| 84 | 88 |
| 85 // The screen point where this bubble's arrow is anchored. | 89 // The screen point where this bubble's arrow is anchored. |
| 86 gfx::Point anchor_point_; | 90 gfx::Point anchor_point_; |
| 87 | 91 |
| 88 // The arrow's location on the bubble. | 92 // The arrow's location on the bubble. |
| 89 BubbleBorder::ArrowLocation arrow_location_; | 93 BubbleBorder::ArrowLocation arrow_location_; |
| 90 | 94 |
| 91 // The background color of the bubble. | 95 // The background color of the bubble. |
| 92 SkColor color_; | 96 SkColor color_; |
| 97 |
| 98 // Original opacity of the bubble. |
| 99 int original_opacity_; |
| 93 }; | 100 }; |
| 94 | 101 |
| 95 } // namespace views | 102 } // namespace views |
| 96 | 103 |
| 97 #endif // VIEWS_BUBBLE_BUBBLE_DELEGATE_H_ | 104 #endif // VIEWS_BUBBLE_BUBBLE_DELEGATE_H_ |
| OLD | NEW |