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

Side by Side Diff: ui/views/corewm/tooltip_controller.cc

Issue 101013002: Make sure WindowObservers are removed from window before destruction (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix shutdown order Created 7 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 | Annotate | Revision Log
« no previous file with comments | « ui/aura/window_observer.h ('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 (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/views/corewm/tooltip_controller.h" 5 #include "ui/views/corewm/tooltip_controller.h"
6 6
7 #include <vector> 7 #include <vector>
8 8
9 #include "base/strings/string_util.h" 9 #include "base/strings/string_util.h"
10 #include "base/time/time.h" 10 #include "base/time/time.h"
(...skipping 209 matching lines...) Expand 10 before | Expand all | Expand 10 after
220 } 220 }
221 221
222 void TooltipController::OnCancelMode(ui::CancelModeEvent* event) { 222 void TooltipController::OnCancelMode(ui::CancelModeEvent* event) {
223 tooltip_->Hide(); 223 tooltip_->Hide();
224 } 224 }
225 225
226 void TooltipController::OnWindowDestroyed(aura::Window* window) { 226 void TooltipController::OnWindowDestroyed(aura::Window* window) {
227 if (tooltip_window_ == window) { 227 if (tooltip_window_ == window) {
228 tooltip_->Hide(); 228 tooltip_->Hide();
229 tooltip_shown_timeout_map_.erase(tooltip_window_); 229 tooltip_shown_timeout_map_.erase(tooltip_window_);
230 tooltip_window_->RemoveObserver(this);
231 tooltip_window_ = NULL; 230 tooltip_window_ = NULL;
232 } 231 }
233 } 232 }
234 233
235 //////////////////////////////////////////////////////////////////////////////// 234 ////////////////////////////////////////////////////////////////////////////////
236 // TooltipController private: 235 // TooltipController private:
237 236
238 void TooltipController::TooltipTimerFired() { 237 void TooltipController::TooltipTimerFired() {
239 UpdateIfRequired(); 238 UpdateIfRequired();
240 } 239 }
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after
329 int TooltipController::GetTooltipShownTimeout() { 328 int TooltipController::GetTooltipShownTimeout() {
330 std::map<aura::Window*, int>::const_iterator it = 329 std::map<aura::Window*, int>::const_iterator it =
331 tooltip_shown_timeout_map_.find(tooltip_window_); 330 tooltip_shown_timeout_map_.find(tooltip_window_);
332 if (it == tooltip_shown_timeout_map_.end()) 331 if (it == tooltip_shown_timeout_map_.end())
333 return kDefaultTooltipShownTimeoutMs; 332 return kDefaultTooltipShownTimeoutMs;
334 return it->second; 333 return it->second;
335 } 334 }
336 335
337 } // namespace corewm 336 } // namespace corewm
338 } // namespace views 337 } // namespace views
OLDNEW
« no previous file with comments | « ui/aura/window_observer.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698