| 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) 2008 Nuanti Ltd. | 3 * Copyright (C) 2008 Nuanti Ltd. |
| 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 250 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 261 return m_page->mainFrame(); | 261 return m_page->mainFrame(); |
| 262 } | 262 } |
| 263 | 263 |
| 264 void FocusController::setFocused(bool focused) | 264 void FocusController::setFocused(bool focused) |
| 265 { | 265 { |
| 266 if (isFocused() == focused) | 266 if (isFocused() == focused) |
| 267 return; | 267 return; |
| 268 | 268 |
| 269 m_isFocused = focused; | 269 m_isFocused = focused; |
| 270 | 270 |
| 271 if (!m_isFocused) | |
| 272 focusedOrMainFrame()->eventHandler().stopAutoscroll(); | |
| 273 | |
| 274 if (!m_focusedFrame) | 271 if (!m_focusedFrame) |
| 275 setFocusedFrame(m_page->mainFrame()); | 272 setFocusedFrame(m_page->mainFrame()); |
| 276 | 273 |
| 277 // setFocusedFrame above might reject to update m_focusedFrame, or | 274 // setFocusedFrame above might reject to update m_focusedFrame, or |
| 278 // m_focusedFrame might be changed by blur/focus event handlers. | 275 // m_focusedFrame might be changed by blur/focus event handlers. |
| 279 if (m_focusedFrame->view()) { | 276 if (m_focusedFrame->view()) { |
| 280 m_focusedFrame->selection().setFocused(focused); | 277 m_focusedFrame->selection().setFocused(focused); |
| 281 dispatchEventsOnWindowAndFocusedNode(m_focusedFrame->document(), focused
); | 278 dispatchEventsOnWindowAndFocusedNode(m_focusedFrame->document(), focused
); |
| 282 } | 279 } |
| 283 } | 280 } |
| (...skipping 302 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 586 { | 583 { |
| 587 if (m_isActive == active) | 584 if (m_isActive == active) |
| 588 return; | 585 return; |
| 589 | 586 |
| 590 m_isActive = active; | 587 m_isActive = active; |
| 591 | 588 |
| 592 focusedOrMainFrame()->selection().pageActivationChanged(); | 589 focusedOrMainFrame()->selection().pageActivationChanged(); |
| 593 } | 590 } |
| 594 | 591 |
| 595 } // namespace blink | 592 } // namespace blink |
| OLD | NEW |