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 "ash/tooltips/tooltip_controller.h" | 5 #include "ash/tooltips/tooltip_controller.h" |
6 | 6 |
7 #include <vector> | 7 #include <vector> |
8 | 8 |
9 #include "ash/ash_switches.h" | 9 #include "ash/ash_switches.h" |
10 #include "ash/shell.h" | 10 #include "ash/shell.h" |
(...skipping 391 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
402 // If we come here from UpdateTooltip(), we have already checked for tooltip | 402 // If we come here from UpdateTooltip(), we have already checked for tooltip |
403 // visibility and this check below will have no effect. | 403 // visibility and this check below will have no effect. |
404 if (tooltip_text_ != tooltip_text || !tooltip_->IsVisible()) { | 404 if (tooltip_text_ != tooltip_text || !tooltip_->IsVisible()) { |
405 tooltip_text_ = tooltip_text; | 405 tooltip_text_ = tooltip_text; |
406 if (tooltip_text_.empty()) { | 406 if (tooltip_text_.empty()) { |
407 tooltip_->Hide(); | 407 tooltip_->Hide(); |
408 } else { | 408 } else { |
409 string16 tooltip_text(tooltip_text_); | 409 string16 tooltip_text(tooltip_text_); |
410 gfx::Point widget_loc = curr_mouse_loc_; | 410 gfx::Point widget_loc = curr_mouse_loc_; |
411 widget_loc = widget_loc.Add( | 411 widget_loc = widget_loc.Add( |
412 tooltip_window_->GetScreenBounds().origin()); | 412 tooltip_window_->GetBoundsInScreen().origin()); |
413 tooltip_->SetText(tooltip_text, widget_loc); | 413 tooltip_->SetText(tooltip_text, widget_loc); |
414 tooltip_->Show(); | 414 tooltip_->Show(); |
415 } | 415 } |
416 } | 416 } |
417 } | 417 } |
418 | 418 |
419 bool TooltipController::IsTooltipVisible() { | 419 bool TooltipController::IsTooltipVisible() { |
420 return tooltip_->IsVisible(); | 420 return tooltip_->IsVisible(); |
421 } | 421 } |
422 | 422 |
423 bool TooltipController::IsDragDropInProgress() { | 423 bool TooltipController::IsDragDropInProgress() { |
424 return drag_drop_client_->IsDragDropInProgress(); | 424 return drag_drop_client_->IsDragDropInProgress(); |
425 } | 425 } |
426 | 426 |
427 } // namespace internal | 427 } // namespace internal |
428 } // namespace ash | 428 } // namespace ash |
OLD | NEW |