| 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/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 Loading... |
| 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 Loading... |
| 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 |
| OLD | NEW |