Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(180)

Side by Side Diff: chrome/browser/views/info_bubble.h

Issue 177026: Make the views bookmark bubble work on GTK.... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 11 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2006-2008 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 "views/view.h" 9 #include "views/view.h"
10 10
(...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after
140 140
141 // Returns true if the arrow is positioned along the top edge of the 141 // Returns true if the arrow is positioned along the top edge of the
142 // view. If this returns false the arrow is positioned along the bottom 142 // view. If this returns false the arrow is positioned along the bottom
143 // edge. 143 // edge.
144 bool IsTop() { return (arrow_edge_ & 2) == 0; } 144 bool IsTop() { return (arrow_edge_ & 2) == 0; }
145 145
146 // Returns true if the arrow is positioned along the left edge of the 146 // Returns true if the arrow is positioned along the left edge of the
147 // view. If this returns false the arrow is positioned along the right edge. 147 // view. If this returns false the arrow is positioned along the right edge.
148 bool IsLeft() { return (arrow_edge_ & 1) == 0; } 148 bool IsLeft() { return (arrow_edge_ & 1) == 0; }
149 149
150 virtual void ViewHierarchyChanged(bool is_add, View* parent, View* child);
151
150 private: 152 private:
151
152 // Returns the bounds for the window containing us based on the current 153 // Returns the bounds for the window containing us based on the current
153 // arrow edge. 154 // arrow edge.
154 gfx::Rect CalculateWindowBounds(const gfx::Rect& position_relative_to); 155 gfx::Rect CalculateWindowBounds(const gfx::Rect& position_relative_to);
155 156
157 views::View* content_;
158
156 // Edge to draw the arrow at. 159 // Edge to draw the arrow at.
157 ArrowEdge arrow_edge_; 160 ArrowEdge arrow_edge_;
158 161
159 // The bubble we're in. 162 // The bubble we're in.
160 InfoBubble* host_; 163 InfoBubble* host_;
161 164
162 DISALLOW_COPY_AND_ASSIGN(ContentView); 165 DISALLOW_COPY_AND_ASSIGN(ContentView);
163 }; 166 };
164 167
165 // Creates and return a new ContentView containing content. 168 // Creates and return a new ContentView containing content.
166 virtual ContentView* CreateContentView(views::View* content); 169 virtual ContentView* CreateContentView(views::View* content);
167 170
168 private: 171 private:
169 // Closes the window notifying the delegate. |closed_by_escape| is true if 172 // Closes the window notifying the delegate. |closed_by_escape| is true if
170 // the close is the result of pressing escape. 173 // the close is the result of pressing escape.
171 void Close(bool closed_by_escape); 174 void Close(bool closed_by_escape);
172 175
176 #if defined(OS_LINUX)
177 // Overridden from WidgetGtk.
178 virtual void OnSizeAllocate(GtkWidget* widget, GtkAllocation* allocation);
179 #endif
180
173 // The delegate notified when the InfoBubble is closed. 181 // The delegate notified when the InfoBubble is closed.
174 InfoBubbleDelegate* delegate_; 182 InfoBubbleDelegate* delegate_;
175 183
176 // The window that this InfoBubble is parented to. 184 // The window that this InfoBubble is parented to.
177 views::Window* parent_; 185 views::Window* parent_;
178 186
179 // The content view contained by the infobubble. 187 // The content view contained by the infobubble.
180 ContentView* content_view_; 188 ContentView* content_view_;
181 189
182 // The fade-in animation. 190 // The fade-in animation.
183 scoped_ptr<SlideAnimation> fade_animation_; 191 scoped_ptr<SlideAnimation> fade_animation_;
184 192
185 // Have we been closed? 193 // Have we been closed?
186 bool closed_; 194 bool closed_;
187 195
188 DISALLOW_COPY_AND_ASSIGN(InfoBubble); 196 DISALLOW_COPY_AND_ASSIGN(InfoBubble);
189 }; 197 };
190 198
191 #endif // CHROME_BROWSER_VIEWS_INFO_BUBBLE_H_ 199 #endif // CHROME_BROWSER_VIEWS_INFO_BUBBLE_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698