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

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

Issue 306044: Refactor implementation of BrowserActions, and add support for (Closed)
Patch Set: Make it work on linux too Created 11 years, 2 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
OLDNEW
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. 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 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef CHROME_BROWSER_GTK_BROWSER_ACTIONS_TOOLBAR_GTK_H_ 5 #ifndef CHROME_BROWSER_GTK_BROWSER_ACTIONS_TOOLBAR_GTK_H_
6 #define CHROME_BROWSER_GTK_BROWSER_ACTIONS_TOOLBAR_GTK_H_ 6 #define CHROME_BROWSER_GTK_BROWSER_ACTIONS_TOOLBAR_GTK_H_
7 7
8 #include <map> 8 #include <map>
9 #include <string> 9 #include <string>
10 10
(...skipping 11 matching lines...) Expand all
22 22
23 class BrowserActionsToolbarGtk : public NotificationObserver { 23 class BrowserActionsToolbarGtk : public NotificationObserver {
24 public: 24 public:
25 explicit BrowserActionsToolbarGtk(Browser* browser); 25 explicit BrowserActionsToolbarGtk(Browser* browser);
26 ~BrowserActionsToolbarGtk(); 26 ~BrowserActionsToolbarGtk();
27 27
28 GtkWidget* widget() { return hbox_.get(); } 28 GtkWidget* widget() { return hbox_.get(); }
29 29
30 int button_count() { return extension_button_map_.size(); } 30 int button_count() { return extension_button_map_.size(); }
31 31
32 Browser* browser() { return browser_; }
33
34 // Returns the currently selected tab ID, or -1 if there is none.
35 int GetCurrentTabId();
36
37 // Update the display of all buttons.
38 void Update();
39
32 // NotificationObserver implementation. 40 // NotificationObserver implementation.
33 void Observe(NotificationType type, 41 void Observe(NotificationType type,
34 const NotificationSource& source, 42 const NotificationSource& source,
35 const NotificationDetails& details); 43 const NotificationDetails& details);
36 44
37 private: 45 private:
38 // Query the extensions service for all extensions with browser actions, 46 // Query the extensions service for all extensions with browser actions,
39 // and create the UI for them. 47 // and create the UI for them.
40 void CreateAllButtons(); 48 void CreateAllButtons();
41 49
(...skipping 14 matching lines...) Expand all
56 64
57 Profile* profile_; 65 Profile* profile_;
58 66
59 OwnedWidgetGtk hbox_; 67 OwnedWidgetGtk hbox_;
60 68
61 NotificationRegistrar registrar_; 69 NotificationRegistrar registrar_;
62 70
63 // Map from extension ID to BrowserActionButton, which is a wrapper for 71 // Map from extension ID to BrowserActionButton, which is a wrapper for
64 // a chrome button and related functionality. There should be one entry 72 // a chrome button and related functionality. There should be one entry
65 // for every extension that has a browser action. 73 // for every extension that has a browser action.
66 std::map<std::string, linked_ptr<BrowserActionButton> > extension_button_map_; 74 typedef std::map<std::string, linked_ptr<BrowserActionButton> >
75 ExtensionButtonMap;
76 ExtensionButtonMap extension_button_map_;
67 77
68 DISALLOW_COPY_AND_ASSIGN(BrowserActionsToolbarGtk); 78 DISALLOW_COPY_AND_ASSIGN(BrowserActionsToolbarGtk);
69 }; 79 };
70 80
71 #endif // CHROME_BROWSER_GTK_BROWSER_ACTIONS_TOOLBAR_GTK_H_ 81 #endif // CHROME_BROWSER_GTK_BROWSER_ACTIONS_TOOLBAR_GTK_H_
OLDNEW
« no previous file with comments | « chrome/browser/extensions/extensions_service.cc ('k') | chrome/browser/gtk/browser_actions_toolbar_gtk.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698