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

Side by Side Diff: ash/mus/bridge/mus_layout_manager_adapter.cc

Issue 2578373002: Removes some dead code and includes (Closed)
Patch Set: Created 4 years 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/mus_layout_manager_adapter.h ('k') | ash/mus/bridge/wm_window_mus.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright 2016 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #include "ash/mus/bridge/mus_layout_manager_adapter.h"
6
7 #include "ash/common/wm_layout_manager.h"
8 #include "ash/mus/bridge/wm_window_mus.h"
9 #include "services/ui/public/cpp/window.h"
10
11 namespace ash {
12 namespace mus {
13
14 MusLayoutManagerAdapter::MusLayoutManagerAdapter(
15 ui::Window* window,
16 std::unique_ptr<WmLayoutManager> layout_manager)
17 : window_(window),
18 layout_manager_(std::move(layout_manager)) {
19 window_->AddObserver(this);
20 }
21
22 MusLayoutManagerAdapter::~MusLayoutManagerAdapter() {
23 window_->RemoveObserver(this);
24 }
25
26 void MusLayoutManagerAdapter::OnTreeChanging(const TreeChangeParams& params) {
27 if (params.old_parent == window_) {
28 layout_manager_->OnWillRemoveWindowFromLayout(
29 WmWindowMus::Get(params.target));
30 }
31 }
32
33 void MusLayoutManagerAdapter::OnTreeChanged(const TreeChangeParams& params) {
34 if (params.new_parent == window_)
35 layout_manager_->OnWindowAddedToLayout(WmWindowMus::Get(params.target));
36 else if (params.old_parent == window_)
37 layout_manager_->OnWindowRemovedFromLayout(WmWindowMus::Get(params.target));
38 }
39
40 void MusLayoutManagerAdapter::OnWindowBoundsChanged(
41 ui::Window* window,
42 const gfx::Rect& old_bounds,
43 const gfx::Rect& new_bounds) {
44 layout_manager_->OnWindowResized();
45 }
46
47 void MusLayoutManagerAdapter::OnChildWindowVisibilityChanged(ui::Window* window,
48 bool visible) {
49 layout_manager_->OnChildWindowVisibilityChanged(WmWindowMus::Get(window),
50 visible);
51 }
52
53 } // namespace mus
54 } // namespace ash
OLDNEW
« no previous file with comments | « ash/mus/bridge/mus_layout_manager_adapter.h ('k') | ash/mus/bridge/wm_window_mus.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698