| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 "components/mus/ws/server_window.h" | 5 #include "components/mus/ws/server_window.h" |
| 6 | 6 |
| 7 #include <inttypes.h> | 7 #include <inttypes.h> |
| 8 | 8 |
| 9 #include "base/strings/stringprintf.h" | 9 #include "base/strings/stringprintf.h" |
| 10 #include "components/mus/ws/server_window_delegate.h" | 10 #include "components/mus/ws/server_window_delegate.h" |
| 11 #include "components/mus/ws/server_window_observer.h" | 11 #include "components/mus/ws/server_window_observer.h" |
| 12 #include "mojo/converters/geometry/geometry_type_converters.h" | 12 #include "mojo/converters/geometry/geometry_type_converters.h" |
| 13 | 13 |
| 14 namespace mus { | 14 namespace mus { |
| 15 | 15 |
| 16 namespace ws { | 16 namespace ws { |
| 17 | 17 |
| 18 ServerWindow::ServerWindow(ServerWindowDelegate* delegate, const WindowId& id) | 18 ServerWindow::ServerWindow(ServerWindowDelegate* delegate, const WindowId& id) |
| 19 : delegate_(delegate), | 19 : delegate_(delegate), |
| 20 id_(id), | 20 id_(id), |
| 21 parent_(nullptr), | 21 parent_(nullptr), |
| 22 visible_(false), | 22 visible_(false), |
| 23 opacity_(1), | 23 opacity_(1), |
| 24 is_draggable_window_container_(false), | |
| 25 // Don't notify newly added observers during notification. This causes | 24 // Don't notify newly added observers during notification. This causes |
| 26 // problems for code that adds an observer as part of an observer | 25 // problems for code that adds an observer as part of an observer |
| 27 // notification (such as ServerWindowDrawTracker). | 26 // notification (such as ServerWindowDrawTracker). |
| 28 observers_( | 27 observers_( |
| 29 base::ObserverList<ServerWindowObserver>::NOTIFY_EXISTING_ONLY) { | 28 base::ObserverList<ServerWindowObserver>::NOTIFY_EXISTING_ONLY) { |
| 30 DCHECK(delegate); // Must provide a delegate. | 29 DCHECK(delegate); // Must provide a delegate. |
| 31 } | 30 } |
| 32 | 31 |
| 33 ServerWindow::~ServerWindow() { | 32 ServerWindow::~ServerWindow() { |
| 34 FOR_EACH_OBSERVER(ServerWindowObserver, observers_, | 33 FOR_EACH_OBSERVER(ServerWindowObserver, observers_, |
| (...skipping 240 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 275 #endif | 274 #endif |
| 276 | 275 |
| 277 void ServerWindow::RemoveImpl(ServerWindow* window) { | 276 void ServerWindow::RemoveImpl(ServerWindow* window) { |
| 278 window->parent_ = NULL; | 277 window->parent_ = NULL; |
| 279 children_.erase(std::find(children_.begin(), children_.end(), window)); | 278 children_.erase(std::find(children_.begin(), children_.end(), window)); |
| 280 } | 279 } |
| 281 | 280 |
| 282 } // namespace ws | 281 } // namespace ws |
| 283 | 282 |
| 284 } // namespace mus | 283 } // namespace mus |
| OLD | NEW |