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/views/exclusive_access_bubble_views.h" | 5 #include "chrome/browser/ui/views/exclusive_access_bubble_views.h" |
6 | 6 |
7 #include <utility> | 7 #include <utility> |
8 | 8 |
9 #include "base/location.h" | 9 #include "base/location.h" |
10 #include "base/macros.h" | 10 #include "base/macros.h" |
(...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
118 view_->SetSize(size); | 118 view_->SetSize(size); |
119 popup_->SetBounds(GetPopupRect(false)); | 119 popup_->SetBounds(GetPopupRect(false)); |
120 Show(); | 120 Show(); |
121 | 121 |
122 // Stop watching the mouse even if UpdateMouseWatcher() will start watching | 122 // Stop watching the mouse even if UpdateMouseWatcher() will start watching |
123 // it again so that the popup with the new content is visible for at least | 123 // it again so that the popup with the new content is visible for at least |
124 // |kInitialDelayMs|. | 124 // |kInitialDelayMs|. |
125 StopWatchingMouse(); | 125 StopWatchingMouse(); |
126 | 126 |
127 UpdateMouseWatcher(); | 127 UpdateMouseWatcher(); |
| 128 |
| 129 view_->NotifyAccessibilityEvent(ui::AX_EVENT_TEXT_CHANGED, true); |
128 } | 130 } |
129 | 131 |
130 void ExclusiveAccessBubbleViews::RepositionIfVisible() { | 132 void ExclusiveAccessBubbleViews::RepositionIfVisible() { |
131 if (popup_->IsVisible()) | 133 if (popup_->IsVisible()) |
132 UpdateBounds(); | 134 UpdateBounds(); |
133 } | 135 } |
134 | 136 |
135 views::View* ExclusiveAccessBubbleViews::GetView() { | 137 views::View* ExclusiveAccessBubbleViews::GetView() { |
136 return view_; | 138 return view_; |
137 } | 139 } |
(...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
250 } | 252 } |
251 | 253 |
252 void ExclusiveAccessBubbleViews::Hide() { | 254 void ExclusiveAccessBubbleViews::Hide() { |
253 animation_->SetSlideDuration(kSlideOutDurationMs); | 255 animation_->SetSlideDuration(kSlideOutDurationMs); |
254 animation_->Hide(); | 256 animation_->Hide(); |
255 } | 257 } |
256 | 258 |
257 void ExclusiveAccessBubbleViews::Show() { | 259 void ExclusiveAccessBubbleViews::Show() { |
258 animation_->SetSlideDuration(kSlideInDurationMs); | 260 animation_->SetSlideDuration(kSlideInDurationMs); |
259 animation_->Show(); | 261 animation_->Show(); |
| 262 |
| 263 view_->NotifyAccessibilityEvent(ui::AX_EVENT_ALERT, true); |
260 } | 264 } |
261 | 265 |
262 bool ExclusiveAccessBubbleViews::IsAnimating() { | 266 bool ExclusiveAccessBubbleViews::IsAnimating() { |
263 return animation_->is_animating(); | 267 return animation_->is_animating(); |
264 } | 268 } |
265 | 269 |
266 bool ExclusiveAccessBubbleViews::CanMouseTriggerSlideIn() const { | 270 bool ExclusiveAccessBubbleViews::CanMouseTriggerSlideIn() const { |
267 return !bubble_view_context_->IsImmersiveModeEnabled(); | 271 return !bubble_view_context_->IsImmersiveModeEnabled(); |
268 } | 272 } |
269 | 273 |
270 void ExclusiveAccessBubbleViews::Observe( | 274 void ExclusiveAccessBubbleViews::Observe( |
271 int type, | 275 int type, |
272 const content::NotificationSource& source, | 276 const content::NotificationSource& source, |
273 const content::NotificationDetails& details) { | 277 const content::NotificationDetails& details) { |
274 DCHECK_EQ(chrome::NOTIFICATION_FULLSCREEN_CHANGED, type); | 278 DCHECK_EQ(chrome::NOTIFICATION_FULLSCREEN_CHANGED, type); |
275 UpdateMouseWatcher(); | 279 UpdateMouseWatcher(); |
276 } | 280 } |
277 | 281 |
278 void ExclusiveAccessBubbleViews::OnWidgetVisibilityChanged( | 282 void ExclusiveAccessBubbleViews::OnWidgetVisibilityChanged( |
279 views::Widget* widget, | 283 views::Widget* widget, |
280 bool visible) { | 284 bool visible) { |
281 UpdateMouseWatcher(); | 285 UpdateMouseWatcher(); |
282 } | 286 } |
283 | 287 |
284 void ExclusiveAccessBubbleViews::LinkClicked(views::Link* link, | 288 void ExclusiveAccessBubbleViews::LinkClicked(views::Link* link, |
285 int event_flags) { | 289 int event_flags) { |
286 ExitExclusiveAccess(); | 290 ExitExclusiveAccess(); |
287 } | 291 } |
OLD | NEW |