Chromium Code Reviews| 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 167 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 178 TooltipShownTimerFired(); | 178 TooltipShownTimerFired(); |
| 179 } | 179 } |
| 180 } | 180 } |
| 181 | 181 |
| 182 void TooltipController::OnMouseEvent(ui::MouseEvent* event) { | 182 void TooltipController::OnMouseEvent(ui::MouseEvent* event) { |
| 183 switch (event->type()) { | 183 switch (event->type()) { |
| 184 case ui::ET_MOUSE_CAPTURE_CHANGED: | 184 case ui::ET_MOUSE_CAPTURE_CHANGED: |
| 185 case ui::ET_MOUSE_EXITED: | 185 case ui::ET_MOUSE_EXITED: |
| 186 case ui::ET_MOUSE_MOVED: | 186 case ui::ET_MOUSE_MOVED: |
| 187 case ui::ET_MOUSE_DRAGGED: { | 187 case ui::ET_MOUSE_DRAGGED: { |
| 188 if (!tooltips_enabled_ || | |
|
sky
2014/05/20 20:43:22
I think this early out is too early. You still wan
varkha
2014/05/20 21:12:26
You are right - for the capture changes and mouse
| |
| 189 aura::Env::GetInstance()->IsMouseButtonDown() || | |
| 190 IsDragDropInProgress()) { | |
| 191 break; | |
| 192 } | |
| 193 | |
| 188 curr_mouse_loc_ = event->location(); | 194 curr_mouse_loc_ = event->location(); |
| 189 aura::Window* target = GetTooltipTarget(*event, &curr_mouse_loc_); | 195 aura::Window* target = GetTooltipTarget(*event, &curr_mouse_loc_); |
| 190 SetTooltipWindow(target); | 196 SetTooltipWindow(target); |
| 191 if (tooltip_timer_.IsRunning()) | 197 if (tooltip_timer_.IsRunning()) |
| 192 tooltip_timer_.Reset(); | 198 tooltip_timer_.Reset(); |
| 193 | 199 |
| 194 if (tooltip_->IsVisible()) | 200 if (tooltip_->IsVisible()) |
| 195 UpdateIfRequired(); | 201 UpdateIfRequired(); |
| 196 break; | 202 break; |
| 197 } | 203 } |
| (...skipping 146 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 344 return; | 350 return; |
| 345 if (tooltip_window_) | 351 if (tooltip_window_) |
| 346 tooltip_window_->RemoveObserver(this); | 352 tooltip_window_->RemoveObserver(this); |
| 347 tooltip_window_ = target; | 353 tooltip_window_ = target; |
| 348 if (tooltip_window_) | 354 if (tooltip_window_) |
| 349 tooltip_window_->AddObserver(this); | 355 tooltip_window_->AddObserver(this); |
| 350 } | 356 } |
| 351 | 357 |
| 352 } // namespace corewm | 358 } // namespace corewm |
| 353 } // namespace views | 359 } // namespace views |
| OLD | NEW |