summaryrefslogtreecommitdiffstats
path: root/chrome
diff options
context:
space:
mode:
authorpkasting@chromium.org <pkasting@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-12-04 22:51:02 +0000
committerpkasting@chromium.org <pkasting@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-12-04 22:51:02 +0000
commit0baf8d2d5e43cbbc99700e0acf5eb0676c209972 (patch)
treeb089ed25f3b198d6d491bb983c85936df0db9220 /chrome
parent833c10ef55110071560afc67efc5e32ed1884e24 (diff)
downloadchromium_src-0baf8d2d5e43cbbc99700e0acf5eb0676c209972.zip
chromium_src-0baf8d2d5e43cbbc99700e0acf5eb0676c209972.tar.gz
chromium_src-0baf8d2d5e43cbbc99700e0acf5eb0676c209972.tar.bz2
Make the system menu for app/popup windows slightly shorter. Original patch by Thiago Farina (see http://codereview.chromium.org/402095 ), r=me.
BUG=23787 TEST=Popup window system menus (right click the icon in the upper left corner) should not have Save Page, Duplicate Tab, and a few other things anymore. git-svn-id: svn://svn.chromium.org/chrome/trunk/src@33875 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome')
-rw-r--r--chrome/browser/views/frame/browser_view.cc27
-rw-r--r--chrome/browser/views/frame/browser_view.h2
2 files changed, 15 insertions, 14 deletions
diff --git a/chrome/browser/views/frame/browser_view.cc b/chrome/browser/views/frame/browser_view.cc
index 3b5dd71..9238da7 100644
--- a/chrome/browser/views/frame/browser_view.cc
+++ b/chrome/browser/views/frame/browser_view.cc
@@ -1820,7 +1820,7 @@ void BrowserView::InitSystemMenu() {
if (IsBrowserTypeNormal())
BuildSystemMenuForBrowserWindow();
else
- BuildSystemMenuForPopupWindow();
+ BuildSystemMenuForAppOrPopupWindow(browser_->type() == Browser::TYPE_APP);
system_menu_.reset(
new views::NativeMenuWin(system_menu_contents_.get(),
frame_->GetWindow()->GetNativeWindow()));
@@ -2179,10 +2179,12 @@ void BrowserView::BuildSystemMenuForBrowserWindow() {
// since it already has menus (Page, Chrome).
}
-void BrowserView::BuildSystemMenuForPopupWindow() {
- system_menu_contents_->AddSeparator();
- system_menu_contents_->AddItemWithStringId(IDC_TASK_MANAGER,
- IDS_TASK_MANAGER);
+void BrowserView::BuildSystemMenuForAppOrPopupWindow(bool is_app) {
+ if (is_app) {
+ system_menu_contents_->AddSeparator();
+ system_menu_contents_->AddItemWithStringId(IDC_TASK_MANAGER,
+ IDS_TASK_MANAGER);
+ }
system_menu_contents_->AddSeparator();
encoding_menu_contents_.reset(new EncodingMenuModel(browser_.get()));
system_menu_contents_->AddSubMenuWithStringId(IDS_ENCODING_MENU,
@@ -2191,22 +2193,21 @@ void BrowserView::BuildSystemMenuForPopupWindow() {
system_menu_contents_->AddSubMenuWithStringId(IDS_ZOOM_MENU,
zoom_menu_contents_.get());
system_menu_contents_->AddItemWithStringId(IDC_PRINT, IDS_PRINT);
- system_menu_contents_->AddItemWithStringId(IDC_SAVE_PAGE,
- IDS_SAVE_PAGE);
system_menu_contents_->AddItemWithStringId(IDC_FIND, IDS_FIND);
system_menu_contents_->AddSeparator();
system_menu_contents_->AddItemWithStringId(IDC_PASTE, IDS_PASTE);
system_menu_contents_->AddItemWithStringId(IDC_COPY, IDS_COPY);
system_menu_contents_->AddItemWithStringId(IDC_CUT, IDS_CUT);
system_menu_contents_->AddSeparator();
- system_menu_contents_->AddItemWithStringId(IDC_NEW_TAB,
- IDS_APP_MENU_NEW_WEB_PAGE);
- system_menu_contents_->AddItemWithStringId(IDC_SHOW_AS_TAB, IDS_SHOW_AS_TAB);
+ if (is_app) {
+ system_menu_contents_->AddItemWithStringId(IDC_NEW_TAB,
+ IDS_APP_MENU_NEW_WEB_PAGE);
+ } else {
+ system_menu_contents_->AddItemWithStringId(IDC_SHOW_AS_TAB,
+ IDS_SHOW_AS_TAB);
+ }
system_menu_contents_->AddItemWithStringId(IDC_COPY_URL,
IDS_APP_MENU_COPY_URL);
- system_menu_contents_->AddItemWithStringId(IDC_DUPLICATE_TAB,
- IDS_APP_MENU_DUPLICATE_APP_WINDOW);
- system_menu_contents_->AddItemWithStringId(IDC_RESTORE_TAB, IDS_RESTORE_TAB);
system_menu_contents_->AddSeparator();
system_menu_contents_->AddItemWithStringId(IDC_RELOAD, IDS_APP_MENU_RELOAD);
system_menu_contents_->AddItemWithStringId(IDC_FORWARD,
diff --git a/chrome/browser/views/frame/browser_view.h b/chrome/browser/views/frame/browser_view.h
index 8aced8f..5b3de61 100644
--- a/chrome/browser/views/frame/browser_view.h
+++ b/chrome/browser/views/frame/browser_view.h
@@ -422,7 +422,7 @@ class BrowserView : public BrowserWindow,
#if defined(OS_WIN)
// Builds the correct menu for when we have minimal chrome.
void BuildSystemMenuForBrowserWindow();
- void BuildSystemMenuForPopupWindow();
+ void BuildSystemMenuForAppOrPopupWindow(bool is_app);
#endif
// Retrieves the command id for the specified Windows app command.