| 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 "chrome/app/chrome_command_ids.h" | 8 #include "chrome/app/chrome_command_ids.h" |
| 9 #include "chrome/browser/profiles/profile.h" | 9 #include "chrome/browser/profiles/profile.h" |
| 10 #include "chrome/browser/ui/exclusive_access/exclusive_access_context.h" | 10 #include "chrome/browser/ui/exclusive_access/exclusive_access_context.h" |
| (...skipping 147 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 158 | 158 |
| 159 base::string16 ExclusiveAccessBubble::GetCurrentDenyButtonText() const { | 159 base::string16 ExclusiveAccessBubble::GetCurrentDenyButtonText() const { |
| 160 return exclusive_access_bubble::GetDenyButtonTextForType(bubble_type_); | 160 return exclusive_access_bubble::GetDenyButtonTextForType(bubble_type_); |
| 161 } | 161 } |
| 162 | 162 |
| 163 base::string16 ExclusiveAccessBubble::GetCurrentAllowButtonText() const { | 163 base::string16 ExclusiveAccessBubble::GetCurrentAllowButtonText() const { |
| 164 return exclusive_access_bubble::GetAllowButtonTextForType(bubble_type_, url_); | 164 return exclusive_access_bubble::GetAllowButtonTextForType(bubble_type_, url_); |
| 165 } | 165 } |
| 166 | 166 |
| 167 base::string16 ExclusiveAccessBubble::GetInstructionText() const { | 167 base::string16 ExclusiveAccessBubble::GetInstructionText() const { |
| 168 if (!ExclusiveAccessManager::IsSimplifiedFullscreenUIEnabled()) { |
| 169 return l10n_util::GetStringFUTF16( |
| 170 IDS_FULLSCREEN_PRESS_ESC_TO_EXIT_SENTENCE, |
| 171 l10n_util::GetStringUTF16(IDS_APP_ESC_KEY)); |
| 172 } |
| 173 |
| 168 return l10n_util::GetStringFUTF16(IDS_FULLSCREEN_PRESS_ESC_TO_EXIT, | 174 return l10n_util::GetStringFUTF16(IDS_FULLSCREEN_PRESS_ESC_TO_EXIT, |
| 169 l10n_util::GetStringUTF16(IDS_APP_ESC_KEY)); | 175 l10n_util::GetStringUTF16(IDS_APP_ESC_KEY)); |
| 170 } | 176 } |
| 171 | 177 |
| 172 void ExclusiveAccessBubble::ShowAndStartTimers() { | 178 void ExclusiveAccessBubble::ShowAndStartTimers() { |
| 173 Show(); | 179 Show(); |
| 174 | 180 |
| 175 // Do not allow the notification to hide for a few seconds. | 181 // Do not allow the notification to hide for a few seconds. |
| 176 hide_timeout_.Start(FROM_HERE, | 182 hide_timeout_.Start(FROM_HERE, |
| 177 base::TimeDelta::FromMilliseconds(kInitialDelayMs), this, | 183 base::TimeDelta::FromMilliseconds(kInitialDelayMs), this, |
| 178 &ExclusiveAccessBubble::CheckMousePosition); | 184 &ExclusiveAccessBubble::CheckMousePosition); |
| 179 | 185 |
| 180 // Do not show the notification again until a long time has elapsed. | 186 // Do not show the notification again until a long time has elapsed. |
| 181 suppress_notify_timeout_.Start( | 187 suppress_notify_timeout_.Start( |
| 182 FROM_HERE, base::TimeDelta::FromMilliseconds(kSnoozeNotificationsTimeMs), | 188 FROM_HERE, base::TimeDelta::FromMilliseconds(kSnoozeNotificationsTimeMs), |
| 183 this, &ExclusiveAccessBubble::CheckMousePosition); | 189 this, &ExclusiveAccessBubble::CheckMousePosition); |
| 184 } | 190 } |
| OLD | NEW |