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

Side by Side Diff: ash/root_window_controller.cc

Issue 2046843005: mash: Migrate shelf menus to wm common types (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: ash_shell_with_content Created 4 years, 6 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 | « ash/mus/bridge/wm_shelf_mus.cc ('k') | ash/shelf/shelf.h » ('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 "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
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
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
OLDNEW
« no previous file with comments | « ash/mus/bridge/wm_shelf_mus.cc ('k') | ash/shelf/shelf.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698