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

Side by Side 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 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
(Empty)
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.
4
5 #ifndef CHROME_BROWSER_UI_GTK_SCRIPT_BUBBLE_GTK_H_
6 #define CHROME_BROWSER_UI_GTK_SCRIPT_BUBBLE_GTK_H_
7
8 #include <map>
9
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"
19
20 class ContentSettingBubbleModel;
21 class Profile;
22
23 namespace content {
24 class WebContents;
25 }
26
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);
32
33 private:
34 void Close();
35
36 virtual ~ScriptBubbleGtk();
37
38 ScriptBubbleGtk(GtkWidget* anchor, content::WebContents* web_contents);
39
40 // BubbleDelegateGtk:
41 virtual void BubbleClosing(BubbleGtk* bubble, bool closed_by_escape) OVERRIDE;
42
43 // Builds the bubble and all the widgets that it displays.
44 void BuildBubble();
45
46 void OnIconLoaded(const std::string& extension_id, const gfx::Image& icon);
47
48 // Widget callback methods.
49 static void OnItemLinkClickedThunk(GtkWidget* sender, void* user_data);
50 void OnItemLinkClicked(GtkWidget* sender);
51
52 // We position the bubble near this widget.
53 GtkWidget* anchor_;
54
55 // The WebContents we're being displayed for.
56 content::WebContents* web_contents_;
57
58 // The active profile.
59 Profile* profile_;
60
61 // The bubble.
62 BubbleGtk* bubble_;
63
64 std::map<std::string, GtkImage*> icon_controls_;
65 std::map<GtkWidget*, std::string> link_controls_;
66
67 base::WeakPtrFactory<ScriptBubbleGtk> weak_ptr_factory_;
68 };
69
70 #endif // CHROME_BROWSER_UI_GTK_SCRIPT_BUBBLE_GTK_H_
OLDNEW
« 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