| 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 "chrome/browser/ui/exclusive_access/exclusive_access_bubble.h" | 5 #include "chrome/browser/ui/exclusive_access/exclusive_access_bubble.h" |
| 6 | 6 |
| 7 #include "base/strings/utf_string_conversions.h" | 7 #include "base/strings/utf_string_conversions.h" |
| 8 #include "build/build_config.h" | 8 #include "build/build_config.h" |
| 9 #include "chrome/app/chrome_command_ids.h" | 9 #include "chrome/app/chrome_command_ids.h" |
| 10 #include "chrome/browser/profiles/profile.h" | 10 #include "chrome/browser/profiles/profile.h" |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 50 return; | 50 return; |
| 51 | 51 |
| 52 // We got some user input; reset the idle timer. | 52 // We got some user input; reset the idle timer. |
| 53 idle_timeout_.Stop(); // If the timer isn't running, this is a no-op. | 53 idle_timeout_.Stop(); // If the timer isn't running, this is a no-op. |
| 54 idle_timeout_.Start(FROM_HERE, | 54 idle_timeout_.Start(FROM_HERE, |
| 55 base::TimeDelta::FromMilliseconds(kIdleTimeMs), this, | 55 base::TimeDelta::FromMilliseconds(kIdleTimeMs), this, |
| 56 &ExclusiveAccessBubble::CheckMousePosition); | 56 &ExclusiveAccessBubble::CheckMousePosition); |
| 57 | 57 |
| 58 // If the notification suppression timer has elapsed, re-show it. | 58 // If the notification suppression timer has elapsed, re-show it. |
| 59 if (!suppress_notify_timeout_.IsRunning()) { | 59 if (!suppress_notify_timeout_.IsRunning()) { |
| 60 manager_->RecordBubbleReshownUMA(bubble_type_); |
| 61 |
| 60 ShowAndStartTimers(); | 62 ShowAndStartTimers(); |
| 61 return; | 63 return; |
| 62 } | 64 } |
| 63 | 65 |
| 64 // The timer has not elapsed, but the user provided some input. Reset the | 66 // The timer has not elapsed, but the user provided some input. Reset the |
| 65 // timer. (We only want to re-show the message after a period of inactivity.) | 67 // timer. (We only want to re-show the message after a period of inactivity.) |
| 66 suppress_notify_timeout_.Reset(); | 68 suppress_notify_timeout_.Reset(); |
| 67 } | 69 } |
| 68 | 70 |
| 69 void ExclusiveAccessBubble::StartWatchingMouse() { | 71 void ExclusiveAccessBubble::StartWatchingMouse() { |
| (...skipping 125 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 195 // Do not allow the notification to hide for a few seconds. | 197 // Do not allow the notification to hide for a few seconds. |
| 196 hide_timeout_.Start(FROM_HERE, | 198 hide_timeout_.Start(FROM_HERE, |
| 197 base::TimeDelta::FromMilliseconds(kInitialDelayMs), this, | 199 base::TimeDelta::FromMilliseconds(kInitialDelayMs), this, |
| 198 &ExclusiveAccessBubble::CheckMousePosition); | 200 &ExclusiveAccessBubble::CheckMousePosition); |
| 199 | 201 |
| 200 // Do not show the notification again until a long time has elapsed. | 202 // Do not show the notification again until a long time has elapsed. |
| 201 suppress_notify_timeout_.Start( | 203 suppress_notify_timeout_.Start( |
| 202 FROM_HERE, base::TimeDelta::FromMilliseconds(kSnoozeNotificationsTimeMs), | 204 FROM_HERE, base::TimeDelta::FromMilliseconds(kSnoozeNotificationsTimeMs), |
| 203 this, &ExclusiveAccessBubble::CheckMousePosition); | 205 this, &ExclusiveAccessBubble::CheckMousePosition); |
| 204 } | 206 } |
| OLD | NEW |