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 10 matching lines...) Expand all Loading... |
21 #include "ui/views/corewm/tooltip.h" | 21 #include "ui/views/corewm/tooltip.h" |
22 #include "ui/views/widget/tooltip_manager.h" | 22 #include "ui/views/widget/tooltip_manager.h" |
23 #include "ui/wm/public/drag_drop_client.h" | 23 #include "ui/wm/public/drag_drop_client.h" |
24 | 24 |
25 namespace views { | 25 namespace views { |
26 namespace corewm { | 26 namespace corewm { |
27 namespace { | 27 namespace { |
28 | 28 |
29 const int kTooltipTimeoutMs = 500; | 29 const int kTooltipTimeoutMs = 500; |
30 const int kDefaultTooltipShownTimeoutMs = 10000; | 30 const int kDefaultTooltipShownTimeoutMs = 10000; |
31 const size_t kMaxTooltipLength = 1024; | 31 const size_t kMaxTooltipLength = 2048; |
32 | 32 |
33 // Returns true if |target| is a valid window to get the tooltip from. | 33 // Returns true if |target| is a valid window to get the tooltip from. |
34 // |event_target| is the original target from the event and |target| the window | 34 // |event_target| is the original target from the event and |target| the window |
35 // at the same location. | 35 // at the same location. |
36 bool IsValidTarget(aura::Window* event_target, aura::Window* target) { | 36 bool IsValidTarget(aura::Window* event_target, aura::Window* target) { |
37 if (!target || (event_target == target)) | 37 if (!target || (event_target == target)) |
38 return true; | 38 return true; |
39 | 39 |
40 void* event_target_grouping_id = event_target->GetNativeWindowProperty( | 40 void* event_target_grouping_id = event_target->GetNativeWindowProperty( |
41 TooltipManager::kGroupingPropertyKey); | 41 TooltipManager::kGroupingPropertyKey); |
(...skipping 324 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
366 return; | 366 return; |
367 if (tooltip_window_) | 367 if (tooltip_window_) |
368 tooltip_window_->RemoveObserver(this); | 368 tooltip_window_->RemoveObserver(this); |
369 tooltip_window_ = target; | 369 tooltip_window_ = target; |
370 if (tooltip_window_) | 370 if (tooltip_window_) |
371 tooltip_window_->AddObserver(this); | 371 tooltip_window_->AddObserver(this); |
372 } | 372 } |
373 | 373 |
374 } // namespace corewm | 374 } // namespace corewm |
375 } // namespace views | 375 } // namespace views |
OLD | NEW |