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

Side by Side Diff: mash/wm/bridge/wm_window_mus.cc

Issue 1983343002: Makes mus::Window and mash::wm::WmWindowMus notify existing observers only (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: 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
« no previous file with comments | « components/mus/public/cpp/lib/window.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 2016 The Chromium Authors. All rights reserved. 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 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/bridge/wm_window_mus.h" 5 #include "mash/wm/bridge/wm_window_mus.h"
6 6
7 #include "ash/wm/common/container_finder.h" 7 #include "ash/wm/common/container_finder.h"
8 #include "ash/wm/common/window_state.h" 8 #include "ash/wm/common/window_state.h"
9 #include "ash/wm/common/wm_layout_manager.h" 9 #include "ash/wm/common/wm_layout_manager.h"
10 #include "ash/wm/common/wm_window_observer.h" 10 #include "ash/wm/common/wm_window_observer.h"
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after
84 case ui::SHOW_STATE_DOCKED: 84 case ui::SHOW_STATE_DOCKED:
85 return mus::mojom::ShowState::DOCKED; 85 return mus::mojom::ShowState::DOCKED;
86 default: 86 default:
87 break; 87 break;
88 } 88 }
89 return mus::mojom::ShowState::DEFAULT; 89 return mus::mojom::ShowState::DEFAULT;
90 } 90 }
91 91
92 } // namespace 92 } // namespace
93 93
94 WmWindowMus::WmWindowMus(mus::Window* window) : window_(window) { 94 WmWindowMus::WmWindowMus(mus::Window* window)
95 : window_(window),
96 // Matches aura, see aura::Window for details.
97 observers_(
98 base::ObserverList<ash::wm::WmWindowObserver>::NOTIFY_EXISTING_ONLY) {
95 window_->AddObserver(this); 99 window_->AddObserver(this);
96 window_->SetLocalProperty(kWmWindowKey, this); 100 window_->SetLocalProperty(kWmWindowKey, this);
97 window_state_.reset(new WindowStateMus(this)); 101 window_state_.reset(new WindowStateMus(this));
98 } 102 }
99 103
100 WmWindowMus::~WmWindowMus() { 104 WmWindowMus::~WmWindowMus() {
101 window_->RemoveObserver(this); 105 window_->RemoveObserver(this);
102 } 106 }
103 107
104 // static 108 // static
(...skipping 488 matching lines...) Expand 10 before | Expand all | Expand 10 after
593 OnWindowBoundsChanged(this, old_bounds, new_bounds)); 597 OnWindowBoundsChanged(this, old_bounds, new_bounds));
594 } 598 }
595 599
596 void WmWindowMus::OnWindowDestroying(mus::Window* window) { 600 void WmWindowMus::OnWindowDestroying(mus::Window* window) {
597 FOR_EACH_OBSERVER(ash::wm::WmWindowObserver, observers_, 601 FOR_EACH_OBSERVER(ash::wm::WmWindowObserver, observers_,
598 OnWindowDestroying(this)); 602 OnWindowDestroying(this));
599 } 603 }
600 604
601 } // namespace wm 605 } // namespace wm
602 } // namespace mash 606 } // namespace mash
OLDNEW
« no previous file with comments | « components/mus/public/cpp/lib/window.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698