| 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 "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 17 matching lines...) Expand all Loading... |
| 28 } | 28 } |
| 29 | 29 |
| 30 // static | 30 // static |
| 31 BrowserAccessibilityStateImpl* BrowserAccessibilityStateImpl::GetInstance() { | 31 BrowserAccessibilityStateImpl* BrowserAccessibilityStateImpl::GetInstance() { |
| 32 return Singleton<BrowserAccessibilityStateImpl, | 32 return Singleton<BrowserAccessibilityStateImpl, |
| 33 LeakySingletonTraits<BrowserAccessibilityStateImpl> >::get(); | 33 LeakySingletonTraits<BrowserAccessibilityStateImpl> >::get(); |
| 34 } | 34 } |
| 35 | 35 |
| 36 BrowserAccessibilityStateImpl::BrowserAccessibilityStateImpl() | 36 BrowserAccessibilityStateImpl::BrowserAccessibilityStateImpl() |
| 37 : BrowserAccessibilityState(), | 37 : BrowserAccessibilityState(), |
| 38 accessibility_mode_(AccessibilityModeOff) { | 38 accessibility_mode_(AccessibilityModeComplete) { |
| 39 #if defined(OS_WIN) | 39 #if defined(OS_WIN) |
| 40 // On Windows 8, always enable accessibility for editable text controls | 40 // On Windows 8, always enable accessibility for editable text controls |
| 41 // so we can show the virtual keyboard when one is enabled. | 41 // so we can show the virtual keyboard when one is enabled. |
| 42 if (base::win::GetVersion() >= base::win::VERSION_WIN8 && | 42 if (base::win::GetVersion() >= base::win::VERSION_WIN8 && |
| 43 !CommandLine::ForCurrentProcess()->HasSwitch( | 43 !CommandLine::ForCurrentProcess()->HasSwitch( |
| 44 switches::kDisableRendererAccessibility)) { | 44 switches::kDisableRendererAccessibility)) { |
| 45 accessibility_mode_ = AccessibilityModeEditableTextOnly; | 45 accessibility_mode_ = AccessibilityModeEditableTextOnly; |
| 46 } | 46 } |
| 47 #endif // defined(OS_WIN) | 47 #endif // defined(OS_WIN) |
| 48 | 48 |
| (...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 146 DCHECK(rwh); | 146 DCHECK(rwh); |
| 147 if (!rwh || !rwh->IsRenderView()) | 147 if (!rwh || !rwh->IsRenderView()) |
| 148 continue; | 148 continue; |
| 149 RenderWidgetHostImpl* rwhi = RenderWidgetHostImpl::From(rwh); | 149 RenderWidgetHostImpl* rwhi = RenderWidgetHostImpl::From(rwh); |
| 150 rwhi->SetAccessibilityMode(mode); | 150 rwhi->SetAccessibilityMode(mode); |
| 151 } | 151 } |
| 152 } | 152 } |
| 153 } | 153 } |
| 154 | 154 |
| 155 } // namespace content | 155 } // namespace content |
| OLD | NEW |