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

Side by Side Diff: content/browser/renderer_host/render_view_host_impl.cc

Issue 9939011: Add an accessibility mode for editable text fields only. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 8 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/renderer_host/render_view_host_impl.h" 5 #include "content/browser/renderer_host/render_view_host_impl.h"
6 6
7 #include <set> 7 #include <set>
8 #include <string> 8 #include <string>
9 #include <utility> 9 #include <utility>
10 #include <vector> 10 #include <vector>
(...skipping 15 matching lines...) Expand all
26 #include "content/browser/power_save_blocker.h" 26 #include "content/browser/power_save_blocker.h"
27 #include "content/browser/renderer_host/render_process_host_impl.h" 27 #include "content/browser/renderer_host/render_process_host_impl.h"
28 #include "content/common/accessibility_messages.h" 28 #include "content/common/accessibility_messages.h"
29 #include "content/common/desktop_notification_messages.h" 29 #include "content/common/desktop_notification_messages.h"
30 #include "content/common/drag_messages.h" 30 #include "content/common/drag_messages.h"
31 #include "content/common/inter_process_time_ticks_converter.h" 31 #include "content/common/inter_process_time_ticks_converter.h"
32 #include "content/common/speech_recognition_messages.h" 32 #include "content/common/speech_recognition_messages.h"
33 #include "content/common/swapped_out_messages.h" 33 #include "content/common/swapped_out_messages.h"
34 #include "content/common/view_messages.h" 34 #include "content/common/view_messages.h"
35 #include "content/port/browser/render_widget_host_view_port.h" 35 #include "content/port/browser/render_widget_host_view_port.h"
36 #include "content/public/browser/browser_accessibility_state.h"
36 #include "content/public/browser/browser_context.h" 37 #include "content/public/browser/browser_context.h"
37 #include "content/public/browser/browser_message_filter.h" 38 #include "content/public/browser/browser_message_filter.h"
38 #include "content/public/browser/content_browser_client.h" 39 #include "content/public/browser/content_browser_client.h"
39 #include "content/public/browser/dom_operation_notification_details.h" 40 #include "content/public/browser/dom_operation_notification_details.h"
40 #include "content/public/browser/native_web_keyboard_event.h" 41 #include "content/public/browser/native_web_keyboard_event.h"
41 #include "content/public/browser/notification_details.h" 42 #include "content/public/browser/notification_details.h"
42 #include "content/public/browser/notification_service.h" 43 #include "content/public/browser/notification_service.h"
43 #include "content/public/browser/notification_types.h" 44 #include "content/public/browser/notification_types.h"
44 #include "content/public/browser/render_view_host_delegate.h" 45 #include "content/public/browser/render_view_host_delegate.h"
45 #include "content/public/browser/render_view_host_observer.h" 46 #include "content/public/browser/render_view_host_observer.h"
(...skipping 151 matching lines...) Expand 10 before | Expand all | Expand 10 after
197 } 198 }
198 199
199 bool RenderViewHostImpl::CreateRenderView(const string16& frame_name, 200 bool RenderViewHostImpl::CreateRenderView(const string16& frame_name,
200 int32 max_page_id) { 201 int32 max_page_id) {
201 DCHECK(!IsRenderViewLive()) << "Creating view twice"; 202 DCHECK(!IsRenderViewLive()) << "Creating view twice";
202 203
203 // The process may (if we're sharing a process with another host that already 204 // The process may (if we're sharing a process with another host that already
204 // initialized it) or may not (we have our own process or the old process 205 // initialized it) or may not (we have our own process or the old process
205 // crashed) have been initialized. Calling Init multiple times will be 206 // crashed) have been initialized. Calling Init multiple times will be
206 // ignored, so this is safe. 207 // ignored, so this is safe.
207 if (!GetProcess()->Init(renderer_accessible())) 208 if (!GetProcess()->Init())
208 return false; 209 return false;
209 DCHECK(GetProcess()->HasConnection()); 210 DCHECK(GetProcess()->HasConnection());
210 DCHECK(GetProcess()->GetBrowserContext()); 211 DCHECK(GetProcess()->GetBrowserContext());
211 212
212 renderer_initialized_ = true; 213 renderer_initialized_ = true;
213 214
214 GpuSurfaceTracker::Get()->SetSurfaceHandle( 215 GpuSurfaceTracker::Get()->SetSurfaceHandle(
215 surface_id(), GetCompositingSurface()); 216 surface_id(), GetCompositingSurface());
216 217
217 // Ensure the RenderView starts with a next_page_id larger than any existing 218 // Ensure the RenderView starts with a next_page_id larger than any existing
(...skipping 19 matching lines...) Expand all
237 } else { 238 } else {
238 content::RenderWidgetHostViewPort::GetDefaultScreenInfo( 239 content::RenderWidgetHostViewPort::GetDefaultScreenInfo(
239 &params.screen_info); 240 &params.screen_info);
240 } 241 }
241 #else 242 #else
242 params.screen_info = 243 params.screen_info =
243 WebKit::WebScreenInfoFactory::screenInfo( 244 WebKit::WebScreenInfoFactory::screenInfo(
244 gfx::NativeViewFromId(GetNativeViewId())); 245 gfx::NativeViewFromId(GetNativeViewId()));
245 #endif 246 #endif
246 params.guest = guest_; 247 params.guest = guest_;
248 params.accessibility_mode =
249 BrowserAccessibilityState::GetInstance()->IsAccessibleBrowser() ?
250 AccessibilityModeComplete :
David Tseng 2012/04/05 01:01:25 nit: indent looks wrong here.
dmazzoni 2012/04/06 21:47:22 Done.
251 AccessibilityModeOff;
252
253 #if defined(OS_WIN)
254 // On Windows 8, always enable accessibility for editable text controls
255 // so we can show the virtual keyboard when one is enabled.
256 if (base::win::GetVersion() >= base::win::VERSION_WIN8 &&
257 params.accessibility_mode == AccessibilityModeOff) {
258 params.accessibility_mode = AccessibilityModeEditableTextOnly;
259 }
260 #endif
247 261
248 Send(new ViewMsg_New(params)); 262 Send(new ViewMsg_New(params));
249 263
250 // If it's enabled, tell the renderer to set up the Javascript bindings for 264 // If it's enabled, tell the renderer to set up the Javascript bindings for
251 // sending messages back to the browser. 265 // sending messages back to the browser.
252 Send(new ViewMsg_AllowBindings(GetRoutingID(), enabled_bindings_)); 266 Send(new ViewMsg_AllowBindings(GetRoutingID(), enabled_bindings_));
253 // Let our delegate know that we created a RenderView. 267 // Let our delegate know that we created a RenderView.
254 delegate_->RenderViewCreated(this); 268 delegate_->RenderViewCreated(this);
255 269
256 // Invert the color scheme if the operating system's color scheme is 270 // Invert the color scheme if the operating system's color scheme is
(...skipping 1469 matching lines...) Expand 10 before | Expand all | Expand 10 after
1726 // can cause navigations to be ignored in OnMsgNavigate. 1740 // can cause navigations to be ignored in OnMsgNavigate.
1727 is_waiting_for_beforeunload_ack_ = false; 1741 is_waiting_for_beforeunload_ack_ = false;
1728 is_waiting_for_unload_ack_ = false; 1742 is_waiting_for_unload_ack_ = false;
1729 } 1743 }
1730 1744
1731 void RenderViewHostImpl::ClearPowerSaveBlockers() { 1745 void RenderViewHostImpl::ClearPowerSaveBlockers() {
1732 STLDeleteValues(&power_save_blockers_); 1746 STLDeleteValues(&power_save_blockers_);
1733 } 1747 }
1734 1748
1735 } // namespace content 1749 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698