| 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/shell_window_ids.h" | 7 #include "ash/shell_window_ids.h" |
| 8 #include "ash/shell/example_factory.h" | 8 #include "ash/shell/example_factory.h" |
| 9 #include "ash/shell/panel_window.h" | 9 #include "ash/shell/panel_window.h" |
| 10 #include "ash/shell/toplevel_window.h" | 10 #include "ash/shell/toplevel_window.h" |
| (...skipping 337 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 348 case COMMAND_TOGGLE_FULLSCREEN: | 348 case COMMAND_TOGGLE_FULLSCREEN: |
| 349 GetWidget()->SetFullscreen(!GetWidget()->IsFullscreen()); | 349 GetWidget()->SetFullscreen(!GetWidget()->IsFullscreen()); |
| 350 break; | 350 break; |
| 351 default: | 351 default: |
| 352 break; | 352 break; |
| 353 } | 353 } |
| 354 } | 354 } |
| 355 #endif // !defined(OS_MACOSX) | 355 #endif // !defined(OS_MACOSX) |
| 356 | 356 |
| 357 #if !defined(OS_MACOSX) | 357 #if !defined(OS_MACOSX) |
| 358 void WindowTypeLauncher::ShowContextMenuForView(views::View* source, | 358 void WindowTypeLauncher::ShowContextMenuForView( |
| 359 const gfx::Point& p, | 359 views::View* source, |
| 360 bool is_mouse_gesture) { | 360 const gfx::Point& point, |
| 361 views::GestureType gesture_type) { |
| 361 MenuItemView* root = new MenuItemView(this); | 362 MenuItemView* root = new MenuItemView(this); |
| 362 root->AppendMenuItem(COMMAND_NEW_WINDOW, | 363 root->AppendMenuItem(COMMAND_NEW_WINDOW, |
| 363 ASCIIToUTF16("New Window"), | 364 ASCIIToUTF16("New Window"), |
| 364 MenuItemView::NORMAL); | 365 MenuItemView::NORMAL); |
| 365 root->AppendMenuItem(COMMAND_TOGGLE_FULLSCREEN, | 366 root->AppendMenuItem(COMMAND_TOGGLE_FULLSCREEN, |
| 366 ASCIIToUTF16("Toggle FullScreen"), | 367 ASCIIToUTF16("Toggle FullScreen"), |
| 367 MenuItemView::NORMAL); | 368 MenuItemView::NORMAL); |
| 368 // MenuRunner takes ownership of root. | 369 // MenuRunner takes ownership of root. |
| 369 menu_runner_.reset(new MenuRunner(root)); | 370 menu_runner_.reset(new MenuRunner(root)); |
| 370 if (menu_runner_->RunMenuAt(GetWidget(), NULL, gfx::Rect(p, gfx::Size(0, 0)), | 371 if (menu_runner_->RunMenuAt(GetWidget(), NULL, gfx::Rect(point, gfx::Size()), |
| 371 MenuItemView::TOPLEFT, | 372 MenuItemView::TOPLEFT, |
| 372 MenuRunner::HAS_MNEMONICS) == MenuRunner::MENU_DELETED) | 373 MenuRunner::HAS_MNEMONICS) == MenuRunner::MENU_DELETED) |
| 373 return; | 374 return; |
| 374 } | 375 } |
| 375 #endif // !defined(OS_MACOSX) | 376 #endif // !defined(OS_MACOSX) |
| 376 | 377 |
| 377 } // namespace shell | 378 } // namespace shell |
| 378 } // namespace ash | 379 } // namespace ash |
| OLD | NEW |