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 <utility> | 7 #include <utility> |
8 | 8 |
9 #include "ash/public/cpp/shell_window_ids.h" | 9 #include "ash/public/cpp/shell_window_ids.h" |
10 #include "ash/root_window_controller.h" | 10 #include "ash/root_window_controller.h" |
(...skipping 310 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
321 views::View* source, | 321 views::View* source, |
322 const gfx::Point& point, | 322 const gfx::Point& point, |
323 ui::MenuSourceType source_type) { | 323 ui::MenuSourceType source_type) { |
324 MenuItemView* root = new MenuItemView(this); | 324 MenuItemView* root = new MenuItemView(this); |
325 root->AppendMenuItem(COMMAND_NEW_WINDOW, base::ASCIIToUTF16("New Window"), | 325 root->AppendMenuItem(COMMAND_NEW_WINDOW, base::ASCIIToUTF16("New Window"), |
326 MenuItemView::NORMAL); | 326 MenuItemView::NORMAL); |
327 root->AppendMenuItem(COMMAND_TOGGLE_FULLSCREEN, | 327 root->AppendMenuItem(COMMAND_TOGGLE_FULLSCREEN, |
328 base::ASCIIToUTF16("Toggle FullScreen"), | 328 base::ASCIIToUTF16("Toggle FullScreen"), |
329 MenuItemView::NORMAL); | 329 MenuItemView::NORMAL); |
330 // MenuRunner takes ownership of root. | 330 // MenuRunner takes ownership of root. |
331 menu_runner_.reset(new MenuRunner(root, MenuRunner::HAS_MNEMONICS | | 331 menu_runner_.reset(new MenuRunner( |
332 views::MenuRunner::CONTEXT_MENU | | 332 root, MenuRunner::HAS_MNEMONICS | views::MenuRunner::CONTEXT_MENU)); |
333 views::MenuRunner::ASYNC)); | 333 menu_runner_->RunMenuAt(GetWidget(), NULL, gfx::Rect(point, gfx::Size()), |
334 if (menu_runner_->RunMenuAt(GetWidget(), NULL, gfx::Rect(point, gfx::Size()), | 334 views::MENU_ANCHOR_TOPLEFT, source_type); |
335 views::MENU_ANCHOR_TOPLEFT, | |
336 source_type) == MenuRunner::MENU_DELETED) { | |
337 return; | |
338 } | |
339 } | 335 } |
340 | 336 |
341 } // namespace shell | 337 } // namespace shell |
342 } // namespace ash | 338 } // namespace ash |
OLD | NEW |