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 3488 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3499 ContextMenu* menu = page_->GetContextMenuController().GetContextMenu(); | 3499 ContextMenu* menu = page_->GetContextMenuController().GetContextMenu(); |
3500 if (!menu) | 3500 if (!menu) |
3501 return; | 3501 return; |
3502 const ContextMenuItem* item = menu->ItemWithAction( | 3502 const ContextMenuItem* item = menu->ItemWithAction( |
3503 static_cast<ContextMenuAction>(kContextMenuItemBaseCustomTag + action)); | 3503 static_cast<ContextMenuAction>(kContextMenuItemBaseCustomTag + action)); |
3504 if (item) | 3504 if (item) |
3505 page_->GetContextMenuController().ContextMenuItemSelected(item); | 3505 page_->GetContextMenuController().ContextMenuItemSelected(item); |
3506 page_->GetContextMenuController().ClearContextMenu(); | 3506 page_->GetContextMenuController().ClearContextMenu(); |
3507 } | 3507 } |
3508 | 3508 |
3509 void WebViewImpl::ShowContextMenu() { | 3509 void WebViewImpl::ShowContextMenu(bool from_touch_handle) { |
3510 if (!GetPage()) | 3510 if (!GetPage()) |
3511 return; | 3511 return; |
3512 | 3512 |
3513 GetPage()->GetContextMenuController().ClearContextMenu(); | 3513 GetPage()->GetContextMenuController().ClearContextMenu(); |
3514 { | 3514 { |
3515 ContextMenuAllowedScope scope; | 3515 ContextMenuAllowedScope scope; |
3516 if (LocalFrame* focused_frame = | 3516 if (LocalFrame* focused_frame = ToLocalFrame( |
3517 ToLocalFrame(GetPage()->GetFocusController().FocusedOrMainFrame())) | 3517 GetPage()->GetFocusController().FocusedOrMainFrame())) { |
3518 focused_frame->GetEventHandler().SendContextMenuEventForKey(nullptr); | 3518 focused_frame->GetEventHandler().SendContextMenuEventForKey( |
| 3519 nullptr, from_touch_handle); |
| 3520 } |
3519 } | 3521 } |
3520 } | 3522 } |
3521 | 3523 |
3522 void WebViewImpl::DidCloseContextMenu() { | 3524 void WebViewImpl::DidCloseContextMenu() { |
3523 LocalFrame* frame = page_->GetFocusController().FocusedFrame(); | 3525 LocalFrame* frame = page_->GetFocusController().FocusedFrame(); |
3524 if (frame) | 3526 if (frame) |
3525 frame->Selection().SetCaretBlinkingSuspended(false); | 3527 frame->Selection().SetCaretBlinkingSuspended(false); |
3526 } | 3528 } |
3527 | 3529 |
3528 void WebViewImpl::HidePopups() { | 3530 void WebViewImpl::HidePopups() { |
(...skipping 640 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4169 if (focused_frame->LocalFrameRoot() != MainFrameImpl()->GetFrame()) | 4171 if (focused_frame->LocalFrameRoot() != MainFrameImpl()->GetFrame()) |
4170 return nullptr; | 4172 return nullptr; |
4171 return focused_frame; | 4173 return focused_frame; |
4172 } | 4174 } |
4173 | 4175 |
4174 LocalFrame* WebViewImpl::FocusedLocalFrameAvailableForIme() const { | 4176 LocalFrame* WebViewImpl::FocusedLocalFrameAvailableForIme() const { |
4175 return ime_accept_events_ ? FocusedLocalFrameInWidget() : nullptr; | 4177 return ime_accept_events_ ? FocusedLocalFrameInWidget() : nullptr; |
4176 } | 4178 } |
4177 | 4179 |
4178 } // namespace blink | 4180 } // namespace blink |
OLD | NEW |