OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 "ui/aura/window.h" | 5 #include "ui/aura/window.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 | 8 |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/bind_helpers.h" | 10 #include "base/bind_helpers.h" |
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
86 parent_(NULL), | 86 parent_(NULL), |
87 visible_(false), | 87 visible_(false), |
88 id_(-1), | 88 id_(-1), |
89 transparent_(false), | 89 transparent_(false), |
90 user_data_(NULL), | 90 user_data_(NULL), |
91 ignore_events_(false), | 91 ignore_events_(false), |
92 // Don't notify newly added observers during notification. This causes | 92 // Don't notify newly added observers during notification. This causes |
93 // problems for code that adds an observer as part of an observer | 93 // problems for code that adds an observer as part of an observer |
94 // notification (such as the workspace code). | 94 // notification (such as the workspace code). |
95 observers_(base::ObserverList<WindowObserver>::NOTIFY_EXISTING_ONLY) { | 95 observers_(base::ObserverList<WindowObserver>::NOTIFY_EXISTING_ONLY) { |
96 set_target_handler(delegate_); | 96 ignore_result(SetTargetHandler(delegate_)); |
97 } | 97 } |
98 | 98 |
99 Window::~Window() { | 99 Window::~Window() { |
100 if (layer()->owner() == this) | 100 if (layer()->owner() == this) |
101 layer()->CompleteAllAnimations(); | 101 layer()->CompleteAllAnimations(); |
102 layer()->SuppressPaint(); | 102 layer()->SuppressPaint(); |
103 | 103 |
104 // Let the delegate know we're in the processing of destroying. | 104 // Let the delegate know we're in the processing of destroying. |
105 if (delegate_) | 105 if (delegate_) |
106 delegate_->OnWindowDestroying(this); | 106 delegate_->OnWindowDestroying(this); |
107 FOR_EACH_OBSERVER(WindowObserver, observers_, OnWindowDestroying(this)); | 107 FOR_EACH_OBSERVER(WindowObserver, observers_, OnWindowDestroying(this)); |
108 | 108 |
109 // While we are being destroyed, our target handler may also be in the | 109 // While we are being destroyed, our target handler may also be in the |
110 // process of destruction or already destroyed, so do not forward any | 110 // process of destruction or already destroyed, so do not forward any |
111 // input events at the ui::EP_TARGET phase. | 111 // input events at the ui::EP_TARGET phase. |
112 set_target_handler(nullptr); | 112 ignore_result(SetTargetHandler(nullptr)); |
113 | 113 |
114 // TODO(beng): See comment in window_event_dispatcher.h. This shouldn't be | 114 // TODO(beng): See comment in window_event_dispatcher.h. This shouldn't be |
115 // necessary but unfortunately is right now due to ordering | 115 // necessary but unfortunately is right now due to ordering |
116 // peculiarities. WED must be notified _after_ other observers | 116 // peculiarities. WED must be notified _after_ other observers |
117 // are notified of pending teardown but before the hierarchy | 117 // are notified of pending teardown but before the hierarchy |
118 // is actually torn down. | 118 // is actually torn down. |
119 WindowTreeHost* host = GetHost(); | 119 WindowTreeHost* host = GetHost(); |
120 if (host) | 120 if (host) |
121 host->dispatcher()->OnPostNotifiedWindowDestroying(this); | 121 host->dispatcher()->OnPostNotifiedWindowDestroying(this); |
122 | 122 |
(...skipping 985 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1108 layer_name = "Unnamed Window"; | 1108 layer_name = "Unnamed Window"; |
1109 | 1109 |
1110 if (id_ != -1) | 1110 if (id_ != -1) |
1111 layer_name += " " + base::IntToString(id_); | 1111 layer_name += " " + base::IntToString(id_); |
1112 | 1112 |
1113 layer()->set_name(layer_name); | 1113 layer()->set_name(layer_name); |
1114 #endif | 1114 #endif |
1115 } | 1115 } |
1116 | 1116 |
1117 } // namespace aura | 1117 } // namespace aura |
OLD | NEW |