summaryrefslogtreecommitdiffstats
path: root/ui
diff options
context:
space:
mode:
authordtseng <dtseng@chromium.org>2015-02-18 18:19:55 -0800
committerCommit bot <commit-bot@chromium.org>2015-02-19 02:20:35 +0000
commitf8476d3181eef9319e5f53049b254a6dc476f49c (patch)
tree271c4c9c50afd42f8237e004c427cd6f207b5438 /ui
parentdd5652e562e15cd8fbc3ead9d5dcc47c48575f1b (diff)
downloadchromium_src-f8476d3181eef9319e5f53049b254a6dc476f49c.zip
chromium_src-f8476d3181eef9319e5f53049b254a6dc476f49c.tar.gz
chromium_src-f8476d3181eef9319e5f53049b254a6dc476f49c.tar.bz2
Revert of Reland #4: Ensure WebView notifies desktop automation on creation, (patchset #1 id:1 of https://codereview.chromium.org/940763002/)
Reason for revert: Still flakes on bots. Original issue's description: > Reland #4: Ensure WebView notifies desktop automation on creation, destruction, and change > > Previous attempts: > https://codereview.chromium.org/880063002 > https://codereview.chromium.org/895623003/ > https://codereview.chromium.org/890013006/ > https://codereview.chromium.org/907973004/ > > This latest attempt removes the logic that reloads ChromeVox at the beginning of a test. > > Locally, under extremely heavy load, tests progressively ran slowe. The same copy of a test ran 1 second slower than a previous copy. Ultimately, this led to a timeout. > > With the above change, this no longer occurs and hopefully fixes the flakeyness. > > Change is located in chromevox_e2e_test_base.js. > > TBR=dmazzoni@chromium.org > > Committed: https://crrev.com/47cb3b3798d325f3083565a05a2dcdaee117c296 > Cr-Commit-Position: refs/heads/master@{#316950} TBR=dmazzoni@chromium.org NOPRESUBMIT=true NOTREECHECKS=true NOTRY=true Review URL: https://codereview.chromium.org/939853003 Cr-Commit-Position: refs/heads/master@{#316971}
Diffstat (limited to 'ui')
-rw-r--r--ui/views/accessibility/ax_aura_obj_cache.cc3
-rw-r--r--ui/views/accessibility/ax_aura_obj_cache.h6
-rw-r--r--ui/views/accessibility/ax_widget_obj_wrapper.cc6
-rw-r--r--ui/views/controls/webview/webview.cc25
-rw-r--r--ui/views/controls/webview/webview.h2
5 files changed, 14 insertions, 28 deletions
diff --git a/ui/views/accessibility/ax_aura_obj_cache.cc b/ui/views/accessibility/ax_aura_obj_cache.cc
index 05f1868..ae2df20 100644
--- a/ui/views/accessibility/ax_aura_obj_cache.cc
+++ b/ui/views/accessibility/ax_aura_obj_cache.cc
@@ -76,11 +76,10 @@ void AXAuraObjCache::Remove(int32 id) {
delete obj;
}
-AXAuraObjCache::AXAuraObjCache() : current_id_(1), is_destroying_(false) {
+AXAuraObjCache::AXAuraObjCache() : current_id_(1) {
}
AXAuraObjCache::~AXAuraObjCache() {
- is_destroying_ = true;
STLDeleteContainerPairSecondPointers(cache_.begin(), cache_.end());
cache_.clear();
}
diff --git a/ui/views/accessibility/ax_aura_obj_cache.h b/ui/views/accessibility/ax_aura_obj_cache.h
index a8316b5..6e5d9e8 100644
--- a/ui/views/accessibility/ax_aura_obj_cache.h
+++ b/ui/views/accessibility/ax_aura_obj_cache.h
@@ -52,9 +52,6 @@ class VIEWS_EXPORT AXAuraObjCache {
// Remove a cached entry based on an id.
void Remove(int32 id);
- // Indicates if this object's currently being destroyed.
- bool is_destroying() { return is_destroying_; }
-
private:
friend struct DefaultSingletonTraits<AXAuraObjCache>;
@@ -78,9 +75,6 @@ class VIEWS_EXPORT AXAuraObjCache {
std::map<int32, AXAuraObjWrapper*> cache_;
int32 current_id_;
- // True immediately when entering this object's destructor.
- bool is_destroying_;
-
DISALLOW_COPY_AND_ASSIGN(AXAuraObjCache);
};
diff --git a/ui/views/accessibility/ax_widget_obj_wrapper.cc b/ui/views/accessibility/ax_widget_obj_wrapper.cc
index 44fcfa8..36a3143 100644
--- a/ui/views/accessibility/ax_widget_obj_wrapper.cc
+++ b/ui/views/accessibility/ax_widget_obj_wrapper.cc
@@ -17,10 +17,8 @@ AXWidgetObjWrapper::AXWidgetObjWrapper(Widget* widget) : widget_(widget) {
}
AXWidgetObjWrapper::~AXWidgetObjWrapper() {
- if (!AXAuraObjCache::GetInstance()->is_destroying()) {
- widget_->RemoveObserver(this);
- widget_->RemoveRemovalsObserver(this);
- }
+ widget_->RemoveObserver(this);
+ widget_->RemoveRemovalsObserver(this);
widget_ = NULL;
}
diff --git a/ui/views/controls/webview/webview.cc b/ui/views/controls/webview/webview.cc
index e872a58..2e4ba84 100644
--- a/ui/views/controls/webview/webview.cc
+++ b/ui/views/controls/webview/webview.cc
@@ -78,7 +78,7 @@ void WebView::SetWebContents(content::WebContents* replacement) {
DCHECK(!is_embedding_fullscreen_widget_);
}
AttachWebContents();
- NotifyMaybeTextInputClientAndAccessibilityChanged();
+ NotifyMaybeTextInputClientChanged();
}
void WebView::SetEmbedFullscreenWidgetMode(bool enable) {
@@ -266,7 +266,7 @@ gfx::Size WebView::GetPreferredSize() const {
void WebView::RenderProcessExited(content::RenderProcessHost* host,
base::TerminationStatus status,
int exit_code) {
- NotifyMaybeTextInputClientAndAccessibilityChanged();
+ NotifyMaybeTextInputClientChanged();
}
void WebView::RenderProcessHostDestroyed(content::RenderProcessHost* host) {
@@ -293,11 +293,11 @@ bool WebView::EmbedsFullscreenWidget() const {
// WebView, content::WebContentsObserver implementation:
void WebView::RenderViewReady() {
- NotifyMaybeTextInputClientAndAccessibilityChanged();
+ NotifyMaybeTextInputClientChanged();
}
void WebView::RenderViewDeleted(content::RenderViewHost* render_view_host) {
- NotifyMaybeTextInputClientAndAccessibilityChanged();
+ NotifyMaybeTextInputClientChanged();
}
void WebView::RenderViewHostChanged(content::RenderViewHost* old_host,
@@ -305,7 +305,7 @@ void WebView::RenderViewHostChanged(content::RenderViewHost* old_host,
FocusManager* const focus_manager = GetFocusManager();
if (focus_manager && focus_manager->GetFocusedView() == this)
OnFocus();
- NotifyMaybeTextInputClientAndAccessibilityChanged();
+ NotifyMaybeTextInputClientChanged();
}
void WebView::WebContentsDestroyed() {
@@ -313,7 +313,7 @@ void WebView::WebContentsDestroyed() {
observing_render_process_host_->RemoveObserver(this);
observing_render_process_host_ = nullptr;
}
- NotifyMaybeTextInputClientAndAccessibilityChanged();
+ NotifyMaybeTextInputClientChanged();
}
void WebView::DidShowFullscreenWidget(int routing_id) {
@@ -332,11 +332,11 @@ void WebView::DidToggleFullscreenModeForTab(bool entered_fullscreen) {
}
void WebView::DidAttachInterstitialPage() {
- NotifyMaybeTextInputClientAndAccessibilityChanged();
+ NotifyMaybeTextInputClientChanged();
}
void WebView::DidDetachInterstitialPage() {
- NotifyMaybeTextInputClientAndAccessibilityChanged();
+ NotifyMaybeTextInputClientChanged();
}
////////////////////////////////////////////////////////////////////////////////
@@ -398,19 +398,14 @@ void WebView::ReattachForFullscreenChange(bool enter_fullscreen) {
// the same. So, do not change attachment.
OnBoundsChanged(bounds());
}
- NotifyMaybeTextInputClientAndAccessibilityChanged();
+ NotifyMaybeTextInputClientChanged();
}
-void WebView::NotifyMaybeTextInputClientAndAccessibilityChanged() {
+void WebView::NotifyMaybeTextInputClientChanged() {
// Update the TextInputClient as needed; see GetTextInputClient().
FocusManager* const focus_manager = GetFocusManager();
if (focus_manager)
focus_manager->OnTextInputClientChanged(this);
-
-#if defined(OS_CHROMEOS)
- if (web_contents())
- NotifyAccessibilityEvent(ui::AX_EVENT_CHILDREN_CHANGED, false);
-#endif // defined OS_CHROMEOS
}
content::WebContents* WebView::CreateWebContents(
diff --git a/ui/views/controls/webview/webview.h b/ui/views/controls/webview/webview.h
index f97449b..af64b72 100644
--- a/ui/views/controls/webview/webview.h
+++ b/ui/views/controls/webview/webview.h
@@ -149,7 +149,7 @@ class WEBVIEW_EXPORT WebView : public View,
void AttachWebContents();
void DetachWebContents();
void ReattachForFullscreenChange(bool enter_fullscreen);
- void NotifyMaybeTextInputClientAndAccessibilityChanged();
+ void NotifyMaybeTextInputClientChanged();
// Create a regular or test web contents (based on whether we're running
// in a unit test or not).