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

Side by Side Diff: chrome/browser/views/toolbar_view.cc

Issue 1826: Moved some Page menu elements to App menu (they fit there much more); these a... (Closed) Base URL: http://src.chromium.org/svn/trunk/src/
Patch Set: '' Created 12 years, 3 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « AUTHORS ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2006-2008 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 #include "chrome/browser/views/toolbar_view.h" 5 #include "chrome/browser/views/toolbar_view.h"
6 6
7 #include <string> 7 #include <string>
8 8
9 #include "base/logging.h" 9 #include "base/logging.h"
10 #include "base/path_service.h" 10 #include "base/path_service.h"
(...skipping 469 matching lines...) Expand 10 before | Expand all | Expand 10 after
480 out->cy = ps.cy + 2 * kControlVertOffsetLocationOnly; 480 out->cy = ps.cy + 2 * kControlVertOffsetLocationOnly;
481 } 481 }
482 } 482 }
483 483
484 void BrowserToolbarView::RunPageMenu(const CPoint& pt, HWND hwnd) { 484 void BrowserToolbarView::RunPageMenu(const CPoint& pt, HWND hwnd) {
485 Menu::AnchorPoint anchor = Menu::TOPRIGHT; 485 Menu::AnchorPoint anchor = Menu::TOPRIGHT;
486 if (UILayoutIsRightToLeft()) 486 if (UILayoutIsRightToLeft())
487 anchor = Menu::TOPLEFT; 487 anchor = Menu::TOPLEFT;
488 488
489 Menu menu(this, anchor, hwnd); 489 Menu menu(this, anchor, hwnd);
490 menu.AppendMenuItemWithLabel(IDC_NEWTAB, l10n_util::GetString(IDS_NEWTAB));
491 menu.AppendMenuItemWithLabel(IDC_NEWWINDOW,
492 l10n_util::GetString(IDS_NEWWINDOW));
493 menu.AppendMenuItemWithLabel(IDC_GOOFFTHERECORD,
494 l10n_util::GetString(IDS_GOOFFTHERECORD));
495 menu.AppendSeparator();
496 // The install menu may be dynamically generated with a contextual label. 490 // The install menu may be dynamically generated with a contextual label.
497 // See browser_commands.cc. 491 // See browser_commands.cc.
498 menu.AppendMenuItemWithLabel(IDC_CREATE_SHORTCUT, 492 menu.AppendMenuItemWithLabel(IDC_CREATE_SHORTCUT,
499 l10n_util::GetString(IDS_DEFAULT_INSTALL_SITE_LABEL)); 493 l10n_util::GetString(IDS_DEFAULT_INSTALL_SITE_LABEL));
500 menu.AppendSeparator(); 494 menu.AppendSeparator();
501 menu.AppendMenuItemWithLabel(IDC_CUT, l10n_util::GetString(IDS_CUT)); 495 menu.AppendMenuItemWithLabel(IDC_CUT, l10n_util::GetString(IDS_CUT));
502 menu.AppendMenuItemWithLabel(IDC_COPY, l10n_util::GetString(IDS_COPY)); 496 menu.AppendMenuItemWithLabel(IDC_COPY, l10n_util::GetString(IDS_COPY));
503 menu.AppendMenuItemWithLabel(IDC_PASTE, l10n_util::GetString(IDS_PASTE)); 497 menu.AppendMenuItemWithLabel(IDC_PASTE, l10n_util::GetString(IDS_PASTE));
504 menu.AppendSeparator(); 498 menu.AppendSeparator();
505 499
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after
555 l10n_util::GetString(IDS_COMMANDS_REPORTBUG)); 549 l10n_util::GetString(IDS_COMMANDS_REPORTBUG));
556 menu.RunMenuAt(pt.x, pt.y); 550 menu.RunMenuAt(pt.x, pt.y);
557 } 551 }
558 552
559 void BrowserToolbarView::RunAppMenu(const CPoint& pt, HWND hwnd) { 553 void BrowserToolbarView::RunAppMenu(const CPoint& pt, HWND hwnd) {
560 Menu::AnchorPoint anchor = Menu::TOPRIGHT; 554 Menu::AnchorPoint anchor = Menu::TOPRIGHT;
561 if (UILayoutIsRightToLeft()) 555 if (UILayoutIsRightToLeft())
562 anchor = Menu::TOPLEFT; 556 anchor = Menu::TOPLEFT;
563 557
564 Menu menu(this, anchor, hwnd); 558 Menu menu(this, anchor, hwnd);
559 menu.AppendMenuItemWithLabel(IDC_NEWTAB, l10n_util::GetString(IDS_NEWTAB));
560 menu.AppendMenuItemWithLabel(IDC_NEWWINDOW,
561 l10n_util::GetString(IDS_NEWWINDOW));
562 menu.AppendMenuItemWithLabel(IDC_GOOFFTHERECORD,
563 l10n_util::GetString(IDS_GOOFFTHERECORD));
564 menu.AppendSeparator();
565 menu.AppendMenuItemWithLabel(IDC_SHOW_BOOKMARKS_BAR, 565 menu.AppendMenuItemWithLabel(IDC_SHOW_BOOKMARKS_BAR,
566 l10n_util::GetString(IDS_SHOW_BOOKMARK_BAR)); 566 l10n_util::GetString(IDS_SHOW_BOOKMARK_BAR));
567 menu.AppendSeparator(); 567 menu.AppendSeparator();
568 menu.AppendMenuItemWithLabel(IDC_SHOW_HISTORY, 568 menu.AppendMenuItemWithLabel(IDC_SHOW_HISTORY,
569 l10n_util::GetString(IDS_SHOW_HISTORY)); 569 l10n_util::GetString(IDS_SHOW_HISTORY));
570 menu.AppendMenuItemWithLabel(IDC_SHOW_DOWNLOADS, 570 menu.AppendMenuItemWithLabel(IDC_SHOW_DOWNLOADS,
571 l10n_util::GetString(IDS_SHOW_DOWNLOADS)); 571 l10n_util::GetString(IDS_SHOW_DOWNLOADS));
572 menu.AppendSeparator(); 572 menu.AppendSeparator();
573 menu.AppendMenuItemWithLabel(IDC_CLEAR_BROWSING_DATA, 573 menu.AppendMenuItemWithLabel(IDC_CLEAR_BROWSING_DATA,
574 l10n_util::GetString(IDS_CLEAR_BROWSING_DATA)); 574 l10n_util::GetString(IDS_CLEAR_BROWSING_DATA));
(...skipping 138 matching lines...) Expand 10 before | Expand all | Expand 10 after
713 *accel = ChromeViews::Accelerator(L'C', false, true, false); 713 *accel = ChromeViews::Accelerator(L'C', false, true, false);
714 return true; 714 return true;
715 case IDC_PASTE: 715 case IDC_PASTE:
716 *accel = ChromeViews::Accelerator(L'V', false, true, false); 716 *accel = ChromeViews::Accelerator(L'V', false, true, false);
717 return true; 717 return true;
718 } 718 }
719 // Else, we retrieve the accelerator information from the frame. 719 // Else, we retrieve the accelerator information from the frame.
720 return GetViewContainer()->GetAccelerator(id, accel); 720 return GetViewContainer()->GetAccelerator(id, accel);
721 } 721 }
722 722
OLDNEW
« no previous file with comments | « AUTHORS ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698