| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2006 Samuel Weinig (sam.weinig@gmail.com) | 2 * Copyright (C) 2006 Samuel Weinig (sam.weinig@gmail.com) |
| 3 * Copyright (C) 2006 Apple Computer, Inc. All rights reserved. | 3 * Copyright (C) 2006 Apple Computer, Inc. All rights reserved. |
| 4 * | 4 * |
| 5 * Redistribution and use in source and binary forms, with or without | 5 * Redistribution and use in source and binary forms, with or without |
| 6 * modification, are permitted provided that the following conditions | 6 * modification, are permitted provided that the following conditions |
| 7 * are met: | 7 * are met: |
| 8 * 1. Redistributions of source code must retain the above copyright | 8 * 1. Redistributions of source code must retain the above copyright |
| 9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
| 10 * 2. Redistributions in binary form must reproduce the above copyright | 10 * 2. Redistributions in binary form must reproduce the above copyright |
| (...skipping 968 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 979 void WebFrameImpl::enableContinuousSpellChecking(bool enable) { | 979 void WebFrameImpl::enableContinuousSpellChecking(bool enable) { |
| 980 if (enable == isContinuousSpellCheckingEnabled()) | 980 if (enable == isContinuousSpellCheckingEnabled()) |
| 981 return; | 981 return; |
| 982 frame()->editor()->toggleContinuousSpellChecking(); | 982 frame()->editor()->toggleContinuousSpellChecking(); |
| 983 } | 983 } |
| 984 | 984 |
| 985 bool WebFrameImpl::isContinuousSpellCheckingEnabled() const { | 985 bool WebFrameImpl::isContinuousSpellCheckingEnabled() const { |
| 986 return frame()->editor()->isContinuousSpellCheckingEnabled(); | 986 return frame()->editor()->isContinuousSpellCheckingEnabled(); |
| 987 } | 987 } |
| 988 | 988 |
| 989 void WebFrameImpl::selectAll() { | |
| 990 frame()->selection()->selectAll(); | |
| 991 | |
| 992 WebViewDelegate* d = GetWebViewImpl()->GetDelegate(); | |
| 993 if (d) | |
| 994 d->UserMetricsRecordAction(L"SelectAll"); | |
| 995 } | |
| 996 | |
| 997 void WebFrameImpl::clearSelection() { | |
| 998 frame()->selection()->clear(); | |
| 999 } | |
| 1000 | |
| 1001 bool WebFrameImpl::hasSelection() const { | 989 bool WebFrameImpl::hasSelection() const { |
| 1002 // frame()->selection()->isNone() never returns true. | 990 // frame()->selection()->isNone() never returns true. |
| 1003 return (frame()->selection()->start() != frame()->selection()->end()); | 991 return (frame()->selection()->start() != frame()->selection()->end()); |
| 1004 } | 992 } |
| 1005 | 993 |
| 1006 WebRange WebFrameImpl::selectionRange() const { | 994 WebRange WebFrameImpl::selectionRange() const { |
| 1007 return webkit_glue::RangeToWebRange( | 995 return webkit_glue::RangeToWebRange( |
| 1008 frame()->selection()->toNormalizedRange()); | 996 frame()->selection()->toNormalizedRange()); |
| 1009 } | 997 } |
| 1010 | 998 |
| (...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1127 // be active but we still continue searching. This matches Safari's | 1115 // be active but we still continue searching. This matches Safari's |
| 1128 // behavior, including some oddities when selectable and un-selectable text | 1116 // behavior, including some oddities when selectable and un-selectable text |
| 1129 // are mixed on a page: see https://bugs.webkit.org/show_bug.cgi?id=19127. | 1117 // are mixed on a page: see https://bugs.webkit.org/show_bug.cgi?id=19127. |
| 1130 if (new_selection.isNone() || | 1118 if (new_selection.isNone() || |
| 1131 (new_selection.start() == new_selection.end())) { | 1119 (new_selection.start() == new_selection.end())) { |
| 1132 active_match_ = NULL; | 1120 active_match_ = NULL; |
| 1133 } else { | 1121 } else { |
| 1134 active_match_ = new_selection.toNormalizedRange(); | 1122 active_match_ = new_selection.toNormalizedRange(); |
| 1135 curr_selection_rect = active_match_->boundingBox(); | 1123 curr_selection_rect = active_match_->boundingBox(); |
| 1136 SetMarkerActive(active_match_.get(), true); // Active. | 1124 SetMarkerActive(active_match_.get(), true); // Active. |
| 1137 clearSelection(); // WebKit draws the highlighting for all matches. | 1125 // WebKit draws the highlighting for all matches. |
| 1126 executeCommand(WebString::fromUTF8("Unselect")); |
| 1138 } | 1127 } |
| 1139 | 1128 |
| 1140 if (!options.findNext) { | 1129 if (!options.findNext) { |
| 1141 // This is a Find operation, so we set the flag to ask the scoping effort | 1130 // This is a Find operation, so we set the flag to ask the scoping effort |
| 1142 // to find the active rect for us so we can update the ordinal (n of m). | 1131 // to find the active rect for us so we can update the ordinal (n of m). |
| 1143 locating_active_rect_ = true; | 1132 locating_active_rect_ = true; |
| 1144 } else { | 1133 } else { |
| 1145 if (old_active_frame != this) { | 1134 if (old_active_frame != this) { |
| 1146 // If the active frame has changed it means that we have a multi-frame | 1135 // If the active frame has changed it means that we have a multi-frame |
| 1147 // page and we just switch to searching in a new frame. Then we just | 1136 // page and we just switch to searching in a new frame. Then we just |
| (...skipping 713 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1861 | 1850 |
| 1862 SecurityOrigin* security_origin = frame_->document()->securityOrigin(); | 1851 SecurityOrigin* security_origin = frame_->document()->securityOrigin(); |
| 1863 | 1852 |
| 1864 if (!frame_->loader()->isScheduledLocationChangePending()) { | 1853 if (!frame_->loader()->isScheduledLocationChangePending()) { |
| 1865 frame_->loader()->stopAllLoaders(); | 1854 frame_->loader()->stopAllLoaders(); |
| 1866 frame_->loader()->begin(frame_->loader()->url(), true, security_origin); | 1855 frame_->loader()->begin(frame_->loader()->url(), true, security_origin); |
| 1867 frame_->loader()->write(script_result); | 1856 frame_->loader()->write(script_result); |
| 1868 frame_->loader()->end(); | 1857 frame_->loader()->end(); |
| 1869 } | 1858 } |
| 1870 } | 1859 } |
| OLD | NEW |