| 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 <queue> | 7 #include <queue> |
| 8 #include <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 #include "ash/ash_constants.h" | 10 #include "ash/ash_constants.h" |
| (...skipping 548 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 559 // We assume in throughout the code that this will not return NULL. If code | 559 // We assume in throughout the code that this will not return NULL. If code |
| 560 // triggers this for valid reasons, it should test status_area_widget first. | 560 // triggers this for valid reasons, it should test status_area_widget first. |
| 561 CHECK(shelf_widget_->status_area_widget()); | 561 CHECK(shelf_widget_->status_area_widget()); |
| 562 return shelf_widget_->status_area_widget()->system_tray(); | 562 return shelf_widget_->status_area_widget()->system_tray(); |
| 563 } | 563 } |
| 564 | 564 |
| 565 void RootWindowController::ShowContextMenu(const gfx::Point& location_in_screen, | 565 void RootWindowController::ShowContextMenu(const gfx::Point& location_in_screen, |
| 566 ui::MenuSourceType source_type) { | 566 ui::MenuSourceType source_type) { |
| 567 ShellDelegate* delegate = Shell::GetInstance()->delegate(); | 567 ShellDelegate* delegate = Shell::GetInstance()->delegate(); |
| 568 DCHECK(delegate); | 568 DCHECK(delegate); |
| 569 menu_model_.reset( | 569 menu_model_.reset(delegate->CreateContextMenu(wm_shelf_aura_.get(), nullptr)); |
| 570 delegate->CreateContextMenu(shelf_widget_->shelf(), nullptr)); | |
| 571 if (!menu_model_) | 570 if (!menu_model_) |
| 572 return; | 571 return; |
| 573 | 572 |
| 574 menu_model_adapter_.reset(new views::MenuModelAdapter( | 573 menu_model_adapter_.reset(new views::MenuModelAdapter( |
| 575 menu_model_.get(), | 574 menu_model_.get(), |
| 576 base::Bind(&RootWindowController::OnMenuClosed, base::Unretained(this)))); | 575 base::Bind(&RootWindowController::OnMenuClosed, base::Unretained(this)))); |
| 577 | 576 |
| 578 // Background controller may not be set yet if user clicked on status are | 577 // Background controller may not be set yet if user clicked on status are |
| 579 // before initial animation completion. See crbug.com/222218 | 578 // before initial animation completion. See crbug.com/222218 |
| 580 if (!wallpaper_controller_.get()) | 579 if (!wallpaper_controller_.get()) |
| (...skipping 306 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 887 aura::Window* primary_root_window = Shell::GetInstance() | 886 aura::Window* primary_root_window = Shell::GetInstance() |
| 888 ->window_tree_host_manager() | 887 ->window_tree_host_manager() |
| 889 ->GetPrimaryRootWindow(); | 888 ->GetPrimaryRootWindow(); |
| 890 return GetRootWindowSettings(primary_root_window)->controller; | 889 return GetRootWindowSettings(primary_root_window)->controller; |
| 891 } | 890 } |
| 892 | 891 |
| 893 return GetRootWindowSettings(root_window)->controller; | 892 return GetRootWindowSettings(root_window)->controller; |
| 894 } | 893 } |
| 895 | 894 |
| 896 } // namespace ash | 895 } // namespace ash |
| OLD | NEW |