Chromium Code Reviews| 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 #ifndef UI_VIEWS_BUBBLE_BUBBLE_DELEGATE_H_ | 5 #ifndef UI_VIEWS_BUBBLE_BUBBLE_DELEGATE_H_ |
| 6 #define UI_VIEWS_BUBBLE_BUBBLE_DELEGATE_H_ | 6 #define UI_VIEWS_BUBBLE_BUBBLE_DELEGATE_H_ |
| 7 | 7 |
| 8 #include "base/gtest_prod_util.h" | 8 #include "base/gtest_prod_util.h" |
| 9 #include "ui/base/animation/animation_delegate.h" | 9 #include "ui/base/animation/animation_delegate.h" |
| 10 #include "ui/views/bubble/bubble_border.h" | 10 #include "ui/views/bubble/bubble_border.h" |
| (...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 74 void set_margins(const gfx::Insets& margins) { margins_ = margins; } | 74 void set_margins(const gfx::Insets& margins) { margins_ = margins; } |
| 75 | 75 |
| 76 gfx::NativeView parent_window() const { return parent_window_; } | 76 gfx::NativeView parent_window() const { return parent_window_; } |
| 77 void set_parent_window(gfx::NativeView window) { parent_window_ = window; } | 77 void set_parent_window(gfx::NativeView window) { parent_window_ = window; } |
| 78 | 78 |
| 79 bool use_focusless() const { return use_focusless_; } | 79 bool use_focusless() const { return use_focusless_; } |
| 80 void set_use_focusless(bool use_focusless) { | 80 void set_use_focusless(bool use_focusless) { |
| 81 use_focusless_ = use_focusless; | 81 use_focusless_ = use_focusless; |
| 82 } | 82 } |
| 83 | 83 |
| 84 bool try_mirroring_arrow() { return try_mirroring_arrow_; } | |
| 85 void set_try_mirroring_arrow(bool try_mirroring_arrow) { | |
| 86 try_mirroring_arrow_ = try_mirroring_arrow; | |
| 87 } | |
| 84 // Get the arrow's anchor rect in screen space. | 88 // Get the arrow's anchor rect in screen space. |
|
msw
2012/07/25 23:11:56
nit: add a blank line above.
Mr4D (OOO till 08-26)
2012/07/26 01:17:20
Done.
| |
| 85 virtual gfx::Rect GetAnchorRect(); | 89 virtual gfx::Rect GetAnchorRect(); |
| 86 | 90 |
| 87 // Show the bubble's widget (and |border_widget_| on Windows). | 91 // Show the bubble's widget (and |border_widget_| on Windows). |
| 88 void Show(); | 92 void Show(); |
| 89 | 93 |
| 90 // Fade the bubble in or out via Widget transparency. | 94 // Fade the bubble in or out via Widget transparency. |
| 91 // Fade in calls Widget::Show; fade out calls Widget::Close upon completion. | 95 // Fade in calls Widget::Show; fade out calls Widget::Close upon completion. |
| 92 void StartFade(bool fade_in); | 96 void StartFade(bool fade_in); |
| 93 | 97 |
| 94 // Reset fade and opacity of bubble. Restore the opacity of the | 98 // Reset fade and opacity of bubble. Restore the opacity of the |
| (...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 161 // Original opacity of the bubble. | 165 // Original opacity of the bubble. |
| 162 int original_opacity_; | 166 int original_opacity_; |
| 163 | 167 |
| 164 // The widget hosting the border for this bubble (non-Aura Windows only). | 168 // The widget hosting the border for this bubble (non-Aura Windows only). |
| 165 Widget* border_widget_; | 169 Widget* border_widget_; |
| 166 | 170 |
| 167 // Create a popup window for focusless bubbles on Linux/ChromeOS. | 171 // Create a popup window for focusless bubbles on Linux/ChromeOS. |
| 168 // These bubbles are not interactive and should not gain focus. | 172 // These bubbles are not interactive and should not gain focus. |
| 169 bool use_focusless_; | 173 bool use_focusless_; |
| 170 | 174 |
| 175 // If set (default) the arrow will be mirrored if it helps to fit the menu | |
|
msw
2012/07/25 23:11:56
nit: remove "(default)" or explicitly state "(defa
Mr4D (OOO till 08-26)
2012/07/26 01:17:20
Done.
| |
| 176 // on the screen. | |
| 177 bool try_mirroring_arrow_; | |
| 178 | |
| 171 // Parent native window of the bubble. | 179 // Parent native window of the bubble. |
| 172 gfx::NativeView parent_window_; | 180 gfx::NativeView parent_window_; |
| 173 | 181 |
| 174 DISALLOW_COPY_AND_ASSIGN(BubbleDelegateView); | 182 DISALLOW_COPY_AND_ASSIGN(BubbleDelegateView); |
| 175 }; | 183 }; |
| 176 | 184 |
| 177 } // namespace views | 185 } // namespace views |
| 178 | 186 |
| 179 #endif // UI_VIEWS_BUBBLE_BUBBLE_DELEGATE_H_ | 187 #endif // UI_VIEWS_BUBBLE_BUBBLE_DELEGATE_H_ |
| OLD | NEW |