| OLD | NEW |
| 1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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 "config.h" | 5 #include "config.h" |
| 6 | 6 |
| 7 #include "base/compiler_specific.h" | 7 #include "base/compiler_specific.h" |
| 8 | 8 |
| 9 MSVC_PUSH_WARNING_LEVEL(0); | 9 MSVC_PUSH_WARNING_LEVEL(0); |
| 10 #include "AccessibilityObject.h" | 10 #include "AccessibilityObject.h" |
| (...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 145 // operations associated with scaling. However, this value is used ins some | 145 // operations associated with scaling. However, this value is used ins some |
| 146 // cases by WebCore. For example, this is used as a scaling factor in canvas | 146 // cases by WebCore. For example, this is used as a scaling factor in canvas |
| 147 // so that things drawn in it are scaled just like the web page is. | 147 // so that things drawn in it are scaled just like the web page is. |
| 148 // | 148 // |
| 149 // We don't currently implement scaling, so just return 1.0 (no scaling). | 149 // We don't currently implement scaling, so just return 1.0 (no scaling). |
| 150 return 1.0; | 150 return 1.0; |
| 151 } | 151 } |
| 152 | 152 |
| 153 void ChromeClientImpl::focus() { | 153 void ChromeClientImpl::focus() { |
| 154 WebViewDelegate* delegate = webview_->delegate(); | 154 WebViewDelegate* delegate = webview_->delegate(); |
| 155 if (delegate) | 155 if (delegate) { |
| 156 delegate->didFocus(); | 156 delegate->didFocus(); |
| 157 | 157 |
| 158 // If accessibility is enabled, we should notify assistive technology that the | 158 // If accessibility is enabled, we should notify assistive technology that |
| 159 // active AccessibilityObject changed. | 159 // the active AccessibilityObject changed. |
| 160 WebCore::Document* doc = webview_->GetFocusedWebCoreFrame()->document(); | 160 WebCore::Document* doc = webview_->GetFocusedWebCoreFrame()->document(); |
| 161 | 161 |
| 162 if (doc && doc->axObjectCache()->accessibilityEnabled()) { | 162 if (doc && doc->axObjectCache()->accessibilityEnabled()) { |
| 163 WebCore::Node* focused_node = webview_->GetFocusedNode(); | 163 WebCore::Node* focused_node = webview_->GetFocusedNode(); |
| 164 | 164 |
| 165 if (!focused_node) { | 165 if (!focused_node) { |
| 166 // Could not retrieve focused Node. | 166 // Could not retrieve focused Node. |
| 167 return; | 167 return; |
| 168 } | 168 } |
| 169 | 169 |
| 170 // Retrieve the focused AccessibilityObject. | 170 // Retrieve the focused AccessibilityObject. |
| 171 WebCore::AccessibilityObject* focused_acc_obj = | 171 WebCore::AccessibilityObject* focused_acc_obj = |
| 172 doc->axObjectCache()->getOrCreate(focused_node->renderer()); | 172 doc->axObjectCache()->getOrCreate(focused_node->renderer()); |
| 173 | 173 |
| 174 // Alert assistive technology that focus changed. | 174 // Alert assistive technology that focus changed. |
| 175 if (focused_acc_obj) { | 175 if (focused_acc_obj) |
| 176 delegate->FocusAccessibilityObject(focused_acc_obj); | 176 delegate->FocusAccessibilityObject(focused_acc_obj); |
| 177 } | 177 } |
| 178 } | 178 } |
| 179 } | 179 } |
| 180 | 180 |
| 181 void ChromeClientImpl::unfocus() { | 181 void ChromeClientImpl::unfocus() { |
| 182 WebViewDelegate* delegate = webview_->delegate(); | 182 WebViewDelegate* delegate = webview_->delegate(); |
| 183 if (delegate) | 183 if (delegate) |
| 184 delegate->didBlur(); | 184 delegate->didBlur(); |
| 185 } | 185 } |
| 186 | 186 |
| (...skipping 440 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 627 break; | 627 break; |
| 628 default: | 628 default: |
| 629 NOTREACHED(); | 629 NOTREACHED(); |
| 630 } | 630 } |
| 631 } | 631 } |
| 632 | 632 |
| 633 info->itemHeight = popup_container->menuItemHeight(); | 633 info->itemHeight = popup_container->menuItemHeight(); |
| 634 info->selectedIndex = popup_container->selectedIndex(); | 634 info->selectedIndex = popup_container->selectedIndex(); |
| 635 info->items.swap(output_items); | 635 info->items.swap(output_items); |
| 636 } | 636 } |
| OLD | NEW |