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

Side by Side Diff: ash/shell.cc

Issue 2336883002: mash: Port context menu code to WmShell and WmRootWindowController. (Closed)
Patch Set: Fix error. Created 4 years, 3 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/shell.h ('k') | no next file » | 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/shell.h" 5 #include "ash/shell.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <string> 8 #include <string>
9 #include <utility> 9 #include <utility>
10 10
(...skipping 246 matching lines...) Expand 10 before | Expand all | Expand 10 after
257 aura::Window* Shell::GetContainer(aura::Window* root_window, int container_id) { 257 aura::Window* Shell::GetContainer(aura::Window* root_window, int container_id) {
258 return root_window->GetChildById(container_id); 258 return root_window->GetChildById(container_id);
259 } 259 }
260 260
261 // static 261 // static
262 const aura::Window* Shell::GetContainer(const aura::Window* root_window, 262 const aura::Window* Shell::GetContainer(const aura::Window* root_window,
263 int container_id) { 263 int container_id) {
264 return root_window->GetChildById(container_id); 264 return root_window->GetChildById(container_id);
265 } 265 }
266 266
267 void Shell::ShowContextMenu(const gfx::Point& location_in_screen,
268 ui::MenuSourceType source_type) {
269 // No context menus if there is no session with an active user.
270 if (!session_state_delegate_->NumberOfLoggedInUsers())
271 return;
272 // No context menus when screen is locked.
273 if (session_state_delegate_->IsScreenLocked())
274 return;
275
276 aura::Window* root = WmWindowAura::GetAuraWindow(
277 wm::GetRootWindowMatching(gfx::Rect(location_in_screen, gfx::Size())));
278 GetRootWindowController(root)->ShowContextMenu(location_in_screen,
279 source_type);
280 }
281
282 views::NonClientFrameView* Shell::CreateDefaultNonClientFrameView( 267 views::NonClientFrameView* Shell::CreateDefaultNonClientFrameView(
283 views::Widget* widget) { 268 views::Widget* widget) {
284 // Use translucent-style window frames for dialogs. 269 // Use translucent-style window frames for dialogs.
285 return new CustomFrameViewAsh(widget); 270 return new CustomFrameViewAsh(widget);
286 } 271 }
287 272
288 void Shell::SetDisplayWorkAreaInsets(Window* contains, 273 void Shell::SetDisplayWorkAreaInsets(Window* contains,
289 const gfx::Insets& insets) { 274 const gfx::Insets& insets) {
290 if (!window_tree_host_manager_->UpdateWorkAreaOfDisplayNearestWindow( 275 if (!window_tree_host_manager_->UpdateWorkAreaOfDisplayNearestWindow(
291 contains, insets)) { 276 contains, insets)) {
(...skipping 684 matching lines...) Expand 10 before | Expand all | Expand 10 after
976 std::unique_ptr<ui::EventTargetIterator> Shell::GetChildIterator() const { 961 std::unique_ptr<ui::EventTargetIterator> Shell::GetChildIterator() const {
977 return std::unique_ptr<ui::EventTargetIterator>(); 962 return std::unique_ptr<ui::EventTargetIterator>();
978 } 963 }
979 964
980 ui::EventTargeter* Shell::GetEventTargeter() { 965 ui::EventTargeter* Shell::GetEventTargeter() {
981 NOTREACHED(); 966 NOTREACHED();
982 return nullptr; 967 return nullptr;
983 } 968 }
984 969
985 } // namespace ash 970 } // namespace ash
OLDNEW
« no previous file with comments | « ash/shell.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698