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 163 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
174 base::string16 ExclusiveAccessBubble::GetCurrentDenyButtonText() const { | 174 base::string16 ExclusiveAccessBubble::GetCurrentDenyButtonText() const { |
175 return exclusive_access_bubble::GetDenyButtonTextForType(bubble_type_); | 175 return exclusive_access_bubble::GetDenyButtonTextForType(bubble_type_); |
176 } | 176 } |
177 | 177 |
178 base::string16 ExclusiveAccessBubble::GetCurrentAllowButtonText() const { | 178 base::string16 ExclusiveAccessBubble::GetCurrentAllowButtonText() const { |
179 return exclusive_access_bubble::GetAllowButtonTextForType(bubble_type_, url_); | 179 return exclusive_access_bubble::GetAllowButtonTextForType(bubble_type_, url_); |
180 } | 180 } |
181 | 181 |
182 base::string16 ExclusiveAccessBubble::GetInstructionText( | 182 base::string16 ExclusiveAccessBubble::GetInstructionText( |
183 const base::string16& accelerator) const { | 183 const base::string16& accelerator) const { |
184 #if defined(OS_MACOSX) | |
185 // On Mac, if simplified-fullscreen is disabled, the Cocoa code is unable to | |
186 // deal with the special formatting returned by GetInstructionTextForType, so | |
187 // just return the old string. | |
188 if (!ExclusiveAccessManager::IsSimplifiedFullscreenUIEnabled()) { | |
189 return l10n_util::GetStringFUTF16(IDS_FULLSCREEN_PRESS_ESC_TO_EXIT_SENTENCE, | |
190 accelerator); | |
191 } | |
192 #endif | |
193 | |
194 return exclusive_access_bubble::GetInstructionTextForType(bubble_type_, | 184 return exclusive_access_bubble::GetInstructionTextForType(bubble_type_, |
tapted
2016/05/25 03:53:27
Can ExclusiveAccessBubbleViews::UpdateViewContent(
Matt Giuca
2016/05/26 04:15:40
No, because EABV doesn't have access to bubble_typ
tapted
2016/05/26 05:08:41
Sure it does. It assigns it in fact.
https://code
Matt Giuca
2016/05/26 05:57:30
Oh OK, gross. Well I still think this is a useful
| |
195 accelerator); | 185 accelerator); |
196 } | 186 } |
197 | 187 |
198 void ExclusiveAccessBubble::ShowAndStartTimers() { | 188 void ExclusiveAccessBubble::ShowAndStartTimers() { |
199 Show(); | 189 Show(); |
200 | 190 |
201 // Do not allow the notification to hide for a few seconds. | 191 // Do not allow the notification to hide for a few seconds. |
202 hide_timeout_.Start(FROM_HERE, | 192 hide_timeout_.Start(FROM_HERE, |
203 base::TimeDelta::FromMilliseconds(kInitialDelayMs), this, | 193 base::TimeDelta::FromMilliseconds(kInitialDelayMs), this, |
204 &ExclusiveAccessBubble::CheckMousePosition); | 194 &ExclusiveAccessBubble::CheckMousePosition); |
205 | 195 |
206 // Do not show the notification again until a long time has elapsed. | 196 // Do not show the notification again until a long time has elapsed. |
207 suppress_notify_timeout_.Start( | 197 suppress_notify_timeout_.Start( |
208 FROM_HERE, base::TimeDelta::FromMilliseconds(kSnoozeNotificationsTimeMs), | 198 FROM_HERE, base::TimeDelta::FromMilliseconds(kSnoozeNotificationsTimeMs), |
209 this, &ExclusiveAccessBubble::CheckMousePosition); | 199 this, &ExclusiveAccessBubble::CheckMousePosition); |
210 } | 200 } |
OLD | NEW |