| 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 996 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1007 void WebViewImpl::SetInitialFocus(bool reverse) { | 1007 void WebViewImpl::SetInitialFocus(bool reverse) { |
| 1008 if (page_.get()) { | 1008 if (page_.get()) { |
| 1009 // So RestoreFocus does not focus anything when it is called. | 1009 // So RestoreFocus does not focus anything when it is called. |
| 1010 ReleaseFocusReferences(); | 1010 ReleaseFocusReferences(); |
| 1011 | 1011 |
| 1012 // Since we don't have a keyboard event, we'll create one. | 1012 // Since we don't have a keyboard event, we'll create one. |
| 1013 WebKeyboardEvent keyboard_event; | 1013 WebKeyboardEvent keyboard_event; |
| 1014 keyboard_event.type = WebInputEvent::KEY_DOWN; | 1014 keyboard_event.type = WebInputEvent::KEY_DOWN; |
| 1015 if (reverse) | 1015 if (reverse) |
| 1016 keyboard_event.modifiers = WebInputEvent::SHIFT_KEY; | 1016 keyboard_event.modifiers = WebInputEvent::SHIFT_KEY; |
| 1017 #if defined(OS_WIN) | 1017 // VK_TAB which is only defined on Windows. |
| 1018 keyboard_event.key_code = VK_TAB; | 1018 keyboard_event.key_code = 0x09; |
| 1019 #endif | |
| 1020 keyboard_event.key_data = L'\t'; | |
| 1021 MakePlatformKeyboardEvent platform_event(keyboard_event); | 1019 MakePlatformKeyboardEvent platform_event(keyboard_event); |
| 1022 // We have to set the key type explicitly to avoid an assert in the | 1020 // We have to set the key type explicitly to avoid an assert in the |
| 1023 // KeyboardEvent constructor. | 1021 // KeyboardEvent constructor. |
| 1024 platform_event.SetKeyType(PlatformKeyboardEvent::RawKeyDown); | 1022 platform_event.SetKeyType(PlatformKeyboardEvent::RawKeyDown); |
| 1025 RefPtr<KeyboardEvent> webkit_event = KeyboardEvent::create(platform_event, N
ULL); | 1023 RefPtr<KeyboardEvent> webkit_event = KeyboardEvent::create(platform_event, N
ULL); |
| 1026 page()->focusController()->setInitialFocus( | 1024 page()->focusController()->setInitialFocus( |
| 1027 reverse ? WebCore::FocusDirectionBackward : | 1025 reverse ? WebCore::FocusDirectionBackward : |
| 1028 WebCore::FocusDirectionForward, | 1026 WebCore::FocusDirectionForward, |
| 1029 webkit_event.get()); | 1027 webkit_event.get()); |
| 1030 } | 1028 } |
| (...skipping 512 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1543 } | 1541 } |
| 1544 | 1542 |
| 1545 void WebViewImpl::DeleteImageResourceFetcher(ImageResourceFetcher* fetcher) { | 1543 void WebViewImpl::DeleteImageResourceFetcher(ImageResourceFetcher* fetcher) { |
| 1546 DCHECK(image_fetchers_.find(fetcher) != image_fetchers_.end()); | 1544 DCHECK(image_fetchers_.find(fetcher) != image_fetchers_.end()); |
| 1547 image_fetchers_.erase(fetcher); | 1545 image_fetchers_.erase(fetcher); |
| 1548 | 1546 |
| 1549 // We're in the callback from the ImageResourceFetcher, best to delay | 1547 // We're in the callback from the ImageResourceFetcher, best to delay |
| 1550 // deletion. | 1548 // deletion. |
| 1551 MessageLoop::current()->DeleteSoon(FROM_HERE, fetcher); | 1549 MessageLoop::current()->DeleteSoon(FROM_HERE, fetcher); |
| 1552 } | 1550 } |
| OLD | NEW |