| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright 2007 Google Inc. All Rights Reserved. | 2 * Copyright 2007 Google Inc. All Rights Reserved. |
| 3 * | 3 * |
| 4 * Portions Copyright (C) 2006 Apple Computer, Inc. All rights reserved. | 4 * Portions Copyright (C) 2006 Apple Computer, Inc. All rights reserved. |
| 5 * | 5 * |
| 6 * ***** BEGIN LICENSE BLOCK ***** | 6 * ***** BEGIN LICENSE BLOCK ***** |
| 7 * | 7 * |
| 8 * Redistribution and use in source and binary forms, with or without | 8 * Redistribution and use in source and binary forms, with or without |
| 9 * modification, are permitted provided that the following conditions | 9 * modification, are permitted provided that the following conditions |
| 10 * are met: | 10 * are met: |
| (...skipping 1157 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1168 platform_event.SetKeyType(PlatformKeyboardEvent::RawKeyDown); | 1168 platform_event.SetKeyType(PlatformKeyboardEvent::RawKeyDown); |
| 1169 RefPtr<KeyboardEvent> webkit_event = KeyboardEvent::create(platform_event, | 1169 RefPtr<KeyboardEvent> webkit_event = KeyboardEvent::create(platform_event, |
| 1170 NULL); | 1170 NULL); |
| 1171 page()->focusController()->setInitialFocus( | 1171 page()->focusController()->setInitialFocus( |
| 1172 reverse ? WebCore::FocusDirectionBackward : | 1172 reverse ? WebCore::FocusDirectionBackward : |
| 1173 WebCore::FocusDirectionForward, | 1173 WebCore::FocusDirectionForward, |
| 1174 webkit_event.get()); | 1174 webkit_event.get()); |
| 1175 } | 1175 } |
| 1176 } | 1176 } |
| 1177 | 1177 |
| 1178 bool WebViewImpl::FocusedFrameNeedsSpellchecking() { | |
| 1179 const WebCore::Frame* frame = GetFocusedWebCoreFrame(); | |
| 1180 if (!frame) | |
| 1181 return false; | |
| 1182 const WebCore::Editor* editor = frame->editor(); | |
| 1183 if (!editor) | |
| 1184 return false; | |
| 1185 const WebCore::Document* document = frame->document(); | |
| 1186 if (!document) | |
| 1187 return false; | |
| 1188 const WebCore::Node* node = document->focusedNode(); | |
| 1189 if (!node) | |
| 1190 return false; | |
| 1191 const WebCore::RenderObject* renderer = node->renderer(); | |
| 1192 if (!renderer) | |
| 1193 return false; | |
| 1194 // We should also retrieve the contenteditable attribute of this element to | |
| 1195 // determine if this element needs spell-checking. | |
| 1196 const WebCore::EUserModify user_modify = renderer->style()->userModify(); | |
| 1197 return (renderer->isTextArea() && editor->canEdit()) || | |
| 1198 user_modify == WebCore::READ_WRITE || | |
| 1199 user_modify == WebCore::READ_WRITE_PLAINTEXT_ONLY; | |
| 1200 } | |
| 1201 | |
| 1202 // Releases references used to restore focus. | 1178 // Releases references used to restore focus. |
| 1203 void WebViewImpl::ReleaseFocusReferences() { | 1179 void WebViewImpl::ReleaseFocusReferences() { |
| 1204 if (last_focused_frame_.get()) { | 1180 if (last_focused_frame_.get()) { |
| 1205 last_focused_frame_.release(); | 1181 last_focused_frame_.release(); |
| 1206 last_focused_node_.release(); | 1182 last_focused_node_.release(); |
| 1207 } | 1183 } |
| 1208 } | 1184 } |
| 1209 | 1185 |
| 1210 bool WebViewImpl::DownloadImage(int id, const GURL& image_url, int image_size) { | 1186 bool WebViewImpl::DownloadImage(int id, const GURL& image_url, int image_size) { |
| 1211 if (!page_.get()) | 1187 if (!page_.get()) |
| (...skipping 436 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1648 MessageLoop::current()->DeleteSoon(FROM_HERE, fetcher); | 1624 MessageLoop::current()->DeleteSoon(FROM_HERE, fetcher); |
| 1649 } | 1625 } |
| 1650 | 1626 |
| 1651 void WebViewImpl::HideAutoCompletePopup() { | 1627 void WebViewImpl::HideAutoCompletePopup() { |
| 1652 if (autocomplete_popup_) { | 1628 if (autocomplete_popup_) { |
| 1653 autocomplete_popup_->hidePopup(); | 1629 autocomplete_popup_->hidePopup(); |
| 1654 autocomplete_popup_.clear(); | 1630 autocomplete_popup_.clear(); |
| 1655 autocomplete_popup_client_.clear(); | 1631 autocomplete_popup_client_.clear(); |
| 1656 } | 1632 } |
| 1657 } | 1633 } |
| OLD | NEW |