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

Unified Diff: chrome/browser/ui/gtk/script_bubble_gtk.h

Issue 11348304: Implement script bubble for GTK. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: ok Created 8 years, 1 month 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
« no previous file with comments | « chrome/browser/ui/gtk/location_bar_view_gtk.cc ('k') | chrome/browser/ui/gtk/script_bubble_gtk.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/gtk/script_bubble_gtk.h
diff --git a/chrome/browser/ui/gtk/script_bubble_gtk.h b/chrome/browser/ui/gtk/script_bubble_gtk.h
new file mode 100644
index 0000000000000000000000000000000000000000..d8a73860880623466243b85f362b348d6e1c1ffc
--- /dev/null
+++ b/chrome/browser/ui/gtk/script_bubble_gtk.h
@@ -0,0 +1,70 @@
+// Copyright (c) 2012 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef CHROME_BROWSER_UI_GTK_SCRIPT_BUBBLE_GTK_H_
+#define CHROME_BROWSER_UI_GTK_SCRIPT_BUBBLE_GTK_H_
+
+#include <map>
+
+#include "base/compiler_specific.h"
+#include "base/memory/scoped_ptr.h"
+#include "base/memory/weak_ptr.h"
+#include "chrome/browser/ui/gtk/bubble/bubble_gtk.h"
+#include "chrome/common/content_settings_types.h"
+#include "content/public/browser/notification_observer.h"
+#include "content/public/browser/notification_registrar.h"
+#include "ui/base/gtk/gtk_signal.h"
+#include "ui/gfx/image/image.h"
+
+class ContentSettingBubbleModel;
+class Profile;
+
+namespace content {
+class WebContents;
+}
+
+// A bubble that is displayed to show users when extensions are interacting
+// with the current page.
+class ScriptBubbleGtk : public BubbleDelegateGtk {
+ public:
+ static void Show(GtkWidget* anchor, content::WebContents* web_contents);
+
+ private:
+ void Close();
+
+ virtual ~ScriptBubbleGtk();
+
+ ScriptBubbleGtk(GtkWidget* anchor, content::WebContents* web_contents);
+
+ // BubbleDelegateGtk:
+ virtual void BubbleClosing(BubbleGtk* bubble, bool closed_by_escape) OVERRIDE;
+
+ // Builds the bubble and all the widgets that it displays.
+ void BuildBubble();
+
+ void OnIconLoaded(const std::string& extension_id, const gfx::Image& icon);
+
+ // Widget callback methods.
+ static void OnItemLinkClickedThunk(GtkWidget* sender, void* user_data);
+ void OnItemLinkClicked(GtkWidget* sender);
+
+ // We position the bubble near this widget.
+ GtkWidget* anchor_;
+
+ // The WebContents we're being displayed for.
+ content::WebContents* web_contents_;
+
+ // The active profile.
+ Profile* profile_;
+
+ // The bubble.
+ BubbleGtk* bubble_;
+
+ std::map<std::string, GtkImage*> icon_controls_;
+ std::map<GtkWidget*, std::string> link_controls_;
+
+ base::WeakPtrFactory<ScriptBubbleGtk> weak_ptr_factory_;
+};
+
+#endif // CHROME_BROWSER_UI_GTK_SCRIPT_BUBBLE_GTK_H_
« no previous file with comments | « chrome/browser/ui/gtk/location_bar_view_gtk.cc ('k') | chrome/browser/ui/gtk/script_bubble_gtk.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698