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

Side by Side Diff: mash/example/window_type_launcher/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 | « mash/browser/browser.cc ('k') | ui/app_list/views/app_list_item_view.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 "mash/example/window_type_launcher/window_type_launcher.h" 5 #include "mash/example/window_type_launcher/window_type_launcher.h"
6 6
7 #include <stdint.h> 7 #include <stdint.h>
8 8
9 #include "base/macros.h" 9 #include "base/macros.h"
10 #include "base/memory/ptr_util.h" 10 #include "base/memory/ptr_util.h"
(...skipping 386 matching lines...) Expand 10 before | Expand all | Expand 10 after
397 ui::MenuSourceType source_type) override { 397 ui::MenuSourceType source_type) override {
398 MenuItemView* root = new MenuItemView(this); 398 MenuItemView* root = new MenuItemView(this);
399 root->AppendMenuItem(COMMAND_NEW_WINDOW, 399 root->AppendMenuItem(COMMAND_NEW_WINDOW,
400 base::ASCIIToUTF16("New Window"), 400 base::ASCIIToUTF16("New Window"),
401 MenuItemView::NORMAL); 401 MenuItemView::NORMAL);
402 root->AppendMenuItem(COMMAND_TOGGLE_FULLSCREEN, 402 root->AppendMenuItem(COMMAND_TOGGLE_FULLSCREEN,
403 base::ASCIIToUTF16("Toggle FullScreen"), 403 base::ASCIIToUTF16("Toggle FullScreen"),
404 MenuItemView::NORMAL); 404 MenuItemView::NORMAL);
405 // MenuRunner takes ownership of root. 405 // MenuRunner takes ownership of root.
406 menu_runner_.reset(new MenuRunner( 406 menu_runner_.reset(new MenuRunner(
407 root, MenuRunner::HAS_MNEMONICS | views::MenuRunner::CONTEXT_MENU | 407 root, MenuRunner::HAS_MNEMONICS | views::MenuRunner::CONTEXT_MENU));
408 views::MenuRunner::ASYNC));
409 menu_runner_->RunMenuAt(GetWidget(), NULL, gfx::Rect(point, gfx::Size()), 408 menu_runner_->RunMenuAt(GetWidget(), NULL, gfx::Rect(point, gfx::Size()),
410 views::MENU_ANCHOR_TOPLEFT, source_type); 409 views::MENU_ANCHOR_TOPLEFT, source_type);
411 } 410 }
412 411
413 WindowTypeLauncher* window_type_launcher_; 412 WindowTypeLauncher* window_type_launcher_;
414 views::Button* create_button_; 413 views::Button* create_button_;
415 views::Button* always_on_top_button_; 414 views::Button* always_on_top_button_;
416 views::Button* panel_button_; 415 views::Button* panel_button_;
417 views::Button* create_nonresizable_button_; 416 views::Button* create_nonresizable_button_;
418 views::Button* bubble_button_; 417 views::Button* bubble_button_;
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after
478 void WindowTypeLauncher::Create( 477 void WindowTypeLauncher::Create(
479 const service_manager::Identity& remote_identity, 478 const service_manager::Identity& remote_identity,
480 mash::mojom::LaunchableRequest request) { 479 mash::mojom::LaunchableRequest request) {
481 bindings_.AddBinding(this, std::move(request)); 480 bindings_.AddBinding(this, std::move(request));
482 } 481 }
483 482
484 MojoResult ServiceMain(MojoHandle service_request_handle) { 483 MojoResult ServiceMain(MojoHandle service_request_handle) {
485 return service_manager::ServiceRunner(new WindowTypeLauncher) 484 return service_manager::ServiceRunner(new WindowTypeLauncher)
486 .Run(service_request_handle); 485 .Run(service_request_handle);
487 } 486 }
OLDNEW
« no previous file with comments | « mash/browser/browser.cc ('k') | ui/app_list/views/app_list_item_view.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698