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

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

Issue 2024313002: Moves mash/wm/public -> ash/public (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/shelf_layout_manager.cc ('k') | mash/wm/user_window_controller_impl.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 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/status_layout_manager.h" 5 #include "mash/wm/status_layout_manager.h"
6 6
7 #include "ash/public/interfaces/ash_window_type.mojom.h"
7 #include "components/mus/public/cpp/window.h" 8 #include "components/mus/public/cpp/window.h"
8 #include "mash/wm/property_util.h" 9 #include "mash/wm/property_util.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"
11 11
12 namespace mash { 12 namespace mash {
13 namespace wm { 13 namespace wm {
14 14
15 StatusLayoutManager::StatusLayoutManager(mus::Window* owner) 15 StatusLayoutManager::StatusLayoutManager(mus::Window* owner)
16 : LayoutManager(owner), 16 : LayoutManager(owner),
17 alignment_(mash::shelf::mojom::Alignment::BOTTOM), 17 alignment_(mash::shelf::mojom::Alignment::BOTTOM),
18 auto_hide_behavior_(mash::shelf::mojom::AutoHideBehavior::NEVER) { 18 auto_hide_behavior_(mash::shelf::mojom::AutoHideBehavior::NEVER) {
19 AddLayoutProperty(mus::mojom::WindowManager::kPreferredSize_Property); 19 AddLayoutProperty(mus::mojom::WindowManager::kPreferredSize_Property);
20 } 20 }
21 21
22 StatusLayoutManager::~StatusLayoutManager() {} 22 StatusLayoutManager::~StatusLayoutManager() {}
23 23
24 // We explicitly don't make assertions about the number of children in this 24 // We explicitly don't make assertions about the number of children in this
25 // layout as the number of children can vary when the application providing the 25 // layout as the number of children can vary when the application providing the
26 // status area restarts. 26 // status area restarts.
27 27
28 void StatusLayoutManager::LayoutWindow(mus::Window* window) { 28 void StatusLayoutManager::LayoutWindow(mus::Window* window) {
29 if (GetAshWindowType(window) != mojom::AshWindowType::STATUS_AREA) { 29 if (GetAshWindowType(window) != ash::mojom::AshWindowType::STATUS_AREA) {
30 // TODO(jamescook): Layout for notifications and other windows. 30 // TODO(jamescook): Layout for notifications and other windows.
31 NOTIMPLEMENTED() << "Non-status-area window needs layout."; 31 NOTIMPLEMENTED() << "Non-status-area window needs layout.";
32 return; 32 return;
33 } 33 }
34 gfx::Size size = GetWindowPreferredSize(window); 34 gfx::Size size = GetWindowPreferredSize(window);
35 if (alignment_ == mash::shelf::mojom::Alignment::BOTTOM) { 35 if (alignment_ == mash::shelf::mojom::Alignment::BOTTOM) {
36 const int y = owner()->bounds().height() - size.height(); 36 const int y = owner()->bounds().height() - size.height();
37 // TODO(msw): Place the status area widget on the left for RTL UIs. 37 // TODO(msw): Place the status area widget on the left for RTL UIs.
38 window->SetBounds(gfx::Rect(owner()->bounds().width() - size.width(), y, 38 window->SetBounds(gfx::Rect(owner()->bounds().width() - size.width(), y,
39 size.width(), size.height())); 39 size.width(), size.height()));
(...skipping 20 matching lines...) Expand all
60 mash::shelf::mojom::AutoHideBehavior auto_hide) { 60 mash::shelf::mojom::AutoHideBehavior auto_hide) {
61 if (auto_hide_behavior_ == auto_hide) 61 if (auto_hide_behavior_ == auto_hide)
62 return; 62 return;
63 63
64 auto_hide_behavior_ = auto_hide; 64 auto_hide_behavior_ = auto_hide;
65 NOTIMPLEMENTED(); 65 NOTIMPLEMENTED();
66 } 66 }
67 67
68 } // namespace wm 68 } // namespace wm
69 } // namespace mash 69 } // namespace mash
OLDNEW
« no previous file with comments | « mash/wm/shelf_layout_manager.cc ('k') | mash/wm/user_window_controller_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698