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 return l10n_util::GetStringFUTF16(IDS_FULLSCREEN_PRESS_ESC_TO_EXIT, | 168 if (ExclusiveAccessManager::IsSimplifiedFullscreenUIEnabled()) { |
169 l10n_util::GetStringUTF16(IDS_APP_ESC_KEY)); | 169 return l10n_util::GetStringFUTF16( |
170 IDS_FULLSCREEN_PRESS_ESC_TO_EXIT, | |
171 l10n_util::GetStringUTF16(IDS_APP_ESC_KEY)); | |
172 } else { | |
msw
2015/10/29 17:50:02
no else after return
Matt Giuca
2015/11/09 06:35:12
Done.
| |
173 return l10n_util::GetStringFUTF16( | |
174 IDS_FULLSCREEN_PRESS_ESC_TO_EXIT_SENTENCE, | |
175 l10n_util::GetStringUTF16(IDS_APP_ESC_KEY)); | |
176 } | |
170 } | 177 } |
171 | 178 |
172 void ExclusiveAccessBubble::ShowAndStartTimers() { | 179 void ExclusiveAccessBubble::ShowAndStartTimers() { |
173 Show(); | 180 Show(); |
174 | 181 |
175 // Do not allow the notification to hide for a few seconds. | 182 // Do not allow the notification to hide for a few seconds. |
176 hide_timeout_.Start(FROM_HERE, | 183 hide_timeout_.Start(FROM_HERE, |
177 base::TimeDelta::FromMilliseconds(kInitialDelayMs), this, | 184 base::TimeDelta::FromMilliseconds(kInitialDelayMs), this, |
178 &ExclusiveAccessBubble::CheckMousePosition); | 185 &ExclusiveAccessBubble::CheckMousePosition); |
179 | 186 |
180 // Do not show the notification again until a long time has elapsed. | 187 // Do not show the notification again until a long time has elapsed. |
181 suppress_notify_timeout_.Start( | 188 suppress_notify_timeout_.Start( |
182 FROM_HERE, base::TimeDelta::FromMilliseconds(kSnoozeNotificationsTimeMs), | 189 FROM_HERE, base::TimeDelta::FromMilliseconds(kSnoozeNotificationsTimeMs), |
183 this, &ExclusiveAccessBubble::CheckMousePosition); | 190 this, &ExclusiveAccessBubble::CheckMousePosition); |
184 } | 191 } |
OLD | NEW |