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

Side by Side Diff: chrome/browser/gtk/extension_shelf_gtk.h

Issue 159019: Begin work on extension shelf for Linux. (Closed)
Patch Set: Created 11 years, 5 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 unified diff | Download patch
« no previous file with comments | « chrome/browser/gtk/browser_window_gtk.cc ('k') | chrome/browser/gtk/extension_shelf_gtk.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright (c) 2009 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_GTK_EXTENSION_SHELF_GTK_H_
6 #define CHROME_BROWSER_GTK_EXTENSION_SHELF_GTK_H_
7
8 #include <gtk/gtk.h>
9
10 #include "base/scoped_ptr.h"
11 #include "chrome/browser/extensions/extension_shelf_model.h"
12 #include "chrome/common/notification_observer.h"
13 #include "chrome/common/notification_registrar.h"
14 #include "chrome/common/owned_widget_gtk.h"
15
16 class Browser;
17 class BrowserWindowGtk;
18 class CustomContainerButton;
19 class NineBox;
20 class Profile;
21 struct GtkThemeProvider;
22
23 class ExtensionShelfGtk : public ExtensionShelfModelObserver,
24 public NotificationObserver {
25 public:
26 ExtensionShelfGtk(Profile* profile, Browser* browser);
27 virtual ~ExtensionShelfGtk();
28
29 // Adds this GTK shelf into a sizing box.
30 void AddShelfToBox(GtkWidget* box);
31
32 // Change the visibility of the bookmarks bar. (Starts out hidden, per GTK's
33 // default behaviour).
34 void Show();
35 void Hide();
36
37 // ExtensionShelfModelObserver
38 virtual void ToolstripInsertedAt(ExtensionHost* toolstrip, int index);
39 virtual void ToolstripRemovingAt(ExtensionHost* toolstrip, int index);
40 virtual void ToolstripMoved(ExtensionHost* toolstrip,
41 int from_index,
42 int to_index);
43 virtual void ToolstripChangedAt(ExtensionHost* toolstrip, int index);
44 virtual void ExtensionShelfEmpty();
45 virtual void ShelfModelReloaded();
46
47 private:
48 // Create the contents of the extension shelf.
49 void Init(Profile* profile);
50
51 // Overridden from NotificationObserver:
52 virtual void Observe(NotificationType type,
53 const NotificationSource& source,
54 const NotificationDetails& details);
55
56 // Loads the background image into memory, or does nothing if already loaded.
57 void InitBackground();
58
59 // Determines what is our target height and sets it.
60 void AdjustHeight();
61
62 // GtkHBox callbacks.
63 static gboolean OnHBoxExpose(GtkWidget* widget, GdkEventExpose* event,
64 ExtensionShelfGtk* window);
65
66 Browser* browser_;
67
68 // Contains |shelf_hbox_|. Event box exists to prevent leakage of
69 // background color from the toplevel application window's GDK window.
70 OwnedWidgetGtk event_box_;
71
72 // Used to position all children.
73 GtkWidget* shelf_hbox_;
74
75 // Label for placeholder text.
76 // TODO(phajdan.jr): Remove the placeholder label when we have real contents.
77 GtkWidget* label_;
78
79 GtkThemeProvider* theme_provider_;
80
81 // Paints the background for our bookmark bar.
82 scoped_ptr<NineBox> background_ninebox_;
83
84 NotificationRegistrar registrar_;
85
86 // The model representing the toolstrips on the shelf.
87 scoped_ptr<ExtensionShelfModel> model_;
88 };
89
90 #endif // CHROME_BROWSER_EXTENSION_SHELF_GTK_H_
OLDNEW
« no previous file with comments | « chrome/browser/gtk/browser_window_gtk.cc ('k') | chrome/browser/gtk/extension_shelf_gtk.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698