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 "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 Loading... |
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 Loading... |
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 } |
OLD | NEW |