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

Unified Diff: chrome/browser/ui/toolbar/bookmark_sub_menu_model.cc

Issue 8286018: Reland r105450: Linux: add basic bookmark menu support. More features can be added later. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 9 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/ui/toolbar/bookmark_sub_menu_model.h ('k') | chrome/browser/ui/toolbar/wrench_menu_model.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/toolbar/bookmark_sub_menu_model.cc
===================================================================
--- chrome/browser/ui/toolbar/bookmark_sub_menu_model.cc (revision 105454)
+++ chrome/browser/ui/toolbar/bookmark_sub_menu_model.cc (working copy)
@@ -0,0 +1,36 @@
+// Copyright (c) 2011 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "chrome/browser/ui/toolbar/bookmark_sub_menu_model.h"
+
+#include "chrome/app/chrome_command_ids.h"
+#include "grit/generated_resources.h"
+
+// For views and cocoa, we have complex delegate systems to handle
+// injecting the bookmarks to the bookmark submenu. This is done to support
+// advanced interactions with the menu contents, like right click context menus.
+// For the time being on GTK systems, we have a dedicated bookmark menu model in
+// chrome/browser/ui/gtk/bookmark_sub_menu_model_gtk.cc instead.
+
+// Note that although this file's header is included on GTK systems, this
+// source file is not compiled there. (The header just includes the GTK one.)
+
+BookmarkSubMenuModel::BookmarkSubMenuModel(
+ ui::SimpleMenuModel::Delegate* delegate, Browser* browser)
+ : SimpleMenuModel(delegate) {
+ Build(browser);
+}
+
+BookmarkSubMenuModel::~BookmarkSubMenuModel() {}
+
+void BookmarkSubMenuModel::Build(Browser* browser) {
+ AddCheckItemWithStringId(IDC_SHOW_BOOKMARK_BAR, IDS_SHOW_BOOKMARK_BAR);
+ AddItemWithStringId(IDC_SHOW_BOOKMARK_MANAGER, IDS_BOOKMARK_MANAGER);
+#if !defined(OS_CHROMEOS)
+ AddItemWithStringId(IDC_IMPORT_SETTINGS, IDS_IMPORT_SETTINGS_MENU_LABEL);
+#endif
+#if defined(OS_MACOSX)
+ AddSeparator();
+#endif
+}
« no previous file with comments | « chrome/browser/ui/toolbar/bookmark_sub_menu_model.h ('k') | chrome/browser/ui/toolbar/wrench_menu_model.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698