OLD | NEW |
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/session_state_delegate.h" | 9 #include "ash/session/session_state_delegate.h" |
10 #include "ash/shelf/shelf_widget.h" | 10 #include "ash/shelf/shelf_widget.h" |
(...skipping 368 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
379 const gfx::Point& point, | 379 const gfx::Point& point, |
380 ui::MenuSourceType source_type) { | 380 ui::MenuSourceType source_type) { |
381 MenuItemView* root = new MenuItemView(this); | 381 MenuItemView* root = new MenuItemView(this); |
382 root->AppendMenuItem(COMMAND_NEW_WINDOW, | 382 root->AppendMenuItem(COMMAND_NEW_WINDOW, |
383 base::ASCIIToUTF16("New Window"), | 383 base::ASCIIToUTF16("New Window"), |
384 MenuItemView::NORMAL); | 384 MenuItemView::NORMAL); |
385 root->AppendMenuItem(COMMAND_TOGGLE_FULLSCREEN, | 385 root->AppendMenuItem(COMMAND_TOGGLE_FULLSCREEN, |
386 base::ASCIIToUTF16("Toggle FullScreen"), | 386 base::ASCIIToUTF16("Toggle FullScreen"), |
387 MenuItemView::NORMAL); | 387 MenuItemView::NORMAL); |
388 // MenuRunner takes ownership of root. | 388 // MenuRunner takes ownership of root. |
389 menu_runner_.reset(new MenuRunner(root)); | 389 menu_runner_.reset(new MenuRunner( |
390 if (menu_runner_->RunMenuAt( | 390 root, MenuRunner::HAS_MNEMONICS | views::MenuRunner::CONTEXT_MENU)); |
391 GetWidget(), | 391 if (menu_runner_->RunMenuAt(GetWidget(), |
392 NULL, | 392 NULL, |
393 gfx::Rect(point, gfx::Size()), | 393 gfx::Rect(point, gfx::Size()), |
394 views::MENU_ANCHOR_TOPLEFT, | 394 views::MENU_ANCHOR_TOPLEFT, |
395 source_type, | 395 source_type) == MenuRunner::MENU_DELETED) { |
396 MenuRunner::HAS_MNEMONICS | views::MenuRunner::CONTEXT_MENU) == | |
397 MenuRunner::MENU_DELETED) { | |
398 return; | 396 return; |
399 } | 397 } |
400 } | 398 } |
401 | 399 |
402 } // namespace shell | 400 } // namespace shell |
403 } // namespace ash | 401 } // namespace ash |
OLD | NEW |