| 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 "base/gtest_prod_util.h" | 9 #include "base/gtest_prod_util.h" |
| 10 #include "ui/base/animation/animation_delegate.h" | 10 #include "ui/base/animation/animation_delegate.h" |
| (...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 83 void StartFade(bool fade_in); | 83 void StartFade(bool fade_in); |
| 84 | 84 |
| 85 // Reset fade and opacity of bubble. Restore the opacity of the | 85 // Reset fade and opacity of bubble. Restore the opacity of the |
| 86 // bubble to the setting before StartFade() was called. | 86 // bubble to the setting before StartFade() was called. |
| 87 void ResetFade(); | 87 void ResetFade(); |
| 88 | 88 |
| 89 protected: | 89 protected: |
| 90 // View overrides: | 90 // View overrides: |
| 91 virtual bool AcceleratorPressed(const ui::Accelerator& accelerator) OVERRIDE; | 91 virtual bool AcceleratorPressed(const ui::Accelerator& accelerator) OVERRIDE; |
| 92 | 92 |
| 93 // ui::AnimationDelegate overrides: |
| 94 virtual void AnimationEnded(const ui::Animation* animation) OVERRIDE; |
| 95 virtual void AnimationProgressed(const ui::Animation* animation) OVERRIDE; |
| 96 |
| 93 // Perform view initialization on the contents for bubble sizing. | 97 // Perform view initialization on the contents for bubble sizing. |
| 94 virtual void Init(); | 98 virtual void Init(); |
| 95 | 99 |
| 100 // Resizes and potentially moves the Bubble to best accommodate the |
| 101 // contents preferred size. |
| 102 void SizeToContents(); |
| 103 |
| 96 private: | 104 private: |
| 97 FRIEND_TEST_ALL_PREFIXES(BubbleFrameViewBasicTest, NonClientHitTest); | 105 FRIEND_TEST_ALL_PREFIXES(BubbleFrameViewBasicTest, NonClientHitTest); |
| 98 FRIEND_TEST_ALL_PREFIXES(BubbleDelegateTest, CreateDelegate); | 106 FRIEND_TEST_ALL_PREFIXES(BubbleDelegateTest, CreateDelegate); |
| 99 | 107 |
| 100 // ui::AnimationDelegate overrides: | |
| 101 virtual void AnimationEnded(const ui::Animation* animation); | |
| 102 virtual void AnimationProgressed(const ui::Animation* animation); | |
| 103 | |
| 104 BubbleFrameView* GetBubbleFrameView() const; | 108 BubbleFrameView* GetBubbleFrameView() const; |
| 105 | 109 |
| 106 // Get bubble bounds from the anchor point and client view's preferred size. | 110 // Get bubble bounds from the anchor point and client view's preferred size. |
| 107 gfx::Rect GetBubbleBounds(); | 111 gfx::Rect GetBubbleBounds(); |
| 108 | 112 |
| 109 #if defined(OS_WIN) && !defined(USE_AURA) | 113 #if defined(OS_WIN) && !defined(USE_AURA) |
| 110 // Initialize the border widget needed for Windows native control hosting. | |
| 111 void InitializeBorderWidget(Widget* parent_widget); | |
| 112 | |
| 113 // Get bounds for the Windows-only widget that hosts the bubble's contents. | 114 // Get bounds for the Windows-only widget that hosts the bubble's contents. |
| 114 gfx::Rect GetBubbleClientBounds() const; | 115 gfx::Rect GetBubbleClientBounds() const; |
| 115 #endif | 116 #endif |
| 116 | 117 |
| 117 // Fade animation for bubble. | 118 // Fade animation for bubble. |
| 118 scoped_ptr<ui::SlideAnimation> fade_animation_; | 119 scoped_ptr<ui::SlideAnimation> fade_animation_; |
| 119 | 120 |
| 120 // Flags controlling bubble closure on the escape key and deactivation. | 121 // Flags controlling bubble closure on the escape key and deactivation. |
| 121 bool close_on_esc_; | 122 bool close_on_esc_; |
| 122 bool close_on_deactivate_; | 123 bool close_on_deactivate_; |
| (...skipping 20 matching lines...) Expand all Loading... |
| 143 // Create a popup window for focusless bubbles on Linux/ChromeOS. | 144 // Create a popup window for focusless bubbles on Linux/ChromeOS. |
| 144 // These bubbles are not interactive and should not gain focus. | 145 // These bubbles are not interactive and should not gain focus. |
| 145 bool use_focusless_; | 146 bool use_focusless_; |
| 146 | 147 |
| 147 DISALLOW_COPY_AND_ASSIGN(BubbleDelegateView); | 148 DISALLOW_COPY_AND_ASSIGN(BubbleDelegateView); |
| 148 }; | 149 }; |
| 149 | 150 |
| 150 } // namespace views | 151 } // namespace views |
| 151 | 152 |
| 152 #endif // VIEWS_BUBBLE_BUBBLE_DELEGATE_H_ | 153 #endif // VIEWS_BUBBLE_BUBBLE_DELEGATE_H_ |
| OLD | NEW |