1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #ifndef CHROME_BROWSER_UI_GTK_SCRIPT_BUBBLE_GTK_H_
6 #define CHROME_BROWSER_UI_GTK_SCRIPT_BUBBLE_GTK_H_
10 #include "base/compiler_specific.h"
11 #include "base/memory/scoped_ptr.h"
12 #include "base/memory/weak_ptr.h"
13 #include "chrome/browser/ui/gtk/bubble/bubble_gtk.h"
14 #include "chrome/common/content_settings_types.h"
15 #include "content/public/browser/notification_observer.h"
16 #include "content/public/browser/notification_registrar.h"
17 #include "ui/base/gtk/gtk_signal.h"
18 #include "ui/gfx/image/image.h"
20 class ContentSettingBubbleModel
;
27 // A bubble that is displayed to show users when extensions are interacting
28 // with the current page.
29 class ScriptBubbleGtk
: public BubbleDelegateGtk
{
31 static void Show(GtkWidget
* anchor
, content::WebContents
* web_contents
);
36 virtual ~ScriptBubbleGtk();
38 ScriptBubbleGtk(GtkWidget
* anchor
, content::WebContents
* web_contents
);
41 virtual void BubbleClosing(BubbleGtk
* bubble
, bool closed_by_escape
) OVERRIDE
;
43 // Builds the bubble and all the widgets that it displays.
46 void OnIconLoaded(const std::string
& extension_id
, const gfx::Image
& icon
);
48 // Widget callback methods.
49 static void OnItemLinkClickedThunk(GtkWidget
* sender
, void* user_data
);
50 void OnItemLinkClicked(GtkWidget
* sender
);
52 // We position the bubble near this widget.
55 // The WebContents we're being displayed for.
56 content::WebContents
* web_contents_
;
58 // The active profile.
64 std::map
<std::string
, GtkImage
*> icon_controls_
;
65 std::map
<GtkWidget
*, std::string
> link_controls_
;
67 base::WeakPtrFactory
<ScriptBubbleGtk
> weak_ptr_factory_
;
70 #endif // CHROME_BROWSER_UI_GTK_SCRIPT_BUBBLE_GTK_H_