OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 CHROME_BROWSER_VIEWS_INFO_BUBBLE_H_ | 5 #ifndef CHROME_BROWSER_VIEWS_INFO_BUBBLE_H_ |
6 #define CHROME_BROWSER_VIEWS_INFO_BUBBLE_H_ | 6 #define CHROME_BROWSER_VIEWS_INFO_BUBBLE_H_ |
7 | 7 |
8 #include "app/slide_animation.h" | 8 #include "app/slide_animation.h" |
9 #include "third_party/skia/include/core/SkColor.h" | 9 #include "third_party/skia/include/core/SkColor.h" |
10 #include "views/accelerator.h" | 10 #include "views/accelerator.h" |
(...skipping 178 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
189 // You may provide an optional |delegate| to: | 189 // You may provide an optional |delegate| to: |
190 // - Be notified when the InfoBubble is closed. | 190 // - Be notified when the InfoBubble is closed. |
191 // - Prevent the InfoBubble from being closed when the Escape key is | 191 // - Prevent the InfoBubble from being closed when the Escape key is |
192 // pressed (the default behavior). | 192 // pressed (the default behavior). |
193 static InfoBubble* Show(views::Widget* parent, | 193 static InfoBubble* Show(views::Widget* parent, |
194 const gfx::Rect& position_relative_to, | 194 const gfx::Rect& position_relative_to, |
195 BubbleBorder::ArrowLocation arrow_location, | 195 BubbleBorder::ArrowLocation arrow_location, |
196 views::View* contents, | 196 views::View* contents, |
197 InfoBubbleDelegate* delegate); | 197 InfoBubbleDelegate* delegate); |
198 | 198 |
| 199 #if defined(OS_CHROMEOS) |
| 200 // Shows the InfoBubble not grabbing the focus. Others are the same as above. |
| 201 // TYPE_POPUP widget is used to achieve the focusless effect. |
| 202 static InfoBubble* ShowFocusless(views::Widget* parent, |
| 203 const gfx::Rect& position_relative_to, |
| 204 BubbleBorder::ArrowLocation arrow_location, |
| 205 views::View* contents, |
| 206 InfoBubbleDelegate* delegate); |
| 207 #endif |
| 208 |
199 // Resizes and potentially moves the InfoBubble to best accommodate the | 209 // Resizes and potentially moves the InfoBubble to best accommodate the |
200 // contents preferred size. | 210 // contents preferred size. |
201 void SizeToContents(); | 211 void SizeToContents(); |
202 | 212 |
203 // Whether the InfoBubble should fade away when it closes. Generally speaking, | 213 // Whether the InfoBubble should fade away when it closes. Generally speaking, |
204 // we use FadeOut when the user selects something within the bubble that | 214 // we use FadeOut when the user selects something within the bubble that |
205 // causes the bubble to dismiss. We don't use it when the bubble gets | 215 // causes the bubble to dismiss. We don't use it when the bubble gets |
206 // deactivated as a result of clicking outside the bubble. | 216 // deactivated as a result of clicking outside the bubble. |
207 void set_fade_away_on_close(bool fade_away_on_close) { | 217 void set_fade_away_on_close(bool fade_away_on_close) { |
208 fade_away_on_close_ = fade_away_on_close; | 218 fade_away_on_close_ = fade_away_on_close; |
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
287 | 297 |
288 gfx::Rect position_relative_to_; | 298 gfx::Rect position_relative_to_; |
289 BubbleBorder::ArrowLocation arrow_location_; | 299 BubbleBorder::ArrowLocation arrow_location_; |
290 | 300 |
291 views::View* contents_; | 301 views::View* contents_; |
292 | 302 |
293 DISALLOW_COPY_AND_ASSIGN(InfoBubble); | 303 DISALLOW_COPY_AND_ASSIGN(InfoBubble); |
294 }; | 304 }; |
295 | 305 |
296 #endif // CHROME_BROWSER_VIEWS_INFO_BUBBLE_H_ | 306 #endif // CHROME_BROWSER_VIEWS_INFO_BUBBLE_H_ |
OLD | NEW |