| 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 1352 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1363 scope_matches_factory_.RevokeAll(); | 1363 scope_matches_factory_.RevokeAll(); |
| 1364 active_match_index_ = -1; | 1364 active_match_index_ = -1; |
| 1365 } | 1365 } |
| 1366 | 1366 |
| 1367 void WebFrameImpl::SetFindEndstateFocusAndSelection() { | 1367 void WebFrameImpl::SetFindEndstateFocusAndSelection() { |
| 1368 WebFrameImpl* main_frame_impl = | 1368 WebFrameImpl* main_frame_impl = |
| 1369 static_cast<WebFrameImpl*>(GetView()->GetMainFrame()); | 1369 static_cast<WebFrameImpl*>(GetView()->GetMainFrame()); |
| 1370 | 1370 |
| 1371 if (this == main_frame_impl->active_match_frame() && | 1371 if (this == main_frame_impl->active_match_frame() && |
| 1372 active_match_.get()) { | 1372 active_match_.get()) { |
| 1373 // If the user has changed the selection since the match was found, we | 1373 // If the user has set the selection since the match was found, we |
| 1374 // don't focus anything. | 1374 // don't focus anything. |
| 1375 VisibleSelection selection(frame()->selection()->selection()); | 1375 VisibleSelection selection(frame()->selection()->selection()); |
| 1376 if (selection.isNone() || (selection.start() == selection.end()) || | 1376 if (!selection.isNone()) |
| 1377 active_match_->boundingBox() != | |
| 1378 selection.toNormalizedRange()->boundingBox()) | |
| 1379 return; | 1377 return; |
| 1380 | 1378 |
| 1381 // We will be setting focus ourselves, so we want the view to forget its | 1379 // We will be setting focus ourselves, so we want the view to forget its |
| 1382 // stored focus node so that it won't change it after we are done. | 1380 // stored focus node so that it won't change it after we are done. |
| 1383 static_cast<WebViewImpl*>(GetView())->ReleaseFocusReferences(); | 1381 static_cast<WebViewImpl*>(GetView())->ReleaseFocusReferences(); |
| 1384 | 1382 |
| 1385 // Try to find the first focusable node up the chain, which will, for | 1383 // Try to find the first focusable node up the chain, which will, for |
| 1386 // example, focus links if we have found text within the link. | 1384 // example, focus links if we have found text within the link. |
| 1387 Node* node = active_match_->firstNode(); | 1385 Node* node = active_match_->firstNode(); |
| 1388 while (node && !node->isFocusable() && node != frame()->document()) | 1386 while (node && !node->isFocusable() && node != frame()->document()) |
| (...skipping 562 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1951 return password_listeners_.get(input_element); | 1949 return password_listeners_.get(input_element); |
| 1952 } | 1950 } |
| 1953 | 1951 |
| 1954 void WebFrameImpl::ClearPasswordListeners() { | 1952 void WebFrameImpl::ClearPasswordListeners() { |
| 1955 for (PasswordListenerMap::iterator iter = password_listeners_.begin(); | 1953 for (PasswordListenerMap::iterator iter = password_listeners_.begin(); |
| 1956 iter != password_listeners_.end(); ++iter) { | 1954 iter != password_listeners_.end(); ++iter) { |
| 1957 delete iter->second; | 1955 delete iter->second; |
| 1958 } | 1956 } |
| 1959 password_listeners_.clear(); | 1957 password_listeners_.clear(); |
| 1960 } | 1958 } |
| OLD | NEW |