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 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
78 popup_->ShowInactive(); // This does not activate the popup. | 78 popup_->ShowInactive(); // This does not activate the popup. |
79 | 79 |
80 popup_->AddObserver(this); | 80 popup_->AddObserver(this); |
81 | 81 |
82 registrar_.Add(this, chrome::NOTIFICATION_FULLSCREEN_CHANGED, | 82 registrar_.Add(this, chrome::NOTIFICATION_FULLSCREEN_CHANGED, |
83 content::Source<FullscreenController>( | 83 content::Source<FullscreenController>( |
84 bubble_view_context_->GetExclusiveAccessManager() | 84 bubble_view_context_->GetExclusiveAccessManager() |
85 ->fullscreen_controller())); | 85 ->fullscreen_controller())); |
86 | 86 |
87 UpdateMouseWatcher(); | 87 UpdateMouseWatcher(); |
88 | |
89 view_->NotifyAccessibilityEvent(ui::AX_EVENT_ALERT, true); | |
tapted
2016/06/22 00:23:38
should this be in ExclusiveAccessBubbleViews::Show
Matt Giuca
2016/06/22 02:59:20
Yeah I think it should be in Show(), not the const
Patti Lor
2016/06/23 01:00:38
Done.
| |
88 } | 90 } |
89 | 91 |
90 ExclusiveAccessBubbleViews::~ExclusiveAccessBubbleViews() { | 92 ExclusiveAccessBubbleViews::~ExclusiveAccessBubbleViews() { |
91 popup_->RemoveObserver(this); | 93 popup_->RemoveObserver(this); |
92 | 94 |
93 // This is tricky. We may be in an ATL message handler stack, in which case | 95 // This is tricky. We may be in an ATL message handler stack, in which case |
94 // the popup cannot be deleted yet. We also can't set the popup's ownership | 96 // the popup cannot be deleted yet. We also can't set the popup's ownership |
95 // model to NATIVE_WIDGET_OWNS_WIDGET because if the user closed the last tab | 97 // model to NATIVE_WIDGET_OWNS_WIDGET because if the user closed the last tab |
96 // while in fullscreen mode, Windows has already destroyed the popup HWND by | 98 // while in fullscreen mode, Windows has already destroyed the popup HWND by |
97 // the time we get here, and thus either the popup will already have been | 99 // the time we get here, and thus either the popup will already have been |
(...skipping 20 matching lines...) Expand all Loading... | |
118 view_->SetSize(size); | 120 view_->SetSize(size); |
119 popup_->SetBounds(GetPopupRect(false)); | 121 popup_->SetBounds(GetPopupRect(false)); |
120 Show(); | 122 Show(); |
121 | 123 |
122 // Stop watching the mouse even if UpdateMouseWatcher() will start watching | 124 // 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 | 125 // it again so that the popup with the new content is visible for at least |
124 // |kInitialDelayMs|. | 126 // |kInitialDelayMs|. |
125 StopWatchingMouse(); | 127 StopWatchingMouse(); |
126 | 128 |
127 UpdateMouseWatcher(); | 129 UpdateMouseWatcher(); |
130 | |
131 view_->NotifyAccessibilityEvent(ui::AX_EVENT_TEXT_CHANGED, true); | |
tapted
2016/06/22 00:23:38
If we start by fixing Mac and address other platfo
Matt Giuca
2016/06/22 02:59:20
Are you saying this code is only relevant on non-M
Patti Lor
2016/06/23 01:00:38
Agreed - as far as I can tell, it doesn't work on
Matt Giuca
2016/06/24 04:21:12
I'm not sure (it's really hard to test on other pl
dmazzoni
2016/06/24 05:26:03
This is a reasonable event to fire on any platform
Patti Lor
2016/06/27 05:10:38
Ended up plumbing ui::AX_EVENT_TEXT_CHANGED throug
| |
128 } | 132 } |
129 | 133 |
130 void ExclusiveAccessBubbleViews::RepositionIfVisible() { | 134 void ExclusiveAccessBubbleViews::RepositionIfVisible() { |
131 if (popup_->IsVisible()) | 135 if (popup_->IsVisible()) |
132 UpdateBounds(); | 136 UpdateBounds(); |
133 } | 137 } |
134 | 138 |
135 views::View* ExclusiveAccessBubbleViews::GetView() { | 139 views::View* ExclusiveAccessBubbleViews::GetView() { |
136 return view_; | 140 return view_; |
137 } | 141 } |
(...skipping 140 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
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 |