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 <utility> |
7 #include <vector> | 8 #include <vector> |
8 | 9 |
9 #include "base/strings/string_util.h" | 10 #include "base/strings/string_util.h" |
10 #include "base/time/time.h" | 11 #include "base/time/time.h" |
11 #include "ui/aura/client/capture_client.h" | 12 #include "ui/aura/client/capture_client.h" |
12 #include "ui/aura/client/cursor_client.h" | 13 #include "ui/aura/client/cursor_client.h" |
13 #include "ui/aura/client/screen_position_client.h" | 14 #include "ui/aura/client/screen_position_client.h" |
14 #include "ui/aura/env.h" | 15 #include "ui/aura/env.h" |
15 #include "ui/aura/window.h" | 16 #include "ui/aura/window.h" |
16 #include "ui/events/event.h" | 17 #include "ui/events/event.h" |
(...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
117 | 118 |
118 } // namespace | 119 } // namespace |
119 | 120 |
120 //////////////////////////////////////////////////////////////////////////////// | 121 //////////////////////////////////////////////////////////////////////////////// |
121 // TooltipController public: | 122 // TooltipController public: |
122 | 123 |
123 TooltipController::TooltipController(scoped_ptr<Tooltip> tooltip) | 124 TooltipController::TooltipController(scoped_ptr<Tooltip> tooltip) |
124 : tooltip_window_(NULL), | 125 : tooltip_window_(NULL), |
125 tooltip_id_(NULL), | 126 tooltip_id_(NULL), |
126 tooltip_window_at_mouse_press_(NULL), | 127 tooltip_window_at_mouse_press_(NULL), |
127 tooltip_(tooltip.Pass()), | 128 tooltip_(std::move(tooltip)), |
128 tooltips_enabled_(true) { | 129 tooltips_enabled_(true) { |
129 tooltip_timer_.Start(FROM_HERE, | 130 tooltip_timer_.Start(FROM_HERE, |
130 base::TimeDelta::FromMilliseconds(kTooltipTimeoutMs), | 131 base::TimeDelta::FromMilliseconds(kTooltipTimeoutMs), |
131 this, &TooltipController::TooltipTimerFired); | 132 this, &TooltipController::TooltipTimerFired); |
132 } | 133 } |
133 | 134 |
134 TooltipController::~TooltipController() { | 135 TooltipController::~TooltipController() { |
135 if (tooltip_window_) | 136 if (tooltip_window_) |
136 tooltip_window_->RemoveObserver(this); | 137 tooltip_window_->RemoveObserver(this); |
137 } | 138 } |
(...skipping 233 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
371 return; | 372 return; |
372 if (tooltip_window_) | 373 if (tooltip_window_) |
373 tooltip_window_->RemoveObserver(this); | 374 tooltip_window_->RemoveObserver(this); |
374 tooltip_window_ = target; | 375 tooltip_window_ = target; |
375 if (tooltip_window_) | 376 if (tooltip_window_) |
376 tooltip_window_->AddObserver(this); | 377 tooltip_window_->AddObserver(this); |
377 } | 378 } |
378 | 379 |
379 } // namespace corewm | 380 } // namespace corewm |
380 } // namespace views | 381 } // namespace views |
OLD | NEW |