| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2006, 2007 Apple, Inc. All rights reserved. | 2 * Copyright (C) 2006, 2007 Apple, Inc. All rights reserved. |
| 3 * Copyright (C) 2012 Google, Inc. All rights reserved. | 3 * Copyright (C) 2012 Google, 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 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 80 } | 80 } |
| 81 | 81 |
| 82 void SpellCheckerClientImpl::ToggleSpellCheckingEnabled() { | 82 void SpellCheckerClientImpl::ToggleSpellCheckingEnabled() { |
| 83 if (IsSpellCheckingEnabled()) { | 83 if (IsSpellCheckingEnabled()) { |
| 84 spell_check_this_field_status_ = kSpellCheckForcedOff; | 84 spell_check_this_field_status_ = kSpellCheckForcedOff; |
| 85 if (Page* page = web_view_->GetPage()) { | 85 if (Page* page = web_view_->GetPage()) { |
| 86 for (Frame* frame = page->MainFrame(); frame; | 86 for (Frame* frame = page->MainFrame(); frame; |
| 87 frame = frame->Tree().TraverseNext()) { | 87 frame = frame->Tree().TraverseNext()) { |
| 88 if (!frame->IsLocalFrame()) | 88 if (!frame->IsLocalFrame()) |
| 89 continue; | 89 continue; |
| 90 ToLocalFrame(frame)->GetDocument()->Markers().RemoveMarkers( | 90 ToLocalFrame(frame)->GetDocument()->Markers().RemoveMarkersOfTypes( |
| 91 DocumentMarker::MisspellingMarkers()); | 91 DocumentMarker::MisspellingMarkers()); |
| 92 } | 92 } |
| 93 } | 93 } |
| 94 } else { | 94 } else { |
| 95 spell_check_this_field_status_ = kSpellCheckForcedOn; | 95 spell_check_this_field_status_ = kSpellCheckForcedOn; |
| 96 if (web_view_->FocusedCoreFrame()->IsLocalFrame()) { | 96 if (web_view_->FocusedCoreFrame()->IsLocalFrame()) { |
| 97 if (LocalFrame* frame = ToLocalFrame(web_view_->FocusedCoreFrame())) { | 97 if (LocalFrame* frame = ToLocalFrame(web_view_->FocusedCoreFrame())) { |
| 98 VisibleSelection frame_selection = | 98 VisibleSelection frame_selection = |
| 99 frame->Selection().ComputeVisibleSelectionInDOMTreeDeprecated(); | 99 frame->Selection().ComputeVisibleSelectionInDOMTreeDeprecated(); |
| 100 // If a selection is in an editable element spell check its content. | 100 // If a selection is in an editable element spell check its content. |
| (...skipping 18 matching lines...) Expand all Loading... |
| 119 web_view_->SpellCheckClient()->ShowSpellingUI(show); | 119 web_view_->SpellCheckClient()->ShowSpellingUI(show); |
| 120 } | 120 } |
| 121 | 121 |
| 122 bool SpellCheckerClientImpl::SpellingUIIsShowing() { | 122 bool SpellCheckerClientImpl::SpellingUIIsShowing() { |
| 123 if (web_view_->SpellCheckClient()) | 123 if (web_view_->SpellCheckClient()) |
| 124 return web_view_->SpellCheckClient()->IsShowingSpellingUI(); | 124 return web_view_->SpellCheckClient()->IsShowingSpellingUI(); |
| 125 return false; | 125 return false; |
| 126 } | 126 } |
| 127 | 127 |
| 128 } // namespace blink | 128 } // namespace blink |
| OLD | NEW |