OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2011, 2012 Google Inc. All rights reserved. | 2 * Copyright (C) 2011, 2012 Google Inc. All rights reserved. |
3 * | 3 * |
4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
5 * modification, are permitted provided that the following conditions are | 5 * modification, are permitted provided that the following conditions are |
6 * met: | 6 * met: |
7 * | 7 * |
8 * * Redistributions of source code must retain the above copyright | 8 * * 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 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
(...skipping 265 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
276 // Pass the WebViewImpl's self-reference to the caller. | 276 // Pass the WebViewImpl's self-reference to the caller. |
277 return WebViewImpl::Create(client, visibility_state); | 277 return WebViewImpl::Create(client, visibility_state); |
278 } | 278 } |
279 | 279 |
280 WebViewImpl* WebViewImpl::Create(WebViewClient* client, | 280 WebViewImpl* WebViewImpl::Create(WebViewClient* client, |
281 WebPageVisibilityState visibility_state) { | 281 WebPageVisibilityState visibility_state) { |
282 // Pass the WebViewImpl's self-reference to the caller. | 282 // Pass the WebViewImpl's self-reference to the caller. |
283 return AdoptRef(new WebViewImpl(client, visibility_state)).LeakRef(); | 283 return AdoptRef(new WebViewImpl(client, visibility_state)).LeakRef(); |
284 } | 284 } |
285 | 285 |
| 286 const WebInputEvent* WebViewBase::CurrentInputEvent() { |
| 287 return WebViewImpl::CurrentInputEvent(); |
| 288 } |
| 289 |
286 void WebView::SetUseExternalPopupMenus(bool use_external_popup_menus) { | 290 void WebView::SetUseExternalPopupMenus(bool use_external_popup_menus) { |
287 g_should_use_external_popup_menus = use_external_popup_menus; | 291 g_should_use_external_popup_menus = use_external_popup_menus; |
288 } | 292 } |
289 | 293 |
290 void WebView::UpdateVisitedLinkState(unsigned long long link_hash) { | 294 void WebView::UpdateVisitedLinkState(unsigned long long link_hash) { |
291 Page::VisitedStateChanged(link_hash); | 295 Page::VisitedStateChanged(link_hash); |
292 } | 296 } |
293 | 297 |
294 void WebView::ResetVisitedLinkState(bool invalidate_visited_link_hashes) { | 298 void WebView::ResetVisitedLinkState(bool invalidate_visited_link_hashes) { |
295 Page::AllVisitedStateChanged(invalidate_visited_link_hashes); | 299 Page::AllVisitedStateChanged(invalidate_visited_link_hashes); |
(...skipping 1354 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1650 // Firefox reveal focus based on "keydown" event but not "contextmenu" | 1654 // Firefox reveal focus based on "keydown" event but not "contextmenu" |
1651 // event, we match FF. | 1655 // event, we match FF. |
1652 if (Element* focused_element = | 1656 if (Element* focused_element = |
1653 ToLocalFrame(focused_frame)->GetDocument()->FocusedElement()) | 1657 ToLocalFrame(focused_frame)->GetDocument()->FocusedElement()) |
1654 focused_element->scrollIntoViewIfNeeded(); | 1658 focused_element->scrollIntoViewIfNeeded(); |
1655 return ToLocalFrame(focused_frame) | 1659 return ToLocalFrame(focused_frame) |
1656 ->GetEventHandler() | 1660 ->GetEventHandler() |
1657 .SendContextMenuEventForKey(nullptr); | 1661 .SendContextMenuEventForKey(nullptr); |
1658 } | 1662 } |
1659 } | 1663 } |
| 1664 #else |
| 1665 WebInputEventResult WebViewImpl::SendContextMenuEvent( |
| 1666 const WebKeyboardEvent& event) { |
| 1667 return WebInputEventResult::kNotHandled; |
| 1668 } |
1660 #endif | 1669 #endif |
1661 | 1670 |
1662 void WebViewImpl::ShowContextMenuAtPoint(float x, | 1671 void WebViewImpl::ShowContextMenuAtPoint(float x, |
1663 float y, | 1672 float y, |
1664 ContextMenuProvider* menu_provider) { | 1673 ContextMenuProvider* menu_provider) { |
1665 if (!GetPage()->MainFrame()->IsLocalFrame()) | 1674 if (!GetPage()->MainFrame()->IsLocalFrame()) |
1666 return; | 1675 return; |
1667 { | 1676 { |
1668 ContextMenuAllowedScope scope; | 1677 ContextMenuAllowedScope scope; |
1669 GetPage()->GetContextMenuController().ClearContextMenu(); | 1678 GetPage()->GetContextMenuController().ClearContextMenu(); |
(...skipping 2486 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4156 if (focused_frame->LocalFrameRoot() != MainFrameImpl()->GetFrame()) | 4165 if (focused_frame->LocalFrameRoot() != MainFrameImpl()->GetFrame()) |
4157 return nullptr; | 4166 return nullptr; |
4158 return focused_frame; | 4167 return focused_frame; |
4159 } | 4168 } |
4160 | 4169 |
4161 LocalFrame* WebViewImpl::FocusedLocalFrameAvailableForIme() const { | 4170 LocalFrame* WebViewImpl::FocusedLocalFrameAvailableForIme() const { |
4162 return ime_accept_events_ ? FocusedLocalFrameInWidget() : nullptr; | 4171 return ime_accept_events_ ? FocusedLocalFrameInWidget() : nullptr; |
4163 } | 4172 } |
4164 | 4173 |
4165 } // namespace blink | 4174 } // namespace blink |
OLD | NEW |