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

Unified Diff: chrome/browser/views/frame/browser_view.cc

Issue 62113: Added restore and add tab to the system menu so that these operations... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 11 years, 8 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/app/generated_resources.grd ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/views/frame/browser_view.cc
===================================================================
--- chrome/browser/views/frame/browser_view.cc (revision 13152)
+++ chrome/browser/views/frame/browser_view.cc (working copy)
@@ -37,6 +37,7 @@
#include "chrome/browser/views/tabs/tab_strip.h"
#include "chrome/browser/views/toolbar_star_toggle.h"
#include "chrome/browser/views/toolbar_view.h"
+#include "chrome/browser/sessions/tab_restore_service.h"
#include "chrome/browser/tab_contents/navigation_entry.h"
#include "chrome/browser/tab_contents/web_contents.h"
#include "chrome/browser/tab_contents/web_contents_view.h"
@@ -120,6 +121,7 @@
{ false, IDC_SHOW_AS_TAB, IDS_SHOW_AS_TAB },
{ false, IDC_COPY_URL, IDS_APP_MENU_COPY_URL },
{ false, IDC_DUPLICATE_TAB, IDS_APP_MENU_DUPLICATE_APP_WINDOW },
+ { false, IDC_RESTORE_TAB, IDS_RESTORE_TAB },
{ true, 0, 0 },
{ false, IDC_RELOAD, IDS_APP_MENU_RELOAD },
{ false, IDC_FORWARD, IDS_CONTENT_CONTEXT_FORWARD },
@@ -415,9 +417,10 @@
// |command| can be zero on submenu items (IDS_ENCODING,
// IDS_ZOOM) and on separators.
if (command != 0) {
- system_menu_->EnableMenuItemByID(
- command,
- browser_->command_updater()->IsCommandEnabled(command));
+ bool enabled = browser_->command_updater()->IsCommandEnabled(command) &&
+ ((command != IDC_RESTORE_TAB) ||
Glen Murphy 2009/04/07 21:33:33 I think this should be a four-pixel indent. Thoug
+ !browser_->profile()->GetTabRestoreService()->entries().empty());
+ system_menu_->EnableMenuItemByID(command, enabled);
}
}
}
@@ -1249,6 +1252,11 @@
system_menu_->AddSeparator(insertion_index);
system_menu_->AddMenuItemWithLabel(insertion_index, IDC_TASK_MANAGER,
l10n_util::GetString(IDS_TASK_MANAGER));
+ system_menu_->AddSeparator(insertion_index);
+ system_menu_->AddMenuItemWithLabel(insertion_index, IDC_RESTORE_TAB,
+ l10n_util::GetString(IDS_RESTORE_TAB));
+ system_menu_->AddMenuItemWithLabel(insertion_index, IDC_NEW_TAB,
+ l10n_util::GetString(IDS_NEW_TAB));
// If it's a regular browser window with tabs, we don't add any more items,
// since it already has menus (Page, Chrome).
} else {
« no previous file with comments | « chrome/app/generated_resources.grd ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698