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

Side by Side Diff: mash/wm/shelf_layout_manager.cc

Issue 2002243002: Gets mash to use WmToplevelWindowEventHandler (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: feedback 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 | « mash/wm/root_window_controller.cc ('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 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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 "mash/wm/shelf_layout_manager.h" 5 #include "mash/wm/shelf_layout_manager.h"
6 6
7 #include "components/mus/public/cpp/window.h" 7 #include "components/mus/public/cpp/window.h"
8 #include "mash/wm/property_util.h" 8 #include "mash/wm/property_util.h"
9 #include "mash/wm/public/interfaces/ash_window_type.mojom.h" 9 #include "mash/wm/public/interfaces/ash_window_type.mojom.h"
10 #include "ui/gfx/geometry/rect.h" 10 #include "ui/gfx/geometry/rect.h"
(...skipping 17 matching lines...) Expand all
28 } 28 }
29 return nullptr; 29 return nullptr;
30 } 30 }
31 31
32 // We explicitly don't make assertions about the number of children in this 32 // We explicitly don't make assertions about the number of children in this
33 // layout as the number of children can vary when the application providing the 33 // layout as the number of children can vary when the application providing the
34 // shelf restarts. 34 // shelf restarts.
35 35
36 void ShelfLayoutManager::LayoutWindow(mus::Window* window) { 36 void ShelfLayoutManager::LayoutWindow(mus::Window* window) {
37 if (GetAshWindowType(window) != mojom::AshWindowType::SHELF) { 37 if (GetAshWindowType(window) != mojom::AshWindowType::SHELF) {
38 NOTREACHED() << "Unknown window in USER_SHELF container."; 38 // Phantom windows end up in this container, ignore them.
39 return; 39 return;
40 } 40 }
41 gfx::Size size = GetWindowPreferredSize(window); 41 gfx::Size size = GetWindowPreferredSize(window);
42 42
43 if (alignment_ == shelf::mojom::Alignment::BOTTOM) { 43 if (alignment_ == shelf::mojom::Alignment::BOTTOM) {
44 const int y = owner()->bounds().height() - size.height(); 44 const int y = owner()->bounds().height() - size.height();
45 size.set_width(owner()->bounds().width()); 45 size.set_width(owner()->bounds().width());
46 window->SetBounds(gfx::Rect(0, y, size.width(), size.height())); 46 window->SetBounds(gfx::Rect(0, y, size.width(), size.height()));
47 } else { 47 } else {
48 const int x = (alignment_ == shelf::mojom::Alignment::LEFT) 48 const int x = (alignment_ == shelf::mojom::Alignment::LEFT)
(...skipping 17 matching lines...) Expand all
66 shelf::mojom::AutoHideBehavior auto_hide) { 66 shelf::mojom::AutoHideBehavior auto_hide) {
67 if (auto_hide_behavior_ == auto_hide) 67 if (auto_hide_behavior_ == auto_hide)
68 return; 68 return;
69 69
70 auto_hide_behavior_ = auto_hide; 70 auto_hide_behavior_ = auto_hide;
71 NOTIMPLEMENTED(); 71 NOTIMPLEMENTED();
72 } 72 }
73 73
74 } // namespace wm 74 } // namespace wm
75 } // namespace mash 75 } // namespace mash
OLDNEW
« no previous file with comments | « mash/wm/root_window_controller.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698