Disable TabDragController tests that fail with a real compositor.
[chromium-blink-merge.git] / chrome / browser / ui / gtk / script_bubble_gtk.h
blobd8a73860880623466243b85f362b348d6e1c1ffc
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_
8 #include <map>
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;
21 class Profile;
23 namespace content {
24 class WebContents;
27 // A bubble that is displayed to show users when extensions are interacting
28 // with the current page.
29 class ScriptBubbleGtk : public BubbleDelegateGtk {
30 public:
31 static void Show(GtkWidget* anchor, content::WebContents* web_contents);
33 private:
34 void Close();
36 virtual ~ScriptBubbleGtk();
38 ScriptBubbleGtk(GtkWidget* anchor, content::WebContents* web_contents);
40 // BubbleDelegateGtk:
41 virtual void BubbleClosing(BubbleGtk* bubble, bool closed_by_escape) OVERRIDE;
43 // Builds the bubble and all the widgets that it displays.
44 void BuildBubble();
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.
53 GtkWidget* anchor_;
55 // The WebContents we're being displayed for.
56 content::WebContents* web_contents_;
58 // The active profile.
59 Profile* profile_;
61 // The bubble.
62 BubbleGtk* bubble_;
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_