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

Unified Diff: chrome/browser/gtk/toolbar_star_toggle_gtk.cc

Issue 100203: Implement a mostly working InfoBubble with a shim BookmarkBubble. (Closed)
Patch Set: Comments Created 11 years, 8 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/gtk/toolbar_star_toggle_gtk.cc
diff --git a/chrome/browser/gtk/toolbar_star_toggle_gtk.cc b/chrome/browser/gtk/toolbar_star_toggle_gtk.cc
index e6edf244bb4f9dcc2e0e438cb25370f343c75067..92cfc1663c1db5ae93fc9253c5115ce945694829 100644
--- a/chrome/browser/gtk/toolbar_star_toggle_gtk.cc
+++ b/chrome/browser/gtk/toolbar_star_toggle_gtk.cc
@@ -4,6 +4,8 @@
#include "chrome/browser/gtk/toolbar_star_toggle_gtk.h"
+#include "base/gfx/rect.h"
+#include "chrome/browser/gtk/bookmark_bubble_gtk.h"
#include "chrome/common/resource_bundle.h"
#include "grit/theme_resources.h"
@@ -27,6 +29,22 @@ ToolbarStarToggleGtk::~ToolbarStarToggleGtk() {
widget_.Destroy();
}
+void ToolbarStarToggleGtk::ShowStarBubble(const GURL& url,
+ bool newly_bookmarked) {
+ GtkWidget* widget = widget_.get();
+ gint x, y;
ecattell 2009/04/30 19:55:37 Please initialize basic types (like ints)
Dean McNamee 2009/05/01 15:01:46 It is initialized on the next line, do you still t
+ gdk_window_get_origin(widget->window, &x, &y);
+ x += widget->allocation.x;
+ y += widget->allocation.y;
+ gint width = widget->allocation.width;
+ gint height = widget->allocation.height;
+
+ BookmarkBubbleGtk::Show(gfx::Rect(x, y, width, height),
+ NULL,
+ url,
+ newly_bookmarked);
+}
+
void ToolbarStarToggleGtk::SetStarred(bool starred) {
is_starred_ = starred;
gtk_widget_queue_draw(widget_.get());

Powered by Google App Engine
This is Rietveld 408576698