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/root_window_controller.h" | 5 #include "ash/root_window_controller.h" |
6 | 6 |
7 #include <vector> | 7 #include <vector> |
8 | 8 |
9 #include "ash/ash_constants.h" | 9 #include "ash/ash_constants.h" |
10 #include "ash/ash_switches.h" | 10 #include "ash/ash_switches.h" |
(...skipping 469 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
480 return status_area->system_tray(); | 480 return status_area->system_tray(); |
481 } | 481 } |
482 | 482 |
483 void RootWindowController::ShowContextMenu( | 483 void RootWindowController::ShowContextMenu( |
484 const gfx::Point& location_in_screen) { | 484 const gfx::Point& location_in_screen) { |
485 aura::RootWindow* target = Shell::IsLauncherPerDisplayEnabled() ? | 485 aura::RootWindow* target = Shell::IsLauncherPerDisplayEnabled() ? |
486 root_window() : Shell::GetPrimaryRootWindow(); | 486 root_window() : Shell::GetPrimaryRootWindow(); |
487 DCHECK(Shell::GetInstance()->delegate()); | 487 DCHECK(Shell::GetInstance()->delegate()); |
488 scoped_ptr<ui::MenuModel> menu_model( | 488 scoped_ptr<ui::MenuModel> menu_model( |
489 Shell::GetInstance()->delegate()->CreateContextMenu(target)); | 489 Shell::GetInstance()->delegate()->CreateContextMenu(target)); |
| 490 if (!menu_model.get()) |
| 491 return; |
490 | 492 |
491 views::MenuModelAdapter menu_model_adapter(menu_model.get()); | 493 views::MenuModelAdapter menu_model_adapter(menu_model.get()); |
492 views::MenuRunner menu_runner(menu_model_adapter.CreateMenu()); | 494 views::MenuRunner menu_runner(menu_model_adapter.CreateMenu()); |
493 views::Widget* widget = | 495 views::Widget* widget = |
494 root_window_->GetProperty(kDesktopController)->widget(); | 496 root_window_->GetProperty(kDesktopController)->widget(); |
495 | 497 |
496 if (menu_runner.RunMenuAt( | 498 if (menu_runner.RunMenuAt( |
497 widget, NULL, gfx::Rect(location_in_screen, gfx::Size()), | 499 widget, NULL, gfx::Rect(location_in_screen, gfx::Size()), |
498 views::MenuItemView::TOPLEFT, views::MenuRunner::CONTEXT_MENU) == | 500 views::MenuItemView::TOPLEFT, views::MenuRunner::CONTEXT_MENU) == |
499 views::MenuRunner::MENU_DELETED) | 501 views::MenuRunner::MENU_DELETED) |
(...skipping 187 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
687 "OverlayContainer", | 689 "OverlayContainer", |
688 lock_screen_related_containers); | 690 lock_screen_related_containers); |
689 SetUsesScreenCoordinates(overlay_container); | 691 SetUsesScreenCoordinates(overlay_container); |
690 | 692 |
691 CreateContainer(kShellWindowId_PowerButtonAnimationContainer, | 693 CreateContainer(kShellWindowId_PowerButtonAnimationContainer, |
692 "PowerButtonAnimationContainer", root_window) ; | 694 "PowerButtonAnimationContainer", root_window) ; |
693 } | 695 } |
694 | 696 |
695 } // namespace internal | 697 } // namespace internal |
696 } // namespace ash | 698 } // namespace ash |
OLD | NEW |