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

Unified Diff: chrome/browser/ui/views/toolbar/wrench_menu.cc

Issue 885673004: Adding menu item to take screenshot (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: All comments adressed Created 5 years, 10 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/views/toolbar/wrench_menu.h ('k') | chrome/chrome_browser_ui.gypi » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/views/toolbar/wrench_menu.cc
diff --git a/chrome/browser/ui/views/toolbar/wrench_menu.cc b/chrome/browser/ui/views/toolbar/wrench_menu.cc
index 55c85ab38abc6be5b1f61aeb6f20b44fb6ddc901..3d3f5ca97b551ba2d1d9afb67560e230217ebb87 100644
--- a/chrome/browser/ui/views/toolbar/wrench_menu.cc
+++ b/chrome/browser/ui/views/toolbar/wrench_menu.cc
@@ -787,12 +787,13 @@ class WrenchMenu::RecentTabsMenuModelDelegate : public ui::MenuModelDelegate {
// WrenchMenu ------------------------------------------------------------------
WrenchMenu::WrenchMenu(Browser* browser, int run_flags)
- : root_(NULL),
+ : root_(nullptr),
browser_(browser),
- selected_menu_model_(NULL),
+ selected_menu_model_(nullptr),
selected_index_(0),
- bookmark_menu_(NULL),
- feedback_menu_item_(NULL),
+ bookmark_menu_(nullptr),
+ feedback_menu_item_(nullptr),
+ screenshot_menu_item_(nullptr),
run_flags_(run_flags) {
registrar_.Add(this, chrome::NOTIFICATION_GLOBAL_ERRORS_CHANGED,
content::Source<Profile>(browser_->profile()));
@@ -1053,10 +1054,11 @@ void WrenchMenu::WillShowMenu(MenuItemView* menu) {
void WrenchMenu::WillHideMenu(MenuItemView* menu) {
// Turns off the fade out animation of the wrench menus if
- // |feedback_menu_item_| is selected. This excludes the wrench menu itself
- // from the snapshot in the feedback UI.
- if (menu->HasSubmenu() && feedback_menu_item_ &&
- feedback_menu_item_->IsSelected()) {
+ // |feedback_menu_item_| or |screenshot_menu_item_| is selected. This
+ // excludes the wrench menu itself from the screenshot.
+ if (menu->HasSubmenu() &&
+ ((feedback_menu_item_ && feedback_menu_item_->IsSelected()) ||
+ (screenshot_menu_item_ && screenshot_menu_item_->IsSelected()))) {
// It's okay to just turn off the animation and no to take care the
// animation back because the menu widget will be recreated next time
// it's opened. See ToolbarView::RunMenu() and Init() of this class.
@@ -1161,6 +1163,13 @@ void WrenchMenu::PopulateMenu(MenuItemView* parent,
break;
#endif
+#if defined(OS_CHROMEOS)
+ case IDC_TAKE_SCREENSHOT:
+ DCHECK(!screenshot_menu_item_);
+ screenshot_menu_item_ = item;
+ break;
+#endif
+
case IDC_RECENT_TABS_MENU:
DCHECK(!recent_tabs_menu_model_delegate_.get());
recent_tabs_menu_model_delegate_.reset(
« no previous file with comments | « chrome/browser/ui/views/toolbar/wrench_menu.h ('k') | chrome/chrome_browser_ui.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698