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 "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 // Record UMA for when the bubble is re-shown. | |
|
scheib
2016/02/23 23:52:26
Comment won't be needed when method renamed.
Matt Giuca
2016/02/24 03:00:31
Done.
| |
| 61 manager_->BubbleReshown(bubble_type_); | |
| 62 | |
| 60 ShowAndStartTimers(); | 63 ShowAndStartTimers(); |
| 61 return; | 64 return; |
| 62 } | 65 } |
| 63 | 66 |
| 64 // The timer has not elapsed, but the user provided some input. Reset the | 67 // 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.) | 68 // timer. (We only want to re-show the message after a period of inactivity.) |
| 66 suppress_notify_timeout_.Reset(); | 69 suppress_notify_timeout_.Reset(); |
| 67 } | 70 } |
| 68 | 71 |
| 69 void ExclusiveAccessBubble::StartWatchingMouse() { | 72 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. | 198 // Do not allow the notification to hide for a few seconds. |
| 196 hide_timeout_.Start(FROM_HERE, | 199 hide_timeout_.Start(FROM_HERE, |
| 197 base::TimeDelta::FromMilliseconds(kInitialDelayMs), this, | 200 base::TimeDelta::FromMilliseconds(kInitialDelayMs), this, |
| 198 &ExclusiveAccessBubble::CheckMousePosition); | 201 &ExclusiveAccessBubble::CheckMousePosition); |
| 199 | 202 |
| 200 // Do not show the notification again until a long time has elapsed. | 203 // Do not show the notification again until a long time has elapsed. |
| 201 suppress_notify_timeout_.Start( | 204 suppress_notify_timeout_.Start( |
| 202 FROM_HERE, base::TimeDelta::FromMilliseconds(kSnoozeNotificationsTimeMs), | 205 FROM_HERE, base::TimeDelta::FromMilliseconds(kSnoozeNotificationsTimeMs), |
| 203 this, &ExclusiveAccessBubble::CheckMousePosition); | 206 this, &ExclusiveAccessBubble::CheckMousePosition); |
| 204 } | 207 } |
| OLD | NEW |