| 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 "base/memory/scoped_ptr.h" | 10 #include "base/memory/scoped_ptr.h" |
| 11 #include "chrome/browser/command_updater.h" | 11 #include "chrome/browser/command_updater.h" |
| 12 #include "chrome/browser/prefs/pref_change_registrar.h" | 12 #include "chrome/browser/prefs/pref_change_registrar.h" |
| 13 #include "chrome/browser/ui/gtk/global_history_menu.h" | 13 #include "chrome/browser/ui/gtk/global_history_menu.h" |
| 14 #include "content/common/notification_observer.h" | 14 #include "content/common/notification_observer.h" |
| 15 #include "ui/base/gtk/gtk_signal.h" | 15 #include "ui/base/gtk/gtk_signal.h" |
| 16 #include "ui/base/gtk/owned_widget_gtk.h" | 16 #include "ui/base/gtk/owned_widget_gtk.h" |
| 17 | 17 |
| 18 class Browser; | 18 class Browser; |
| 19 class GlobalBookmarkMenu; | |
| 20 struct GlobalMenuBarCommand; | 19 struct GlobalMenuBarCommand; |
| 21 class GlobalMenuOwner; | 20 class GlobalMenuOwner; |
| 22 | 21 |
| 23 typedef struct _GtkAccelGroup GtkAccelGroup; | 22 typedef struct _GtkAccelGroup GtkAccelGroup; |
| 24 typedef struct _GtkWidget GtkWidget; | 23 typedef struct _GtkWidget GtkWidget; |
| 25 | 24 |
| 26 // Controls the Mac style menu bar on Linux. | 25 // Controls the Mac style menu bar on Linux. |
| 27 // | 26 // |
| 28 // Unity and some configurations of GNOME have a Apple-like menu bar at the top | 27 // Unity and some configurations of GNOME have a Apple-like menu bar at the top |
| 29 // of the screen that changes depending on the active window. These mainly work | 28 // of the screen that changes depending on the active window. These mainly work |
| (...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 84 // Tracks value of the kShowBookmarkBar preference. | 83 // Tracks value of the kShowBookmarkBar preference. |
| 85 PrefChangeRegistrar pref_change_registrar_; | 84 PrefChangeRegistrar pref_change_registrar_; |
| 86 | 85 |
| 87 // Our menu bar widget. | 86 // Our menu bar widget. |
| 88 ui::OwnedWidgetGtk menu_bar_; | 87 ui::OwnedWidgetGtk menu_bar_; |
| 89 | 88 |
| 90 // Listens to the TabRestoreService and the HistoryService and keeps the | 89 // Listens to the TabRestoreService and the HistoryService and keeps the |
| 91 // history menu fresh. | 90 // history menu fresh. |
| 92 GlobalHistoryMenu history_menu_; | 91 GlobalHistoryMenu history_menu_; |
| 93 | 92 |
| 94 // Listens to the bookmark model and updates the menu. | |
| 95 scoped_ptr<GlobalBookmarkMenu> bookmark_menu_; | |
| 96 | |
| 97 // For some menu items, we want to show the accelerator, but not actually | 93 // For some menu items, we want to show the accelerator, but not actually |
| 98 // explicitly handle it. To this end we connect those menu items' accelerators | 94 // explicitly handle it. To this end we connect those menu items' accelerators |
| 99 // to this group, but don't attach this group to any top level window. | 95 // to this group, but don't attach this group to any top level window. |
| 100 GtkAccelGroup* dummy_accel_group_; | 96 GtkAccelGroup* dummy_accel_group_; |
| 101 | 97 |
| 102 // A mapping from command ids to GtkMenuItem objects. We use this to update | 98 // A mapping from command ids to GtkMenuItem objects. We use this to update |
| 103 // the command enable state. | 99 // the command enable state. |
| 104 CommandIDMenuItemMap id_to_menu_item_; | 100 CommandIDMenuItemMap id_to_menu_item_; |
| 105 | 101 |
| 106 // gtk_check_menu_item_set_active() will call the "activate" signal. We need | 102 // gtk_check_menu_item_set_active() will call the "activate" signal. We need |
| 107 // to block this activation while we change the checked state. | 103 // to block this activation while we change the checked state. |
| 108 bool block_activation_; | 104 bool block_activation_; |
| 109 }; | 105 }; |
| 110 | 106 |
| 111 #endif // CHROME_BROWSER_UI_GTK_GLOBAL_MENU_BAR_H_ | 107 #endif // CHROME_BROWSER_UI_GTK_GLOBAL_MENU_BAR_H_ |
| OLD | NEW |