| Index: chrome/browser/ui/gtk/global_menu_bar.cc
|
| diff --git a/chrome/browser/ui/gtk/global_menu_bar.cc b/chrome/browser/ui/gtk/global_menu_bar.cc
|
| index 76ac9ba8611cb2ef55c478e61346e67efc49807f..ccef09d7d7af2dd2d9c665a06045e0e406da3972 100644
|
| --- a/chrome/browser/ui/gtk/global_menu_bar.cc
|
| +++ b/chrome/browser/ui/gtk/global_menu_bar.cc
|
| @@ -6,6 +6,7 @@
|
|
|
| #include <gtk/gtk.h>
|
|
|
| +#include "base/command_line.h"
|
| #include "chrome/app/chrome_command_ids.h"
|
| #include "chrome/browser/prefs/pref_service.h"
|
| #include "chrome/browser/profiles/profile.h"
|
| @@ -13,6 +14,7 @@
|
| #include "chrome/browser/ui/gtk/accelerators_gtk.h"
|
| #include "chrome/browser/ui/gtk/gtk_theme_service.h"
|
| #include "chrome/browser/ui/gtk/gtk_util.h"
|
| +#include "chrome/common/chrome_switches.h"
|
| #include "chrome/common/pref_names.h"
|
| #include "content/common/notification_service.h"
|
| #include "grit/generated_resources.h"
|
| @@ -152,7 +154,6 @@ GlobalMenuBar::GlobalMenuBar(Browser* browser)
|
| profile_(browser_->profile()),
|
| menu_bar_(gtk_menu_bar_new()),
|
| history_menu_(browser_),
|
| - bookmark_menu_(browser_),
|
| dummy_accel_group_(gtk_accel_group_new()),
|
| block_activation_(false) {
|
| // The global menu bar should never actually be shown in the app; it should
|
| @@ -168,8 +169,23 @@ GlobalMenuBar::GlobalMenuBar(Browser* browser)
|
| BuildGtkMenuFrom(IDS_VIEW_MENU_LINUX, &id_to_menu_item_, view_menu, NULL);
|
| BuildGtkMenuFrom(IDS_HISTORY_MENU_LINUX, &id_to_menu_item_,
|
| history_menu, &history_menu_);
|
| - BuildGtkMenuFrom(IDS_BOOKMARKS_MENU_LINUX, &id_to_menu_item_, bookmark_menu,
|
| - &bookmark_menu_);
|
| +
|
| + if (CommandLine::ForCurrentProcess()->HasSwitch(
|
| + switches::kEnableGlobalBookmarkMenu)) {
|
| + // TODO(erg): dbusmenu-glib in Ubuntu Natty does not like it when we shove
|
| + // 100k or more of favicon data over it. Users have reported that the
|
| + // browser hangs on startup for over a minute and breaking during this time
|
| + // shows a stack entirely of dbus/glib code (See #86715). For now, just
|
| + // hide the menu until appmenu-gtk catches up and doesn't hang if we throw
|
| + // (potentially) megs of icon data at it. (Some of our users have thousands
|
| + // of bookmarks and we're already unacceptably laggy at 100.)
|
| + //
|
| + // http://crbug.com/86715, http://crbug.com/85466
|
| + bookmark_menu_.reset(new GlobalBookmarkMenu(browser_));
|
| + BuildGtkMenuFrom(IDS_BOOKMARKS_MENU_LINUX, &id_to_menu_item_, bookmark_menu,
|
| + bookmark_menu_.get());
|
| + }
|
| +
|
| BuildGtkMenuFrom(IDS_TOOLS_MENU_LINUX, &id_to_menu_item_, tools_menu, NULL);
|
| BuildGtkMenuFrom(IDS_HELP_MENU_LINUX, &id_to_menu_item_, help_menu, NULL);
|
|
|
|
|