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

Side by Side Diff: ash/shell/window_type_launcher.cc

Issue 16979002: Add ContextMenuSourceType to views::ContextMenuController::ShowContextMenuForView. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: patch Created 7 years, 6 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 | « ash/shell/window_type_launcher.h ('k') | ash/system/web_notification/web_notification_tray.h » ('j') | 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) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 "ash/shell/window_type_launcher.h" 5 #include "ash/shell/window_type_launcher.h"
6 6
7 #include "ash/root_window_controller.h" 7 #include "ash/root_window_controller.h"
8 #include "ash/screensaver/screensaver_view.h" 8 #include "ash/screensaver/screensaver_view.h"
9 #include "ash/session_state_delegate.h" 9 #include "ash/session_state_delegate.h"
10 #include "ash/shelf/shelf_widget.h" 10 #include "ash/shelf/shelf_widget.h"
(...skipping 370 matching lines...) Expand 10 before | Expand all | Expand 10 after
381 case COMMAND_TOGGLE_FULLSCREEN: 381 case COMMAND_TOGGLE_FULLSCREEN:
382 GetWidget()->SetFullscreen(!GetWidget()->IsFullscreen()); 382 GetWidget()->SetFullscreen(!GetWidget()->IsFullscreen());
383 break; 383 break;
384 default: 384 default:
385 break; 385 break;
386 } 386 }
387 } 387 }
388 #endif // !defined(OS_MACOSX) 388 #endif // !defined(OS_MACOSX)
389 389
390 #if !defined(OS_MACOSX) 390 #if !defined(OS_MACOSX)
391 void WindowTypeLauncher::ShowContextMenuForView(views::View* source, 391 void WindowTypeLauncher::ShowContextMenuForView(
392 const gfx::Point& point) { 392 views::View* source,
393 const gfx::Point& point,
394 ui::MenuSourceType source_type) {
393 MenuItemView* root = new MenuItemView(this); 395 MenuItemView* root = new MenuItemView(this);
394 root->AppendMenuItem(COMMAND_NEW_WINDOW, 396 root->AppendMenuItem(COMMAND_NEW_WINDOW,
395 ASCIIToUTF16("New Window"), 397 ASCIIToUTF16("New Window"),
396 MenuItemView::NORMAL); 398 MenuItemView::NORMAL);
397 root->AppendMenuItem(COMMAND_TOGGLE_FULLSCREEN, 399 root->AppendMenuItem(COMMAND_TOGGLE_FULLSCREEN,
398 ASCIIToUTF16("Toggle FullScreen"), 400 ASCIIToUTF16("Toggle FullScreen"),
399 MenuItemView::NORMAL); 401 MenuItemView::NORMAL);
400 // MenuRunner takes ownership of root. 402 // MenuRunner takes ownership of root.
401 menu_runner_.reset(new MenuRunner(root)); 403 menu_runner_.reset(new MenuRunner(root));
402 if (menu_runner_->RunMenuAt(GetWidget(), NULL, gfx::Rect(point, gfx::Size()), 404 if (menu_runner_->RunMenuAt(GetWidget(), NULL,
405 gfx::Rect(point, gfx::Size()),
403 MenuItemView::TOPLEFT, 406 MenuItemView::TOPLEFT,
407 source_type,
404 MenuRunner::HAS_MNEMONICS | views::MenuRunner::CONTEXT_MENU) == 408 MenuRunner::HAS_MNEMONICS | views::MenuRunner::CONTEXT_MENU) ==
405 MenuRunner::MENU_DELETED) 409 MenuRunner::MENU_DELETED)
406 return; 410 return;
407 } 411 }
408 #endif // !defined(OS_MACOSX) 412 #endif // !defined(OS_MACOSX)
409 413
410 } // namespace shell 414 } // namespace shell
411 } // namespace ash 415 } // namespace ash
OLDNEW
« no previous file with comments | « ash/shell/window_type_launcher.h ('k') | ash/system/web_notification/web_notification_tray.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698