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

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

Issue 2790773002: Cleanup MenuRunner API (Closed)
Patch Set: Rebase Created 3 years, 8 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
« no previous file with comments | « ash/shelf/shelf_view.cc ('k') | ash/shell_unittest.cc » ('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 <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
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
OLDNEW
« no previous file with comments | « ash/shelf/shelf_view.cc ('k') | ash/shell_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698