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

Side by Side Diff: ash/wm/aura/wm_shelf_aura.cc

Issue 1914093002: Refactors DockedWindowLayoutManager in terms of ash/wm/common (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@nuke_aura_window
Patch Set: merge 2 trunk Created 4 years, 7 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
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/wm/aura/wm_shelf_aura.h"
6
7 #include "ash/shelf/shelf.h"
8 #include "ash/shelf/shelf_layout_manager.h"
9 #include "ash/wm/common/shelf/wm_shelf_observer.h"
10 #include "ash/wm/common/wm_window.h"
11 #include "ui/views/widget/widget.h"
12
13 namespace ash {
14 namespace wm {
15
16 WmShelfAura::WmShelfAura(Shelf* shelf)
17 : shelf_(shelf), shelf_layout_manager_(shelf->shelf_layout_manager()) {
18 shelf_layout_manager_->AddObserver(this);
19 }
20
21 WmShelfAura::~WmShelfAura() {
22 if (shelf_layout_manager_)
23 shelf_layout_manager_->RemoveObserver(this);
24 }
25
26 WmWindow* WmShelfAura::GetWindow() {
27 return WmWindow::Get(shelf_->shelf_widget());
28 }
29
30 ShelfAlignment WmShelfAura::GetAlignment() {
31 return shelf_->alignment();
32 }
33
34 ShelfBackgroundType WmShelfAura::GetBackgroundType() {
35 return shelf_->shelf_widget()->GetBackgroundType();
36 }
37
38 void WmShelfAura::UpdateVisibilityState() {
39 shelf_->shelf_layout_manager()->UpdateVisibilityState();
40 }
41
42 void WmShelfAura::AddObserver(WmShelfObserver* observer) {
43 observers_.AddObserver(observer);
44 }
45
46 void WmShelfAura::RemoveObserver(WmShelfObserver* observer) {
47 observers_.RemoveObserver(observer);
48 }
49
50 void WmShelfAura::WillDeleteShelf() {
51 shelf_layout_manager_->RemoveObserver(this);
52 shelf_layout_manager_ = nullptr;
53 }
54
55 void WmShelfAura::OnBackgroundUpdated(
56 wm::ShelfBackgroundType background_type,
57 BackgroundAnimatorChangeType change_type) {
58 FOR_EACH_OBSERVER(WmShelfObserver, observers_,
59 OnBackgroundUpdated(background_type, change_type));
60 }
61
62 } // namespace wm
63 } // namespace ash
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698