Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(258)

Side by Side Diff: content/browser/accessibility/browser_accessibility_state_impl.cc

Issue 16431010: Refactor RenderProcessHost to use IPC::Listener instead of RenderWidgetHost (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase on top of hash_pair move. Created 7 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 "content/browser/accessibility/browser_accessibility_state_impl.h" 5 #include "content/browser/accessibility/browser_accessibility_state_impl.h"
6 6
7 #include "base/command_line.h" 7 #include "base/command_line.h"
8 #include "base/metrics/histogram.h" 8 #include "base/metrics/histogram.h"
9 #include "base/timer.h" 9 #include "base/timer.h"
10 #include "content/browser/renderer_host/render_widget_host_impl.h" 10 #include "content/browser/renderer_host/render_widget_host_impl.h"
(...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after
121 #if !defined(OS_WIN) 121 #if !defined(OS_WIN)
122 void BrowserAccessibilityStateImpl::UpdatePlatformSpecificHistograms() { 122 void BrowserAccessibilityStateImpl::UpdatePlatformSpecificHistograms() {
123 } 123 }
124 #endif 124 #endif
125 125
126 void BrowserAccessibilityStateImpl::SetAccessibilityMode( 126 void BrowserAccessibilityStateImpl::SetAccessibilityMode(
127 AccessibilityMode mode) { 127 AccessibilityMode mode) {
128 if (accessibility_mode_ == mode) 128 if (accessibility_mode_ == mode)
129 return; 129 return;
130 accessibility_mode_ = mode; 130 accessibility_mode_ = mode;
131 for (RenderProcessHost::iterator it(RenderProcessHost::AllHostsIterator());
132 !it.IsAtEnd(); it.Advance()) {
133 RenderProcessHost* render_process_host = it.GetCurrentValue();
134 DCHECK(render_process_host);
135 131
132 RenderWidgetHost::List widgets = RenderWidgetHost::GetRenderWidgetHosts();
133 for (size_t i = 0; i < widgets.size(); ++i) {
136 // Ignore processes that don't have a connection, such as crashed tabs. 134 // Ignore processes that don't have a connection, such as crashed tabs.
137 if (!render_process_host->HasConnection()) 135 if (!widgets[i]->GetProcess()->HasConnection())
136 continue;
137 if (!widgets[i]->IsRenderView())
138 continue; 138 continue;
139 139
140 for (RenderProcessHost::RenderWidgetHostsIterator rwit( 140 RenderWidgetHostImpl::From(widgets[i])->SetAccessibilityMode(mode);
141 render_process_host->GetRenderWidgetHostsIterator());
142 !rwit.IsAtEnd();
143 rwit.Advance()) {
144 RenderWidgetHost* rwh = const_cast<RenderWidgetHost*>(
145 rwit.GetCurrentValue());
146 DCHECK(rwh);
147 if (!rwh || !rwh->IsRenderView())
148 continue;
149 RenderWidgetHostImpl* rwhi = RenderWidgetHostImpl::From(rwh);
150 rwhi->SetAccessibilityMode(mode);
151 }
152 } 141 }
153 } 142 }
154 143
155 } // namespace content 144 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/accessibility/accessibility_ui.cc ('k') | content/browser/devtools/render_view_devtools_agent_host.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698