| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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_UI_GTK_GLOBAL_MENU_BAR_H_ | 5 #ifndef CHROME_BROWSER_UI_GTK_GLOBAL_MENU_BAR_H_ |
| 6 #define CHROME_BROWSER_UI_GTK_GLOBAL_MENU_BAR_H_ | 6 #define CHROME_BROWSER_UI_GTK_GLOBAL_MENU_BAR_H_ |
| 7 | 7 |
| 8 #include <map> | 8 #include <map> |
| 9 | 9 |
| 10 #include "chrome/browser/command_updater.h" | 10 #include "chrome/browser/command_updater.h" |
| 11 #include "chrome/browser/ui/gtk/global_bookmark_menu.h" | 11 #include "chrome/browser/ui/gtk/global_bookmark_menu.h" |
| 12 #include "chrome/browser/ui/gtk/global_history_menu.h" | 12 #include "chrome/browser/ui/gtk/global_history_menu.h" |
| 13 #include "chrome/browser/ui/gtk/owned_widget_gtk.h" | |
| 14 #include "content/common/notification_observer.h" | 13 #include "content/common/notification_observer.h" |
| 15 #include "content/common/notification_registrar.h" | 14 #include "content/common/notification_registrar.h" |
| 16 #include "ui/base/gtk/gtk_signal.h" | 15 #include "ui/base/gtk/gtk_signal.h" |
| 16 #include "ui/base/gtk/owned_widget_gtk.h" |
| 17 | 17 |
| 18 class Browser; | 18 class Browser; |
| 19 struct GlobalMenuBarCommand; | 19 struct GlobalMenuBarCommand; |
| 20 class GlobalMenuOwner; | 20 class GlobalMenuOwner; |
| 21 | 21 |
| 22 typedef struct _GtkAccelGroup GtkAccelGroup; | 22 typedef struct _GtkAccelGroup GtkAccelGroup; |
| 23 typedef struct _GtkWidget GtkWidget; | 23 typedef struct _GtkWidget GtkWidget; |
| 24 | 24 |
| 25 // Controls the Mac style menu bar on Linux. | 25 // Controls the Mac style menu bar on Linux. |
| 26 // | 26 // |
| (...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 73 const NotificationSource& source, | 73 const NotificationSource& source, |
| 74 const NotificationDetails& details); | 74 const NotificationDetails& details); |
| 75 | 75 |
| 76 CHROMEGTK_CALLBACK_0(GlobalMenuBar, void, OnItemActivated); | 76 CHROMEGTK_CALLBACK_0(GlobalMenuBar, void, OnItemActivated); |
| 77 | 77 |
| 78 Browser* browser_; | 78 Browser* browser_; |
| 79 | 79 |
| 80 NotificationRegistrar registrar_; | 80 NotificationRegistrar registrar_; |
| 81 | 81 |
| 82 // Our menu bar widget. | 82 // Our menu bar widget. |
| 83 OwnedWidgetGtk menu_bar_; | 83 ui::OwnedWidgetGtk menu_bar_; |
| 84 | 84 |
| 85 // Listens to the TabRestoreService and the HistoryService and keeps the | 85 // Listens to the TabRestoreService and the HistoryService and keeps the |
| 86 // history menu fresh. | 86 // history menu fresh. |
| 87 GlobalHistoryMenu history_menu_; | 87 GlobalHistoryMenu history_menu_; |
| 88 | 88 |
| 89 // Listens to the bookmark model and updates the menu. | 89 // Listens to the bookmark model and updates the menu. |
| 90 scoped_ptr<GlobalBookmarkMenu> bookmark_menu_; | 90 scoped_ptr<GlobalBookmarkMenu> bookmark_menu_; |
| 91 | 91 |
| 92 // For some menu items, we want to show the accelerator, but not actually | 92 // For some menu items, we want to show the accelerator, but not actually |
| 93 // explicitly handle it. To this end we connect those menu items' accelerators | 93 // explicitly handle it. To this end we connect those menu items' accelerators |
| 94 // to this group, but don't attach this group to any top level window. | 94 // to this group, but don't attach this group to any top level window. |
| 95 GtkAccelGroup* dummy_accel_group_; | 95 GtkAccelGroup* dummy_accel_group_; |
| 96 | 96 |
| 97 // A mapping from command ids to GtkMenuItem objects. We use this to update | 97 // A mapping from command ids to GtkMenuItem objects. We use this to update |
| 98 // the command enable state. | 98 // the command enable state. |
| 99 CommandIDMenuItemMap id_to_menu_item_; | 99 CommandIDMenuItemMap id_to_menu_item_; |
| 100 | 100 |
| 101 // gtk_check_menu_item_set_active() will call the "activate" signal. We need | 101 // gtk_check_menu_item_set_active() will call the "activate" signal. We need |
| 102 // to block this activation while we change the checked state. | 102 // to block this activation while we change the checked state. |
| 103 bool block_activation_; | 103 bool block_activation_; |
| 104 }; | 104 }; |
| 105 | 105 |
| 106 #endif // CHROME_BROWSER_UI_GTK_GLOBAL_MENU_BAR_H_ | 106 #endif // CHROME_BROWSER_UI_GTK_GLOBAL_MENU_BAR_H_ |
| OLD | NEW |