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

Side by Side Diff: ash/root_window_controller.cc

Issue 1812013003: Pass shelf instances, not root windows, for ash context menus. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Call OnShelfAlignmentChanged after LayoutShelf. Created 4 years, 9 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/shell_delegate_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 543 matching lines...) Expand 10 before | Expand all | Expand 10 after
554 // triggers this for valid reasons, it should test status_area_widget first. 554 // triggers this for valid reasons, it should test status_area_widget first.
555 CHECK(shelf_->status_area_widget()); 555 CHECK(shelf_->status_area_widget());
556 return shelf_->status_area_widget()->system_tray(); 556 return shelf_->status_area_widget()->system_tray();
557 } 557 }
558 558
559 void RootWindowController::ShowContextMenu(const gfx::Point& location_in_screen, 559 void RootWindowController::ShowContextMenu(const gfx::Point& location_in_screen,
560 ui::MenuSourceType source_type) { 560 ui::MenuSourceType source_type) {
561 ShellDelegate* delegate = Shell::GetInstance()->delegate(); 561 ShellDelegate* delegate = Shell::GetInstance()->delegate();
562 DCHECK(delegate); 562 DCHECK(delegate);
563 scoped_ptr<ui::MenuModel> menu_model( 563 scoped_ptr<ui::MenuModel> menu_model(
564 delegate->CreateContextMenu(GetRootWindow(), nullptr)); 564 delegate->CreateContextMenu(shelf_->shelf(), nullptr));
565 if (!menu_model) 565 if (!menu_model)
566 return; 566 return;
567 567
568 // Background controller may not be set yet if user clicked on status are 568 // Background controller may not be set yet if user clicked on status are
569 // before initial animation completion. See crbug.com/222218 569 // before initial animation completion. See crbug.com/222218
570 if (!wallpaper_controller_.get()) 570 if (!wallpaper_controller_.get())
571 return; 571 return;
572 572
573 views::MenuRunner menu_runner(menu_model.get(), 573 views::MenuRunner menu_runner(menu_model.get(),
574 views::MenuRunner::CONTEXT_MENU); 574 views::MenuRunner::CONTEXT_MENU);
(...skipping 474 matching lines...) Expand 10 before | Expand all | Expand 10 after
1049 else 1049 else
1050 DisableTouchHudProjection(); 1050 DisableTouchHudProjection();
1051 } 1051 }
1052 1052
1053 RootWindowController* GetRootWindowController( 1053 RootWindowController* GetRootWindowController(
1054 const aura::Window* root_window) { 1054 const aura::Window* root_window) {
1055 return root_window ? GetRootWindowSettings(root_window)->controller : NULL; 1055 return root_window ? GetRootWindowSettings(root_window)->controller : NULL;
1056 } 1056 }
1057 1057
1058 } // namespace ash 1058 } // namespace ash
OLDNEW
« no previous file with comments | « ash/mus/shell_delegate_mus.cc ('k') | ash/shelf/shelf.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698