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 CHROME_BROWSER_UI_VIEWS_BROWSER_BUBBLE_H_ | 5 #ifndef CHROME_BROWSER_UI_VIEWS_BROWSER_BUBBLE_H_ |
6 #define CHROME_BROWSER_UI_VIEWS_BROWSER_BUBBLE_H_ | 6 #define CHROME_BROWSER_UI_VIEWS_BROWSER_BUBBLE_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include "chrome/browser/ui/views/bubble/bubble_border.h" | 9 #include "chrome/browser/ui/views/bubble/bubble_border.h" |
10 #include "views/view.h" | 10 #include "views/view.h" |
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
66 void set_delegate(Delegate* del) { delegate_ = del; } | 66 void set_delegate(Delegate* del) { delegate_ = del; } |
67 | 67 |
68 // Notifications from BrowserBubbleHost. | 68 // Notifications from BrowserBubbleHost. |
69 // With no delegate, both of these default to Hiding the bubble. | 69 // With no delegate, both of these default to Hiding the bubble. |
70 virtual void BrowserWindowMoved(); | 70 virtual void BrowserWindowMoved(); |
71 virtual void BrowserWindowClosing(); | 71 virtual void BrowserWindowClosing(); |
72 | 72 |
73 // Show or hide the bubble. | 73 // Show or hide the bubble. |
74 virtual void Show(bool activate); | 74 virtual void Show(bool activate); |
75 virtual void Hide(); | 75 virtual void Hide(); |
76 bool visible() const { return visible_; } | |
77 | 76 |
78 // The contained view. | 77 // The contained view. |
79 views::View* view() const { return view_; } | 78 views::View* view() const { return view_; } |
80 | 79 |
81 // Set the bounds of the bubble relative to the browser window. | 80 // Set the bounds of the bubble relative to the browser window. |
82 void SetBounds(int x, int y, int w, int h); | 81 void SetBounds(int x, int y, int w, int h); |
83 void MoveTo(int x, int y); | 82 void MoveTo(int x, int y); |
84 int width() { return bounds_.width(); } | 83 int width() { return bounds_.width(); } |
85 int height() { return bounds_.height(); } | 84 int height() { return bounds_.height(); } |
86 const gfx::Rect& bounds() const { return bounds_; } | 85 const gfx::Rect& bounds() const { return bounds_; } |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
120 | 119 |
121 // Anchor rect that this bubble is shown relative to, in frame coordinates. | 120 // Anchor rect that this bubble is shown relative to, in frame coordinates. |
122 gfx::Rect relative_to_; | 121 gfx::Rect relative_to_; |
123 | 122 |
124 // Arrow location of this bubble. | 123 // Arrow location of this bubble. |
125 BubbleBorder::ArrowLocation arrow_location_; | 124 BubbleBorder::ArrowLocation arrow_location_; |
126 | 125 |
127 // The bounds relative to the frame. | 126 // The bounds relative to the frame. |
128 gfx::Rect bounds_; | 127 gfx::Rect bounds_; |
129 | 128 |
130 // Current visibility. | |
131 bool visible_; | |
132 | |
133 // The delegate isn't owned by the bubble. | 129 // The delegate isn't owned by the bubble. |
134 Delegate* delegate_; | 130 Delegate* delegate_; |
135 | 131 |
136 // Is the bubble attached to a Browser window. | 132 // Is the bubble attached to a Browser window. |
137 bool attached_; | 133 bool attached_; |
138 | 134 |
139 // Non-owning pointer to the host of this bubble. | 135 // Non-owning pointer to the host of this bubble. |
140 BrowserBubbleHost* bubble_host_; | 136 BrowserBubbleHost* bubble_host_; |
141 | 137 |
142 DISALLOW_COPY_AND_ASSIGN(BrowserBubble); | 138 DISALLOW_COPY_AND_ASSIGN(BrowserBubble); |
143 }; | 139 }; |
144 | 140 |
145 #endif // CHROME_BROWSER_UI_VIEWS_BROWSER_BUBBLE_H_ | 141 #endif // CHROME_BROWSER_UI_VIEWS_BROWSER_BUBBLE_H_ |
OLD | NEW |